You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
finding(core): formatRelativeDate still ignores options.style, and its out-of-window ABSOLUTE fallback is the one place the key is already well-defined #7816
Reported by the #7745 dev seat as its first open question, and filed here by the PM seat so it survives that card's Fixes close. ⛔ Deliberately not done inside #7745: the maintainer ruling there names formatDate only.
formatDate now reads options.style (style ?? options?.style, positional wins). formatRelativeDate reads nothing — and it is not genuinely style-less, because it delegates to formatDate outside its ±7-day window. So today an out-of-window date renders the default absolute face no matter what the shared options bag says.
⚠️ That delegation is currently guarded on purpose: #7745 added a module-local, non-exported absoluteFallbackOptions that strips style before the out-of-window call. That guard is behaviour-preserving, not a feature — it exists because the new read would otherwise have changed formatRelativeDate's output as a side effect of a card that was not about it.
no read at all — keep formatRelativeDate style-less, as today
nothing changes; the shared bag stays half-honoured
B ⬅ recommended
read it only for the out-of-window ABSOLUTE fallback: formatRelativeDate(v, { style: 'short' }) on a two-year-old date renders Jul 4, '24 instead of Jul 4, 2024
well-defined today, zero new vocabulary
C
read it for the relative phrase itself
⛔ requires minting a relative-style vocabulary that does not exist — the key would be accepted with nothing to name
⭐ The measurement is already done — this card starts with its own before/after
#7745's ablation leg C dropped the strip and is therefore exactly the measurement of what flipping this costs. It turned three cases red (one more than predicted, reported as observed):
AssertionError: expected 'Jul 4, '24' to be 'Jul 4, 2024' ← the leak into formatRelativeDate
RangeError: Maximum call stack size exceeded ← { style: 'relative' } recurses
⛔ It is not a one-line change in consequence: { style: 'relative' } handed to formatRelativeDaterecurses to stack exhaustion through the delegation. Any implementation of B must answer that input explicitly. The trap is already measured; do not rediscover it in production.
What makes this a real decision and not a freebie
It makes the ±7-day boundary a visible face boundary: In 2 days inside the window, Jul 4, '24 outside — two different faces from one call, selected by the date rather than by the author.
It changes live grid / gantt output for any caller already threading one shared options bag through both functions.
⇒ Which is precisely why #7745 refused to do it unasked, and why this is a card.
Related: objectui#7745 (the ruling and the formatDate read) · PR objectui#7813 · objectui#4272 (the silent-override incident the module header records)
Reported by the
#7745dev seat as its first open question, and filed here by the PM seat so it survives that card'sFixesclose. ⛔ Deliberately not done inside #7745: the maintainer ruling there namesformatDateonly.The state after objectui#7745 (PR #7813)
formatDatenow readsoptions.style(style ?? options?.style, positional wins).formatRelativeDatereads nothing — and it is not genuinely style-less, because it delegates toformatDateoutside its ±7-day window. So today an out-of-window date renders the default absolute face no matter what the shared options bag says.absoluteFallbackOptionsthat stripsstylebefore the out-of-window call. That guard is behaviour-preserving, not a feature — it exists because the new read would otherwise have changedformatRelativeDate's output as a side effect of a card that was not about it.The three options, as the #7745 seat framed them
formatRelativeDatestyle-less, as todayformatRelativeDate(v, { style: 'short' })on a two-year-old date rendersJul 4, '24instead ofJul 4, 2024⭐ The measurement is already done — this card starts with its own before/after
#7745's ablation leg C dropped the strip and is therefore exactly the measurement of what flipping this costs. It turned three cases red (one more than predicted, reported as observed):
⇒ Two things this pins for whoever takes it:
absoluteFallbackOptionsstrip that finding(core):DateDisplayOptions.styleis read byformatDateTimealone — onformatDateit is inert AND collides with a positional parameter of the same name #7745 added.{ style: 'relative' }handed toformatRelativeDaterecurses to stack exhaustion through the delegation. Any implementation of B must answer that input explicitly. The trap is already measured; do not rediscover it in production.What makes this a real decision and not a freebie
In 2 daysinside the window,Jul 4, '24outside — two different faces from one call, selected by the date rather than by the author.⇒ Which is precisely why #7745 refused to do it unasked, and why this is a card.
Related: objectui#7745 (the ruling and the
formatDateread) · PR objectui#7813 · objectui#4272 (the silent-override incident the module header records)Generated by Claude Code