Skip to content

fix(core): PowerSearch gives isDateOnly: false the time of day it names - #9702

Merged
imdreamrunner merged 1 commit into
mainfrom
fix/powersearch-is-date-only-time
Nov 4, 2026
Merged

imdreamrunner merged 1 commit into
mainfrom
fix/powersearch-is-date-only-time

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

fix(core): PowerSearch gives isDateOnly: false the time of day it names

Follows the date-only fix (merged), which it needs for the shared zone module and the timezoneID threading: the record adds FR26 and DEC-6 beside that change's FR25 and DEC-5, and the isDateOnly: false gap notes on the sheet rows, the value step and the known gap come off. Both presentations: the sheet's value step reuses the popover's value editor, so it edits the time too. The release category follows the owner's ruling: [fix]. The two date-time conversions live in Core's powerSearchDateZone.ts beside the date-only ones, and read wall-clock fields through getWallClock, moved from Timestamp/formatInstant.ts to utils/plainDate.ts beside getTimeZoneParts so both callers share it; the Lab copies of these conversions were removed with the Lab component, so none exist on main.

User impact

Anyone whose PowerSearch config declares a date_absolute operator with isDateOnly: false — documented as "If true, only show date picker without time", so false asks for a time. The released editor was the same date picker for every date_absolute, stored UTC midnight of the picked day, and the token showed a day alone: the option changed nothing, and a filter meant to carry a time could not. Now the popover shows a time field beside the date picker, the token shows the date and time, and both read and write the instant in timezoneID when set, else the viewer's zone, so the time typed is the time shown.

Problem and solution fit

Why does it occur? isDateOnly is declared on DateAbsoluteOperatorValue (types.ts) and read by nothing in Core: DateAbsoluteEditor always rendered DateInput, and the token always formatted the day. timezoneID never reached the popover.

Why does it harm the task? A config that asks for a time cannot get one; a filter on an instant collapses to a day.

Why does that harm matter? The option is public and documented; a consumer who sets it gets no error and no effect. The record carried it as an open question, which the owner has now decided (DEC-6).

Fix: DateAbsoluteEditor renders a DateInput beside a TimeInput when operatorValue.isDateOnly === false (DateTimeInput carries the gesture core: a static import would put 74 KB of gesture modules into every PowerSearch bundle and fail the touch-bundle check, and a lazy import both inlines into the measured bundle and breaks the no-barrel rule for lazily loaded graphs, so the popover composes the two inputs PowerSearch already ships for date_absolute and time); on a line of its own in the editor row, since the two-input control otherwise shrinks the field selector beside it to nothing — converting the stored instant to wall-clock time in the zone and back through a small module built on the existing plainDate helpers (powerSearchDateZone.ts); the token formats such a value with its time through the existing formatDateAbsolute in the same zone; PowerSearch.tsx passes timezoneID to the popover, the components Editor override and (via PowerSearchFilterEditor) the exported editor; the value editor and the nested editor's sub-filter editors receive it.

Expected behavior and authority

  • component:PowerSearch DEC-6 and FR26 (this PR, decider imdreamrunner, 2026-11-02): isDateOnly: false is an instant with a time of day; token and editor show and edit it in timezoneID, else the viewer's zone; isDateOnly unset or true keeps the date picker. FR12 and FR17 name the same reading for the sheet's rows and value step; FR26 carries the sheet's implementation gap (FR10). The open question on isDateOnly: false is resolved into it.
  • OperatorValue.isDateOnly docs ("If true, only show date picker without time"); timezoneID docs ("for date formatting"). The record names component:DateInput and component:TimeInput as the controls, where the owner's brief named DateTimeInput: see the fix paragraph for why.
  • spec:AST-017: [fix] by the owner's ruling (FR5, a correction restoring the documented option); the compatibility bullet names what a caller observes change.

Smallest restoration

