Repository navigation
fix(core): PowerSearch gives isDateOnly: false the time of day it names - #9702
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 35240a4 |
PR Analysis Report🔎 Preview ·
|
| 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
|
/approve-spec 35240a4 |
There was a problem hiding this comment.
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.tsrepeats the instant/wall-clock conversions that Lab'smobilePowerSearchUtils.tsalready ships, and the two copies already disagree on an emptytimezoneID, 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_absolutevalue 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( |
There was a problem hiding this comment.
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. | |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
35240a4 to
c36b3cf
Compare
|
/approve-spec c36b3cf |
There was a problem hiding this comment.
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.tsaddsunixSecondsToISODateTimeandisoDateTimeToUnixSeconds, which Lab'smobilePowerSearchUtils.tsalready ships for the same editor, and the two copies already disagree on an emptytimezoneID(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( |
There was a problem hiding this comment.
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.
| // 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. |
There was a problem hiding this comment.
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.| // A value with a time of day shows it, in the zone its editor uses; a | ||
| // calendar day shows the day alone. |
There was a problem hiding this comment.
Non-blocking (INV29): this restates the ternary below. Keep only the invariant:
// The token reads the time in the editor's zone.c36b3cf to
ac6d529
Compare
|
/approve-spec ac6d529 |
There was a problem hiding this comment.
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,
mainmadeDateTimeInputa gesture user, so the static import atPowerSearchValueEditor.tsx:42now puts 16 gesture modules (74,624 B minified) into every PowerSearch import and failsscripts/touch-support-bundle.test.mjs("is in no public import that uses no gesture", thetest-node (2/4)check); rebase ontomainand either list PowerSearch as a gesture user with its reason, asmaindid forDateTimeInput, or keep the date-and-time editor off PowerSearch's static import path. powerSearchDateZone.tsaddsunixSecondsToISODateTimeandisoDateTimeToUnixSeconds, which Lab'smobilePowerSearchUtils.tsalready ships for the same editor, and the two copies already disagree on an emptytimezoneID(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'; |
There was a problem hiding this comment.
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.
ac6d529 to
7649155
Compare
|
/approve-spec 7649155 |
There was a problem hiding this comment.
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 failsscripts/touch-support-bundle.test.mjs(PowerSearch's import carries 17 gesture modules, 75,352 B, in the size report's build) and now also failsscripts/core-single-bundle.test.mjs(60 barrel imports inside a lazily imported graph), so importDateTimeInputstatically and list PowerSearch inGESTURE_USERSwith its reason, or keepDateTimeInputout of everything PowerSearch's import reaches. - On the first open per page load the lazy editor is still loading when
ValueEditorCellhands focus to the value field (PowerSearchEditPopover.tsx:655-667), so focus ends onbodyinstead 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.tsaddsunixSecondsToISODateTimeandisoDateTimeToUnixSeconds, which Lab'smobilePowerSearchUtils.tsalready ships for the same editor and which already disagree on an emptytimezoneID(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 () => |
There was a problem hiding this comment.
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}> |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
| // 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. |
There was a problem hiding this comment.
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.| // A value with a time of day shows it, in the zone its editor uses; a | ||
| // calendar day shows the day alone. |
There was a problem hiding this comment.
Non-blocking (INV29): this restates the ternary below. Keep only the invariant:
// The token reads the time in the editor's zone.| // The value is an instant: its wall-clock time in `timezoneID`, else the | ||
| // viewer's zone, read and written as one. |
There was a problem hiding this comment.
Non-blocking (INV29): this restates the zone prop below it; it can go.
7649155 to
eeec2b6
Compare
1873560 to
ee5eab5
Compare
|
/approve-spec ee5eab5 |
ee5eab5 to
dda9cd8
Compare
|
/approve-spec dda9cd8 |
There was a problem hiding this comment.
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 anisDateOnly: falsevalue in the viewer's zone instead oftimezoneID, so a Token override built on it shows a different time from the editor. For a Tokyo viewer withtimezoneID="America/Los_Angeles", the token reads Mar 10, 12:00 PM while the editor opens on March 9, 7:00 PM. Please passtimezoneIDfor 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. | | |||
There was a problem hiding this comment.
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` | | |||
There was a problem hiding this comment.
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".
| date: Date, | ||
| timeZone: string | null | undefined, | ||
| ): WallClock { | ||
| // `undefined`, `null` and "" all name the viewer's zone. |
There was a problem hiding this comment.
Non-blocking (INV29): this repeats the JSDoc directly above it (undefined, null or ""). It can go.
dda9cd8 to
d1a18b3
Compare
|
/approve-spec d1a18b3 |
There was a problem hiding this comment.
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
timezoneIDprop's JSDoc (PowerSearch.tsx:384-390) and its docs entries (PowerSearch.doc.mjs:145and:453) still say anisDateOnly: falsevalue 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]
d1a18b3 to
f4c2e76
Compare
|
/approve-spec f4c2e76 |
f4c2e76 to
95f36df
Compare
|
/approve-spec 95f36df |
There was a problem hiding this comment.
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:562never 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}> |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Non-blocking: getTimeZoneParts is unused here now that getWallClock moved to utils/plainDate.ts (ESLint @typescript-eslint/no-unused-vars). It can go.
95f36df to
33fe953
Compare
|
/approve-spec 33fe953 |
33fe953 to
c419653
Compare
|
/approve-spec c419653 |
There was a problem hiding this comment.
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)andtest-node (4/4)jobs fail on two tests that exist only onmain(a Tokenizer sheet case and a CLI resolution snapshot), not on anything this change touches. - Optional: the
isDateOnlyJSDoc intypes.tsreads better as short active sentences (see the inline note).
[Automated review]
| * 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. |
There was a problem hiding this comment.
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.
c419653 to
506381b
Compare
|
/approve-spec 506381b |
There was a problem hiding this comment.
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
isDateOnlyJSDoc intypes.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 intimezoneID, else in the viewer's zone."
[Automated review]
fix(core): PowerSearch gives
isDateOnly: falsethe time of day it namesUser impact
Anyone whose PowerSearch config declares a
date_absoluteoperator withisDateOnly: false— documented as "If true, only show date picker without time", sofalseasks for a time. The released editor was the same date picker for everydate_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 intimezoneIDwhen set, else the viewer's zone, so the time typed is the time shown.Problem and solution fit
Why does it occur?
isDateOnlyis declared onDateAbsoluteOperatorValue(types.ts) and read by nothing in Core:DateAbsoluteEditoralways renderedDateInput, and the token always formatted the day.timezoneIDnever 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:
DateAbsoluteEditorrenders aDateInputbeside aTimeInputwhenoperatorValue.isDateOnly === false(DateTimeInputcarries 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 fordate_absoluteandtime); 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 existingplainDatehelpers (powerSearchDateZone.ts); the token formats such a value with its time through the existingformatDateAbsolutein the same zone;PowerSearch.tsxpassestimezoneIDto the popover, thecomponentsEditor override and (viaPowerSearchFilterEditor) the exported editor; the value editor and the nested editor's sub-filter editors receive it.Expected behavior and authority
component:PowerSearchDEC-6 and FR26 (this PR, decider imdreamrunner, 2026-11-02):isDateOnly: falseis an instant with a time of day; token and editor show and edit it intimezoneID, else the viewer's zone;isDateOnlyunset ortruekeeps 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 onisDateOnly: falseis resolved into it.OperatorValue.isDateOnlydocs ("If true, only show date picker without time");timezoneIDdocs ("for date formatting"). The record namescomponent:DateInputandcomponent:TimeInputas the controls, where the owner's brief namedDateTimeInput: 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(aDateInputand aTimeInput, both already in PowerSearch's import graph, so its bundle gains no gesture code), one branch in the token'sdate_absolutecase,timezoneIDthreaded 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 onmain(the separate date-zone fix changes those).Evidence
PowerSearch, jsdom): an operator withisDateOnly: falseand the instant 2024-03-10T03:00Z (March 9, 7 PM Pacific) withtimezoneID="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.timezoneID="Asia/Tokyo""Mar 10, 2024, 12:00 PM" under every host zone; withtimezoneIDunset under a Tokyo host, 12:00 PM, and typing 1:15 PM stores 04:15Z; an emptytimezoneIDreads as unset; acomponentsEditor override receivestimezoneID;PowerSearchFilterEditoropens on March 9 / 7:00 PM in Los Angeles.isDateOnly: truekeeps the date picker and a token with no time (tested); the PowerSearch, edit-popover, value-editor and formatter suites pass unchanged.PowerSearchDateTime.test.tsx, 11 cases; 10 fail onmain(the date-only control case passes there by design), the layout case failing without the full-width value cell.Writing rubric results
#+ digits,/pull/,/issues/).isDateOnly: falsequestion is ruled and removed.Scope
DateTimeInputforisDateOnly: falseis the documented option's meaning.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.tsx11/11 here, 10 failing onmain.pnpm -F @astryxdesign/core typecheck,typecheck:docs— clean.ASTRYX_STRICT_LINT=1eslint onpackages/core/src/PowerSearch/— 0 findings.pnpm check:repo(includescheck:knowledge,check:changesets) — clean; prettier andgit diff --checkclean.