Repository navigation
fix(plugin-calendar): align the calendar.allDay default to the pack and drop its dead ternary - #7574
Merged
os-project-manager merged 1 commit intoSep 4, 2026
Conversation
…nd drop its dead ternary
`CalendarView`'s `DEFAULT_TRANSLATIONS` table — the `defaults` map behind its
`createSafeTranslation` factory — spelled `calendar.allDay` as `all-day` while
all ten locale packs carry the key and `en` spells it `All Day`. That table is
served only when no `I18nProvider` is mounted, so the same all-day lane header
rendered `all-day` in a standalone embed and `All Day` inside the console.
Also deletes the lane header's `t('calendar.allDay') === 'calendar.allDay'`
ternary. The factory's provider-less arm resolves `defaults[key]` before it
could ever return the bare key, and with a provider mounted `createI18n` lays
the built-in packs under the caller's resources, so both paths carry the key.
The one construction that can still strip it — a caller overriding part of the
`calendar` group, which replaces the whole group — is filed separately, and the
ternary was no defence against it anyway: it guarded one of the seven
`calendar.*` labels this file renders, so the other six already render raw keys
in exactly that case.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-project-manager
marked this pull request as ready for review
September 4, 2026 00:12
os-project-manager
deleted the
claude/issue-7454-calendar-allday-spelling
branch
September 4, 2026 00:27
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7454
Clause-②: no— determined from this diff, not adopted. The diff moves nodeclaration and changes no published surface: the only changed line in shipped
code is a value inside the module-private
const DEFAULT_TRANSLATIONS, plus oneJSX expression. No
exportline is added, removed or moved (the soleexport/typetoken anywhere in the diff is atypeimport in the newtest file, which
files: ["dist", ...]never publishes).Scope is the triage ruling R+129, not the card title: the title still
describes two halves and only the instance half is here. The class half —
value-comparing factory
defaultstables inscripts/check-i18n-call-site-keys.mjs— is objectui#7567 and is untouched, as are
packages/i18n/src/locales/*.What changed
Two lines in
packages/plugin-calendar/src/CalendarView.tsx:DEFAULT_TRANSLATIONSentry'calendar.allDay': 'all-day'becomes'All Day't('calendar.allDay') === 'calendar.allDay' ? 'all-day' : t('calendar.allDay')becomest('calendar.allDay')Both sites were re-derived by content on this base rather than taken from
R+129's line numbers: they are still at 84 and 1271, so nothing drifted
from the
e304a4emeasurement.R+129's three grounds, re-measured
All Day. Confirmed, and stronger than stated: all tenpacks define
calendar.allDay(en.ts:671isallDay: 'All Day'), so nolanguage depends on the local table.
envalue. Confirmed, with one arithmeticcorrection: the table holds seven entries, so there are six siblings,
not seven — and 6 of 6 match
enexactly. The direction of the groundholds and is unanimous; only the count in the ruling's phrasing was off by
one.
createSafeTranslation(packages/i18n/src/useSafeTranslation.ts) ratherthan taking triage's word. Its provider-less arm is
defaults[key] || inlineDefault || key, anddefaultscarries a non-emptycalendar.allDay, so the|| keyarm cannot be reached for this key. Theprovider path is i18next's own
t, andcreateI18nlays the built-in packsunder any caller resources, so it too carries the key.
Stop-condition: swept, and it does not fire
Nothing marks the lowercase spelling as deliberate.
all-daythatcan reach a user are the two lines this PR changes. Every other hit is prose
about the concept, a spec
describe()string, or a test fixture'sid.w-14(56px) withpr-1and notruncate, and the two candidate strings are both seven characters, sothere is no width argument that distinguishes them.
20ae38aff(2026-05-11), whose message says only "Adds calendar.allDaytranslation key with English fallback 'all-day'", with no rationale.
en.tshad said
All Daysincebd3deb60f(2026-02-08) — three months earlier,and an ancestor of that commit. That same message records the author verifying
in a Chinese locale ("campaigns show as horizontal bars in 全天 row"), so the
lowercase fallback was never seen rendering. That is the oversight shape, not
the objectui#7443 shape.
The ternary landed in that same commit alongside the table entry, and it is the
only bare-key guard among the seven
t('calendar.call sites in thefile — one label guarded, six not. That asymmetry is what makes it a leftover
rather than a policy.
Tests
New:
packages/plugin-calendar/src/CalendarView.allDaySpelling-7454.test.tsx,three cases — provider-less, provider-mounted, and the two compared directly.
It discriminates on the fact, never on the assertion: the expected value is
read from the pack itself (
en.calendar.allDay), so a literal spelling neverappears in the assertion. The lane header is located by structure (first
child of the event bar's grandparent, with both structural assumptions asserted)
rather than by searching for the expected text, which would have passed by
construction.
The provider-less case guards its own precondition with
expect(getI18n()).toBeUndefined().createI18ninstalls a module-level i18next global viainitReactI18next, sowithout that guard a reordering that let the provider case run first would leave
the "provider-less" render quietly reading the pack and passing for the wrong
reason.
Discrimination, measured twice. On the pristine base before any edit, the
provider-less case rendered
all-dayand the provider case renderedAll Day— the card's exact split, with react-i18next's
NO_I18NEXT_INSTANCEnotice onstderr confirming the fallback arm really was the one under test. Then, as a
formal ablation on the committed tree:
The mutation edited the table entry in
CalendarView.tsx; the assertion was nottouched. Both legs ran under
trap ... EXIT INT TERMwith absolute paths,restoring via
git checkout HEAD -- ABSOLUTE_PATH; the restore is proven bystate (worktree blob equal to the HEAD blob and an empty
git diff HEAD),not by an exit code. Note the mutated run leaves the provider case green —
that one-of-three split is the defect itself, reproduced on demand.
Gate results, all at
e9566e8d6Run from the repo root (the package-scoped vitest form is refused here as a
known false-green), exit codes captured by redirect-then-read, never through a
pipe.
vitest run packages/plugin-calendar/Test Files 23 passed (23)·Tests 134 passed (134)turbo run type-check --filter=@object-ui/plugin-calendarTasks: 15 successful, 15 totalpnpm check:i18n-keyspnpm check:i18n-driftpnpm check:control-bytespnpm check:phantom-depspnpm check:vi-mock-specifiers/check:vi-mock-inheritpnpm changeset:checkmajorbump."The package's
type-checkistsc --noEmit && tsc -p tsconfig.test.json, andthat second config's
includenamessrc/**/*.test.tsx— so the new test fileis genuinely type-checked, not merely adjacent to a green typecheck.
check:i18n-keysis not evidence for this change, and is reported as such.It is green before the fix, after the fix, and in the ablation's mutated
state (
MUTATED_I18N_GATE_EXIT=0, full verdict line printed). Its own censusputs this entry under "1114 module-local table", which it never value-compares —
that blindness is precisely objectui#7567.
Narrowings, declared
turbo run lintacross the repo. What the full run could have caught that a subset cannot is a
verdict moving on a file this diff did not touch — and it cannot here: the
root
eslint.config.jsenables no type-aware linting (noprojectService,no
project:, noparserOptions, norecommendedTypeChecked), so eachfile's verdict is a function of its own bytes plus the shared config, and this
diff changes no config file. File count read from eslint's own
--format jsonoutput: 2 files, 0 errors. The 24 warnings on
CalendarView.tsxarepre-existing and sit on lines 123-1445, none on 84 or 1271.
packages/plugin-calendar/rather than the whole suite. CI runs thefull farm regardless; this narrowing covers the only package whose bytes moved.
check:*script. Derived from thisdiff's actual paths (a plugin source file, a new test file, a changeset), not
copied from the dispatch. CI runs the rest.
Filed, not fixed here
#7572—createI18n'sresourcesmerge is one level deep, so a calleroverriding part of an existing group replaces the whole group and drops its
sibling keys. That is the single construction under which a provider-mounted
host could still see a bare
calendar.allDay, and it is why the ternary'sdeletion is safe rather than merely tidy: in that scenario the file's other six
calendar.*labels already render raw keys, so a guard on one of them was nevera defence. Fixing it belongs in
packages/i18n, out of this fence.Generated by Claude Code