One branch in DateAbsoluteEditor (a DateInput and a TimeInput, both already in PowerSearch's import graph, so its bundle gains no gesture code), one branch in the token's date_absolute case, timezoneID threaded through the popover's existing prop chain, one new internal module (no package export), no new prop, no catalog key (the date-and-time control reuses the hidden "Date" label). The date-only path is untouched: the date picker, its UTC-day read and write, and the token's day are as on main (the separate date-zone fix changes those).

Evidence

  • Reproduction before the change (real PowerSearch, jsdom): an operator with isDateOnly: false and the instant 2024-03-10T03:00Z (March 9, 7 PM Pacific) with timezoneID="America/Los_Angeles" shows the token "Mar 10, 2024" under a Tokyo host, opens a date picker on "March 10, 2024" with no time field, and saving stores 2024-03-10T00:00Z.
  • Result after the change: token "Mar 9, 2024, 7:00 PM"; date "March 9, 2024" and time "7:00 PM"; typing 8:30 PM stores 2024-03-10T04:30Z; with timezoneID="Asia/Tokyo" "Mar 10, 2024, 12:00 PM" under every host zone; with timezoneID unset under a Tokyo host, 12:00 PM, and typing 1:15 PM stores 04:15Z; an empty timezoneID reads as unset; a components Editor override receives timezoneID; PowerSearchFilterEditor opens on March 9 / 7:00 PM in Los Angeles.
  • Representative unchanged path: an operator with isDateOnly: true keeps the date picker and a token with no time (tested); the PowerSearch, edit-popover, value-editor and formatter suites pass unchanged.
  • Regression test or other mutation-sensitive proof: PowerSearchDateTime.test.tsx, 11 cases; 10 fail on main (the date-only control case passes there by design), the layout case failing without the full-width value cell.

Writing rubric results

  • R1 narration: the compatibility bullet names what a caller observes change, not how the editor used to be built; DEC-6 states the rule and its rejections.
  • R2 research in the record: none; the reproduction lives here.
  • R3 evidence naming a change: none; the verification row names the test file and its failure signal.
  • R4 rejected alternatives over one line or outside a decision: three in DEC-6, each one line.
  • R5 pull request or issue references remaining: none (searched # + digits, /pull/, /issues/).
  • R6 ruled open questions still listing options: the isDateOnly: false question is ruled and removed.

Scope

  • One defect is restored (an option read nowhere).
  • Separable contradictory or unsettled tagalongs were removed or split: none remain; the date-only fix landed first as its own pull request.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label: DateTimeInput for isDateOnly: false is the documented option's meaning.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run packages/core/src/PowerSearch packages/core/src/Table/plugins/filtering packages/core/src/i18n packages/lab/src/MobilePowerSearch — all pass; PowerSearchDateTime.test.tsx 11/11 here, 10 failing on main.
  • pnpm -F @astryxdesign/core typecheck, typecheck:docs — clean.
  • ASTRYX_STRICT_LINT=1 eslint on packages/core/src/PowerSearch/ — 0 findings.
  • pnpm check:repo (includes check:knowledge, check:changesets) — clean; prettier and git diff --check clean.

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 4, 2026 2:36am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 4, 2026, 2:40 AM UTC

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 35240a4

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c419653

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
PowerSearch · Storybook 236.6 kB (+469 B) · 21.7 kB CSS (+13 B) 7,029 (+117) ✓ · ✓ · ✓
lab/CommentThread 254.3 kB (+10 B) · 2.4 kB CSS (0) — — · — · —
Calendar 54.8 kB (0) · 10.4 kB CSS (0) — — · — · —
6 more components
Component Size LoC Visual · A11y · RTL
DateInput 147.9 kB (0) · 15.4 kB CSS (0) — — · — · —
DateRangeInput 72.2 kB (0) · 11.9 kB CSS (0) — — · — · —
DateTimeInput 168.6 kB (0) · 17.1 kB CSS (0) — — · — · —
Timestamp · Storybook 21.3 kB (0) · 10.0 kB CSS (0) 666 (−20) ✓ · ✓ · —
lab/Schedule 62.0 kB (0) · 3.9 kB CSS (0) — — · — · —
lab/Comments 259.4 kB (−18 B) · 2.5 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 6.30 MB packed (+2.3 kB); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: core 1 row; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.

Current run: CI concluded failure; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 35240a4

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isDateOnly: false editor and token work as described, and the new tests fail on the base and pass here. Merging waits on an engineering owner's ruling on the release category, and three changes are needed:

  • powerSearchDateZone.ts repeats the instant/wall-clock conversions that Lab's mobilePowerSearchUtils.ts already ships, and the two copies already disagree on an empty timezoneID, so route Lab through the one Core module or say in the pull request why they must stay apart.
  • FR24 says both presentations show and edit the time, but FR12 and FR17 still say a date_absolute value reads as a day and is stored as UTC midnight, and FR24 sits in the popover-only list without an implementation-gap note, so align the record.
  • In a 608 px field the date-and-time control squeezes the field selector to a 6 px sliver showing "A" (and to no label at all at 400 px), so give the value its own line or keep a minimum width on the field selector.

On the release category: an engineering owner needs to rule on the pull request whether saving a time, where the released editor saved UTC midnight, is a [fix] (AST-017 FR5) or a [breaking] correction with a released victim (FR32). If it is breaking, the changeset needs a migration, and the change cannot merge while main declares a patch release.

[Automated review]


const pad = (n: number, width = 2) => String(n).padStart(width, '0');

export function unixSecondsToISODateTime(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two conversions already exist, with the same names, in packages/lab/src/MobilePowerSearch/mobilePowerSearchUtils.ts (lines 537–578) for the same isDateOnly: false editor, and the copies already differ: Lab passes an empty timezoneID to Intl.DateTimeFormat, which throws, where this module reads it as the viewer's zone. Please make this module the one owner and have Lab call it, or say in the pull request why they must stay separate.

| FR20 | Every string the sheets introduce comes from the `@astryx.powersearch.*` catalog, reusing the existing editor keys where their meaning fits (Cancel, Apply, Operator, Value, Values, Entities, the placeholders, the result count). Content the popover presentation already renders keeps its source — field, operator, and value text from the config and its formatters — except that every label the sheets render for a generated choice comes from the catalog as one ICU message with a plural: the relative-date choice rows (`@astryx.powersearch.sheet.relative{Days,Weeks,Months}{Ago,FromNow}`, the same choices and, in English, the same words as the popover's editor lists) and the value summaries of FR12. | DEC-3; catalog contract | Current contract. Implementation gap: no sheet strings exist. |
| FR21 | A `string_list` or `entity_list` value inside the value step opens the Tokenizer's sheet above the value step. Escape and swipe dismiss only that topmost sheet; closing it returns focus to its trigger inside the value step; the value step keeps its staged state. | DEC-3; `family:overlay-dismissal`; `component:Tokenizer/FR18` | Current contract. Implementation gap: no nested sheet exists. |
| FR22 | In the `popover` presentation, a read-only field (`isReadOnly`) MUST NOT remove a filter: it shows no Clear all, no token has a remove control, and Backspace on an empty input removes nothing. | The `isReadOnly` prop docs: "Prevent adding, editing, or removing filters." | Current contract |
| FR24 | A `date_absolute` value whose operator has `isDateOnly: false` is an instant with a time of day. In both presentations its token shows its date and time, and its editor is a date-and-time control that reads the stored instant's wall-clock time and stores the wall-clock time entered as the instant it names, both in `timezoneID` when the prop is set, else the viewer's zone — the zone the viewer reads a clock in — so the time typed is the time shown. A `components[type].Editor` override and `PowerSearchFilterEditor` receive `timezoneID` in their props so they can read the same time. A `date_absolute` whose operator has `isDateOnly` unset or `true` keeps its date-only picker and shows no time. | DEC-5; `OperatorValue.isDateOnly` contract; `component:DateTimeInput` | Current contract. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR24 says both presentations show and edit the time, but FR12 (line 216) still says a date_absolute value "reads as a day with no time", and FR17 (line 221) still says "a picked day as its UTC midnight, a stored instant as its UTC day". Line 198 lists FR24 among the popover-only requirements, and this row has no implementation-gap note although FR10 records that Core has no sheet presentation. The FR24 verification row (line 490) is also missing its audit-section cell.

? filterValue.unixSeconds
: undefined;
return (
<DateTimeInput

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a 608 px PowerSearch this two-input control leaves the field selector 6 px wide, its label clipped to "A" (on the base it is 60 px). At 400 px the field selector shows no label at all. The editor row wraps only below 400 px (PowerSearchEditPopover.tsx:49), and the field selector is the cell that shrinks to zero (:66-70). Giving the date-and-time value its own line, or keeping a minimum width on the field selector, would keep the field readable.

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from 35240a4 to c36b3cf Compare November 3, 2026 05:25
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec c36b3cf

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The isDateOnly: false editor, token and record now line up, and the field-selector squeeze and the FR12/FR17 wording raised earlier are fixed. One change remains:

  • powerSearchDateZone.ts adds unixSecondsToISODateTime and isoDateTimeToUnixSeconds, which Lab's mobilePowerSearchUtils.ts already ships for the same editor, and the two copies already disagree on an empty timezoneID (Core reads it as unset, Lab throws), so rebase onto the date-zone pull request (#9655) once it lands and use its module, or have Lab call Core's module here and delete its copies.

Optional: the record's known gap comparing the token with formatFilterValue still says the token shows a date only, and the compatibility bullet could say it ships as [fix].

[Automated review]


const pad = (n: number, width = 2) => String(n).padStart(width, '0');

export function unixSecondsToISODateTime(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two conversions already exist, under the same names, in packages/lab/src/MobilePowerSearch/mobilePowerSearchUtils.ts (lines 537–578) for the same isDateOnly: false editor, and the copies differ: Lab passes an empty timezoneID to Intl.DateTimeFormat, which throws, where this module reads it as the viewer's zone. Please rebase onto the date-zone pull request once it lands and use its module, or have Lab import these two from here and delete its copies.

Comment on lines +62 to +64
// A date-and-time control is two inputs wide: on one line with the field
// and operator selectors it shrinks the field selector to nothing, so the
// row wraps and the control takes a line of its own.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (INV29): this is one 36-word sentence with three topics. Suggested:

// A date-and-time control is two inputs wide. Beside the selectors it
// shrinks the field selector to nothing. The row wraps, so the control gets
// its own line.

Comment on lines +315 to +316
// A value with a time of day shows it, in the zone its editor uses; a
// calendar day shows the day alone.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (INV29): this restates the ternary below. Keep only the invariant:

// The token reads the time in the editor's zone.

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from c36b3cf to ac6d529 Compare November 3, 2026 06:22
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec ac6d529

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The isDateOnly: false editor, token and record line up, and the record wording raised earlier is fixed; two changes remain:

  • Since this branch was cut, main made DateTimeInput a gesture user, so the static import at PowerSearchValueEditor.tsx:42 now puts 16 gesture modules (74,624 B minified) into every PowerSearch import and fails scripts/touch-support-bundle.test.mjs ("is in no public import that uses no gesture", the test-node (2/4) check); rebase onto main and either list PowerSearch as a gesture user with its reason, as main did for DateTimeInput, or keep the date-and-time editor off PowerSearch's static import path.
  • powerSearchDateZone.ts adds unixSecondsToISODateTime and isoDateTimeToUnixSeconds, which Lab's mobilePowerSearchUtils.ts already ships for the same editor, and the two copies already disagree on an empty timezoneID (Core reads it as unset, Lab throws), so rebase onto the date-zone pull request (#9655) once it lands and use its module, or route Lab through Core's module here and delete its copies.

Optional: two new comments could be shorter (PowerSearchEditPopover.tsx:62-64, PowerSearch.tsx:315-316).

[Automated review]

type NumberInputCommitDecision,
} from '../NumberInput/numberInputCommit';
import {DateInput} from '../DateInput';
import {DateTimeInput} from '../DateTimeInput/DateTimeInput';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On current main, DateTimeInput renders a touch field with a dragging SegmentedControl, so this static import puts 16 gesture modules (74,624 B minified) into every PowerSearch import, whether or not an app sets isDateOnly: false. scripts/touch-support-bundle.test.mjs fails on it ("is in no public import that uses no gesture", via PowerSearchEditPopover → PowerSearchValueEditor → DateTimeInput → TouchDateTimeField → SegmentedControl). After a rebase onto main, either list PowerSearch in that test's GESTURE_USERS with its reason, as main did for DateTimeInput, or keep the date-and-time editor off PowerSearch's static import path.

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from ac6d529 to 7649155 Compare November 3, 2026 06:54
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 7649155

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The isDateOnly: false editor, token and record line up with the approved FR24 and DEC-5, and the new tests fail on the base and pass here; three changes remain:

  • The lazy import of the date-and-time editor (PowerSearchValueEditor.tsx:49-53) still fails scripts/touch-support-bundle.test.mjs (PowerSearch's import carries 17 gesture modules, 75,352 B, in the size report's build) and now also fails scripts/core-single-bundle.test.mjs (60 barrel imports inside a lazily imported graph), so import DateTimeInput statically and list PowerSearch in GESTURE_USERS with its reason, or keep DateTimeInput out of everything PowerSearch's import reaches.
  • On the first open per page load the lazy editor is still loading when ValueEditorCell hands focus to the value field (PowerSearchEditPopover.tsx:655-667), so focus ends on body instead of the date field (a second open and the date-only editor are fine); the static import removes this, and a lazy design needs a preload that renders the editor directly once loaded, plus a first-open focus test.
  • powerSearchDateZone.ts adds unixSecondsToISODateTime and isoDateTimeToUnixSeconds, which Lab's mobilePowerSearchUtils.ts already ships for the same editor and which already disagree on an empty timezoneID (Core reads it as unset, Lab throws), so route Lab through Core's module here and delete its copies, or rebase onto the date-zone pull request (#9655) once it lands and use its module.

Optional: three new comments could be shorter (PowerSearchEditPopover.tsx:62-64, PowerSearch.tsx:315-316, PowerSearchValueEditor.tsx:449-450).

[Automated review]


// DateTimeInput carries the gesture core, so the date-and-time editor loads
// on demand: only a field with an `isDateOnly: false` operator pays for it.
const LazyDateTimeEditor = lazy(async () =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size report's build (esbuild, no code splitting) inlines this import(), so PowerSearch's import still carries 17 gesture modules (75,352 B) through DateTimeInput, and scripts/touch-support-bundle.test.mjs ("is in no public import that uses no gesture") fails. It also makes DateTimeInput's graph a lazily imported one, where scripts/core-single-bundle.test.mjs finds 60 barrel imports (DateTimeInput.tsx -> ../Field, ../Icon …). Importing DateTimeInput statically and listing PowerSearch in GESTURE_USERS with its reason, as main did for DateTimeInput, clears both; the other way is to keep DateTimeInput out of everything PowerSearch's import reaches.

// The value is an instant: its wall-clock time in `timezoneID`, else the
// viewer's zone, read and written as one.
return (
<Suspense fallback={null}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the first open per page load this boundary shows its null fallback, so ValueEditorCell's focus handoff (PowerSearchEditPopover.tsx:655-667) runs against an empty cell and focus ends on body. In Chromium a second open, and the date-only editor, focus the date field. A static import removes this; a lazy design needs the module loaded before the popover opens and rendered directly once loaded (as DropdownMenu/lazyMenuBottomSheet.ts does), and a first-open focus test.


const pad = (n: number, width = 2) => String(n).padStart(width, '0');

export function unixSecondsToISODateTime(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two conversions already exist, under the same names, in packages/lab/src/MobilePowerSearch/mobilePowerSearchUtils.ts (lines 537–578) for the same isDateOnly: false editor, and the copies differ: Lab passes an empty timezoneID to Intl.DateTimeFormat, which throws, where this module reads it as the viewer's zone. Please have Lab call this module (through a Core/Lab internal entry) and delete its copies here, or rebase onto the date-zone pull request once it lands and use its module.

Comment on lines +62 to +64
// A date-and-time control is two inputs wide: on one line with the field
// and operator selectors it shrinks the field selector to nothing, so the
// row wraps and the control takes a line of its own.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (INV29): one 38-word sentence with three topics. Suggested:

// A date-and-time control is two inputs wide. Beside the selectors it
// shrinks the field selector to nothing. The row wraps, so the control gets
// its own line.

Comment on lines +315 to +316
// A value with a time of day shows it, in the zone its editor uses; a
// calendar day shows the day alone.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (INV29): this restates the ternary below. Keep only the invariant:

// The token reads the time in the editor's zone.

Comment on lines +449 to +450
// The value is an instant: its wall-clock time in `timezoneID`, else the
// viewer's zone, read and written as one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (INV29): this restates the zone prop below it; it can go.

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from 7649155 to eeec2b6 Compare November 3, 2026 08:00
@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from 1873560 to ee5eab5 Compare November 3, 2026 23:53
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec ee5eab5

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from ee5eab5 to dda9cd8 Compare November 4, 2026 00:04
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec dda9cd8

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The isDateOnly: false editor and token now work as FR26 describes in both presentations, and the earlier release-note contradiction is fixed. Two things still need fixing:

  • The rebase dropped the record edits that go with FR26. FR25 (spec line 272) still says the popover keeps its released reading and points to a deleted open question. The FR11, FR12 and FR17 status notes still say the sheet reads a day and edits only a date. The FR25 verification row (line 541) still lists the test this pull request rewrote. Please restore those edits and record a fresh /approve-spec.
  • The exported PowerSearchToken (PowerSearchToken.tsx:63-75) still formats an isDateOnly: false value in the viewer's zone instead of timezoneID, so a Token override built on it shows a different time from the editor. For a Tokyo viewer with timezoneID="America/Los_Angeles", the token reads Mar 10, 12:00 PM while the editor opens on March 9, 7:00 PM. Please pass timezoneID for every value and add a test.

[Automated review]

@@ -259,6 +270,7 @@ FR10–FR21 govern. FR25 governs a date-only value in both.
| FR23 | In the `popover` presentation, Clear all MUST remove every editable filter and keep every read-only filter: it commits `onChange(<the read-only filters>, 'remove', <index of the first removed filter>)` and announces "Editable filters removed" while a read-only filter remains, otherwise "All filters removed". The clear control MUST render only while `hasClear` is set, the field is neither read-only nor disabled, and at least one editable filter exists. Backspace on an empty input MUST NOT remove a read-only filter; its token has no remove control. | DEC-4; a read-only filter's token has no remove control (current source) | Current contract |
| FR24 | In the popover presentation, a built-in filter token (no `components` Token override) that opens its editor is named by its visible text (field, operator and value); `aria-haspopup="dialog"`, `aria-expanded` is true while its editor is open, and the editor is a dialog named by the token's visible text. Its remove button is named by the remove word and the same visible text. | `spec:AST-020` FR1; WCAG 2.5.3 and 4.1.2; `component:Token/FR10` | Current contract. |
| FR25 | In both presentations a `date_absolute` value whose operator has `isDateOnly` unset or `true`, and each `ABSOLUTE` part of a `date_range` value, is a calendar day: the day its `unixSeconds` falls on in `timezoneID` when the prop is set, else the UTC day. The built-in token's text, the filter's accessible label and every announcement that names the value, the Filters row of the sheet presentation, and the date editor of either presentation all read that one day, with no time of day, so one value is never two days in one field; a `components[type].Token` override formats its own value (FR11) and receives `timezoneID` in its props, as the exported `PowerSearchToken` (the default token) does and reads, and a `components[type].Editor` override and `PowerSearchFilterEditor` receive `timezoneID` in their props so they can read the same day. A day picked in an editor is stored as that day's midnight in the same zone — `timezoneID`'s midnight, else UTC midnight — and the editor reopens on the day it stored, so an edit that keeps the day keeps the instant. Nothing about a value is rewritten by rendering or reopening: a value stored before `timezoneID` was given reads as its day in the zone now given. A `date_range` whose part is `NOW` or `RELATIVE` reads that part resolved to an instant first, then as its day. A value whose operator sets `isDateOnly: false` is outside this row: in the popover presentation its token, label and editor keep their released reading (the known gap in Open questions); the sheet presentation's rule for it is FR11, FR12 and FR17's. | DEC-5; `timezoneID` prop contract; `component:DateInput` (a calendar-day control) | Current contract. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR25 still says an isDateOnly: false value keeps its released reading in the popover (token, label and editor), and it points to an Open-questions gap that this pull request deletes. FR26 and the code now say otherwise. Restore the earlier wording: "A value whose operator sets isDateOnly: false is an instant, not a calendar day: FR26 governs it." The FR11 (line 257), FR12 (line 258) and FR17 (line 264) status notes need the same fix: the sheet's token and rows now show the time, and its value step stores it.

@@ -527,6 +539,7 @@ mark implementation and focused real-Chromium verification as pending.
| FR23 | PowerSearch and Tokenizer unit tests | Clear all with a read-only filter before two editable ones; every filter read-only; Backspace with a read-only last filter; the words with and without a read-only filter left | A read-only filter is removed, Clear all reports an index other than the first removed one, Clear all shows with no editable filter, or its words say every filter went while one remains. | `audit:PowerSearch/interaction` |
| FR24 | `PowerSearchTokenNaming.test.tsx`; real-Chromium accessibility tree of a popover token | Popover token with a value, read-only token, editor open and closed, a verb-last remove word | A token named without its value, a missing or stale `aria-expanded`, an unnamed or non-dialog editor, or a remove name that loses its locale's word order fails. | `audit:PowerSearch/accessibility` |
| FR25 | PowerSearch date-zone tests under four host zones (UTC, Los Angeles, Tokyo, Honolulu) with `timezoneID` set to each zone and unset: token text, the removal announcement that carries the accessible label, the editor's opening day, the stored instant after a pick, a round trip that moves the day and back, a `components` Editor override and `PowerSearchFilterEditor` receiving the zone, range parts read and written, and an `isDateOnly: false` value kept on its released reading; plus the formatter's unit tests | a Los Angeles evening instant with `timezoneID` set and unset, a pick across the US daylight-time change, a `date_range` of two instants | The token and the editor show different days for one value, a re-picked day moves the instant, or a day shows a time | `audit:PowerSearch/interaction` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This row still lists "an isDateOnly: false value kept on its released reading". PowerSearchDateZone.test.tsx now checks that such a value is an instant, so the row should say "an isDateOnly: false value left to FR26".

Comment thread packages/core/src/utils/plainDate.ts Outdated
date: Date,
timeZone: string | null | undefined,
): WallClock {
// `undefined`, `null` and "" all name the viewer's zone.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (INV29): this repeats the JSDoc directly above it (undefined, null or ""). It can go.

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from dda9cd8 to d1a18b3 Compare November 4, 2026 00:27
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec d1a18b3

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: one documentation fix remains. The isDateOnly: false editor, token and stored instant now match FR26 and DEC-6 in both presentations, and the record and token issues raised earlier are fixed.

  • The timezoneID prop's JSDoc (PowerSearch.tsx:384-390) and its docs entries (PowerSearch.doc.mjs:145 and :453) still say an isDateOnly: false value only formats its label in that zone, but the token and editor now show and edit its date and time there, and use the viewer's zone when the prop is unset.

Replacing that sentence in the three places clears it, for example with "A date_absolute with isDateOnly: false shows and edits its date and time in it; unset, in the viewer's zone." A new commit needs a fresh /approve-spec for the record changes.

[Automated review]

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from d1a18b3 to f4c2e76 Compare November 4, 2026 00:49
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec f4c2e76

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from f4c2e76 to 95f36df Compare November 4, 2026 00:51
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 95f36df

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: one layout fix remains. The isDateOnly: false editor, token and stored instant match FR26 and DEC-6 in both presentations, and the timezoneID docs now say where such a value shows and edits.

  • In a nested group's sub-filter row the time field overlaps the last 56 px of the date field, because the row's selectors keep 200 and 180 px, leaving a 240 px value cell, and the date-and-time pair at PowerSearchValueEditor.tsx:562 never wraps its 180 px date field and 120 px time field.

Letting the pair wrap (wrap="wrap" on that HStack), or giving a nested row the full-width value line the top-level row already gets, clears it, and a nested case in the layout test would keep it fixed. A new commit needs a fresh /approve-spec for the record changes.

[Automated review]

};
const width = presentation === 'bottom-sheet' ? '100%' : undefined;
return (
<HStack gap={2}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a nested group's sub-filter row this pair overlaps. The row's selectors keep 200 and 180 px, so at the popover's 720 px cap the value cell is 240 px. The date field (min 180 px) then spans 476–656 px and the time field (min 120 px) spans 600–720 px. The time field covers the last 56 px of the date field and runs past the cell.

Letting the pair wrap drops the time field under the date field when the cell is narrower than both:

<HStack gap={2} wrap="wrap">

Or give a nested row the full-width value line the top-level row gets. A nested case in the layout test would keep it fixed.

import {SHARED_DATE_FORMAT_OPTIONS, getTimeZoneParts} from '../utils/plainDate';
import {
SHARED_DATE_FORMAT_OPTIONS,
getTimeZoneParts,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: getTimeZoneParts is unused here now that getWallClock moved to utils/plainDate.ts (ESLint @typescript-eslint/no-unused-vars). It can go.

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from 95f36df to 33fe953 Compare November 4, 2026 01:25
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 33fe953

@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from 33fe953 to c419653 Compare November 4, 2026 01:27
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec c419653

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended for approval: the isDateOnly: false editor, token and stored instant match the approved FR26 and DEC-6 in both presentations, last round's nested-row wrap and unused-import fixes are in, and the new tests fail on main and pass here. A new commit would need a fresh /approve-spec for the record changes.

  • The red test-ui (4/4) and test-node (4/4) jobs fail on two tests that exist only on main (a Tokenizer sheet case and a CLI resolution snapshot), not on anything this change touches.
  • Optional: the isDateOnly JSDoc in types.ts reads better as short active sentences (see the inline note).

[Automated review]

Comment on lines +66 to +68
* False: the value is an instant with a time of day, edited with a date
* picker and a time field and shown with its time in `timezoneID`, else
* the viewer's zone.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this JSDoc sentence packs three topics into 31 words, partly passive. A shorter form that keeps the same meaning:

   * False: the value is an instant with a time of day. A date picker and a
   * time field edit it. It shows its time in `timezoneID`, else in the
   * viewer's zone.

isDateOnly was declared on the date_absolute operator value and read nowhere:
every date_absolute edited in the date picker, stored UTC midnight of the
picked day, and showed a day on its token, so the option changed nothing.

An operator with isDateOnly: false now edits in a date picker beside a time field and
its token shows the date and the time, both reading and writing the instant in
timezoneID when set, else the viewer's zone. isDateOnly unset or true keeps
the date picker. The record gains DEC-6 and FR25, resolving its open question.
@imdreamrunner
imdreamrunner force-pushed the fix/powersearch-is-date-only-time branch from c419653 to 506381b Compare November 4, 2026 02:27
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 506381b

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended for approval: the isDateOnly: false editor, token and stored instant match the approved FR26 and DEC-6 in both presentations, last round's nested-row wrap and unused-import fixes are in, and the new tests fail on main and pass with this change. A new commit would need a fresh /approve-spec for the record changes.

  • Optional: the isDateOnly JSDoc in types.ts (lines 66-68) reads better as short active sentences, for example "False: the value is an instant with a time of day. A date picker and a time field edit it. It shows its time in timezoneID, else in the viewer's zone."

[Automated review]

@imdreamrunner
imdreamrunner merged commit c8f08f9 into main Nov 4, 2026
60 checks passed
@github-actions
github-actions Bot deleted the fix/powersearch-is-date-only-time branch November 4, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 506381b5 Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant