Repository navigation
improve(ui): reuse date formatters across timestamp lists - #146789
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 6:04 AM ET / 10:04 UTC (Revision 6). ClawSweeper reviewWhat this changesReuses one lazy date formatter per render across Automations history, Usage conversations, and Tasks timestamp titles, with coverage for locale changes and invalid dates. Merge readiness✅ Ready for maintainer review Keep open with no actionable findings. The optimization remains absent from current main, preserves existing timestamp behavior, and has useful, appropriately bounded performance evidence. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI renders timestamps supplied by automation runs, conversation logs, and task updates. Its shared formatting helper converts those values into localized labels and titles using the system timezone. flowchart TD
A[Run logs and task updates] --> B[List render]
C[Current locale and system timezone] --> D[Render-scoped date formatter]
B --> E{Valid timestamp?}
E -->|Yes| D
E -->|No| F[Localized unavailable label]
D --> G[Timestamp labels and titles]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +20, Tests +115. Total +135 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep date formatting in the shared helper with render-scoped reuse, preserving existing labels and refreshing locale and timezone on subsequent renders. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug reproduction: this is a performance improvement, and source confirms repeated formatter setup in current main. Is this the best way to solve the issue? Yes. Extending the existing formatter owner and limiting reuse to each render avoids persistent-cache invalidation while preserving the established formatting contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b938f093b1e4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
377ced7 to
0878e2e
Compare
0878e2e to
23bc7b2
Compare
|
Merged via squash.
|
* refs/heads/temp/pr-146883: (159 commits) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) fix(ui): let slow dashboard downloads finish before recovery (#146881) ...
* refs/heads/temp/pr-146833: (43 commits) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) ...
…ssion-list-roster-batch-20260913 * commit 'f513c0f345f7f2514c49ccfbc00adc3f78b9a755': (46 commits) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) fix(ui): let slow dashboard downloads finish before recovery (#146881) fix: share Doctor lifecycle coordination with SQLite workers (#146714) fix: retain native session model provenance (#146801) fix: settle embedded transcript repairs before session cleanup (#146842) feat(macos): improve agent navigation and chat layout (#146531) ...
What Problem This Solves
Automations run history, Usage conversations and the Tasks page recreate the same date formatter for every displayed timestamp. Long lists repeat that work when their view renders again, including Usage search-draft updates and task progress updates.
Closes #146779.
User Impact
Activity, per-job History, Usage conversations and Tasks timestamp titles reuse one lazy formatter per render, preserving locale, system timezone, minute precision and invalid-date labels. The next render picks up locale and timezone changes. No date labels or formatter state persist across renders.
With a populated Usage timeline and conversation, warm synchronous DOM updates improved 27–31% for 50–200 messages and 61–64% for 1000 messages in the measured workloads. Active Tasks warm updates improved 49–60% for 50–501 rows. Small/empty, invalid-date and cold-mount controls were mixed; this is not a universal speedup or a browser-paint claim.
Why This Change Was Made
The existing timestamp owner provides render-scoped reuse. History, conversation and task row loops consume it; one-shot callers retain the same validation and options. Tasks shares the formatter across its active and recent sections, preserving relative labels and exact timestamp titles. Empty/loading/initial-error Usage panels return before creating the render formatter, and invalid dates do not initialize its Intl formatter.
Evidence
The comparisons have separate baselines and must not be combined into an end-to-end percentage:
Original Cron change against its original main base: actual
renderCron, nine alternating pairs and five warmups on Node 24.19.0 and 26.8.2. A 50-row Activity view took 8.418 → 1.527 ms and 4.243 → 1.152 ms. Warm synchronous Lit DOM updates took 6.107 → 1.812 ms and 3.855 → 1.316 ms. All four cells won nine pairs. All 33 controls, including cold mounts, tasks/editor paths, invalid dates, locale changes and cached/uncached Markdown, remain included below.Incremental Usage reuse over the frozen, reviewed Cron helper at
377ced7: three fresh processes per runtime, three warmups and three alternating paired rounds per cell. All 29 cells per runtime were retained. Each process passed 35 full DOM/event comparisons before timing, including loaded/error/retained states and locale transitions: 210 comparisons across six processes. With conversation logs but no populated chart, warm 50/200/1000-row updates took 3.279 → 1.610 / 10.658 → 2.930 / 44.673 → 11.446 ms on Node 24, and 4.011 → 1.479 / 11.741 → 3.122 / 45.657 → 14.244 ms on Node 26. Each improved in all three processes and nine paired rounds.Separate populated-chart supplement: six cells per runtime, again three fresh processes and three paired rounds. All six fixture/DOM/event comparisons passed in each child: 36 comparisons total. This covers the normal combined timeline-and-conversation state that the original Usage fixture omitted. Chart timestamps use the selected UTC setting; conversation timestamps retain system-local formatting. Exact bar/log counts, positive finite geometry, coherent point/log/session totals, timestamp labels, generated-ID reference topology and all six conversation callbacks were checked before timing.
Incremental Tasks reuse over the same frozen Cron helper at
377ced7: actualrenderTasksplus synchronous Lit DOM commit, three fresh processes per runtime, three warmups and three alternating paired rounds. All 32 controls per runtime were retained; each child passed 35 complete DOM/title/link/callback comparisons before timing, 210 comparisons across six processes. Active 50/200/501-row warm updates took 5.140 → 2.612 / 21.069 → 8.473 / 49.676 → 20.634 ms on Node 24 and 4.784 → 2.417 / 18.196 → 7.677 / 40.852 → 17.589 ms on Node 26. Every one improved in all three processes and nine paired rounds. The 501 active-row case exercises supported pagination under stress; it is not a typical list-size claim. Recent rows remain capped at 50: the recent-200 fixture supplies 200 records but displays 50.Usage numbers are medians of three process medians. The populated-chart Node 26 cold-50 case regressed in two process medians; cold-200 and cold-1000 each regressed in one. The Node 24 candidate cold-1000 data retains a 1408.640 ms sample. No outliers were removed or favorable cases selectively rerun.
The original Usage controls also retain regressions: Node 24 empty warm +0.250 ms, single-row cold +0.745 ms, single-row template +0.044 ms and initial-error template +0.031 ms; Node 26 empty warm +0.065 ms, single-row cold +0.370 ms, empty template +0.030 ms, no-selection template +0.023 ms and initial-error template +0.007 ms. The original 1000-row cold Node 24 aggregate improved but only one of three process medians did. The original Cron task-table DOM controls (a different surface from the Tasks page) regressed 3.6–6.5 ms on Node 26; attribution remains unresolved.
Tasks adverse medians remain material: Node 24 invalid-50 cold +3.689 ms and warm +0.122 ms, error-50 cold +5.115 ms, active-0 cold +0.098 ms and warm +0.008 ms, active-1 cold +0.062 ms, and active-10 cold +0.295 ms. Node 26 invalid-50 cold +0.916 ms and warm +0.027 ms, active-0 cold +0.016 ms, active-1 cold +0.093 ms and warm +0.027 ms. Node 24 active-1 warm has a lower aggregate median but regressed in two of three processes; Node 26 English-locale cold similarly regressed in two processes. All process/paired wins appear in the Tasks table below rather than being inferred from aggregate medians. Progress fixtures use the existing task-event reducer before timing; event-to-render scheduling is not measured.
These are synthetic complete-view calls in the canonical jsdom harness. Cold means a fresh synchronous Lit mount in a warm process, not application startup. Timings exclude asynchronous widget updates, cleanup, browser layout/paint and Gateway latency. Both variants and parity/DOM churn share each proof process: RSS is not comparative retained-memory or allocation evidence. Original Usage end RSS ranged 1.78–1.80 GiB on Node 24 and 1.62–3.92 GiB on Node 26; the last Node 26 peak was 4,107,564 KiB. Supplemental end RSS ranged 1.99–2.02 GiB and 1.51–1.73 GiB, respectively. Tasks child peaks ranged 1.849–1.864 GiB on Node 24 and 1.715–2.160 GiB on Node 26, again including both variants, full preflight and DOM churn. Every sample remains preserved.
Validation and Remaining Gates
canonicalProviderNameandlistPackagedStaticExtensionAssetOutputsin untouched scripts, both reproduced on clean original base004332fc723a.canonicalProviderName; the full-tree scan reported that export andlistPackagedStaticExtensionAssetOutputs. Both findings were reproduced on clean original base004332fc723a; the export owners, three Knip configs and scan runner remain unchanged through the refreshed base and subsequently observed main. This is an inherited failure, not a passed aggregate gate.The reviewed seven-file change has been rebased without source changes onto main
a8a9114fb78784cb726ba271e3b4da74a40f01a9, producing commit23bc7b2dd19a38f087eea996273117546cce40aa. All seven reviewed raw hashes and the nine frozen chart-baseline owners still match0878e2ecd5c6d542d71062aaaa754f47766370fc; the relevant Cron, Usage, Tasks, formatter, i18n and package/lock scopes are unchanged from the previous base. The remote PR head is verified at23bc7b2dd19a38f087eea996273117546cce40aa, and CI 34750491800 completed successfully for that exact commit, including the requiredopenclaw/ci-gate. Native preparation and merge remain pending. Historical measurements and review inputs remain unchanged. The previous reviewed candidate was commit0878e2ecd5c6d542d71062aaaa754f47766370fc, based on912685f442286233fbbd40762482d98598299497. Review inspected checkout HEADd44d18f3de2a1753213a13f72238ba3df6c9298eplus the four explicit Usage/Tasks working-tree files; all seven raw source hashes match the final commit after hooks. Original Cron measurements remain on004332fc723aaea35530db9135d819809e59aac2; incremental Usage and Tasks measurements remain on377ced7f87619696d2b44e24f032e95922cab162. Package and lock inputs are unchanged. The frozen review records these seven final raw SHA-256 identities:Ref provenance: these linked worktrees share
C:/projects/openclaw/.git. The selected command passed the symbolicorigin/mainto the ratchet guards; that shared ref advanced from912685f442286233fbbd40762482d98598299497tof01640e3fb78c70676148e32ae65c9bf6f8eec3fduring the run, and the raw completion status records the latter tip. The guard owner resolvesgit merge-base HEAD <ref>, which remained912685f442286233fbbd40762482d98598299497; it does not compare the branch's grandfathered entries with the moving tip. A later fetch tob41062471975aaf0011f90b10f6d527dd10da934occurred after completion. The exact tip read by each guard was not separately logged, so no pinned-origin/mainclaim is made.Reviewed seven-file source identity
ui/src/lib/format.ts823490a9ec05d5df5ce1749e8844f8f5c56bfb6ab601b1b0d5020cdcba1d2542ui/src/pages/cron/view-runs.ts5b3bba08ef7b18048827a1843e40f7dbc476d8c94afbd9b61f5968b0cd76256dui/src/pages/cron/view-run-history.test.tsf62aedae4e3116ddb05c30e3f764124fbdcac5f10021ddb19f78e14f50a7929dui/src/pages/usage/view-details.ts8b20c447b652d75c958a2024dccaa1f1c118c6f1be6ee933bbe00313e7100a6dui/src/pages/usage/view-details.test.tsf5e880f34956e55f9a1615251d15f232370ef28d55cdbcca41de0fc90b1dde1cui/src/pages/tasks/view.tsf541765993a3143d8639791488151ac75bb2965d2f2a25fea0cb10840260769dui/src/pages/tasks/tasks-page.test.ts3c7ac4e28a538038abec13916bb69a6e231fbe8dd52eeca2f9d5ea02b2cec6aaHosted CI and Diagnostic Gaps
Historical CI run 34748959547 for
0878e2ecd5c6d542d71062aaaa754f47766370fccompleted with failure: checks-ui-e2e (4/7), job 103701945906, had 318 passing tests and one failure across 77 files. The sole failure was chat-file-links.e2e.test.ts:309, “keeps root-distinct file labels and targets through click and keyboard,” waiting 30 seconds for the obsolete exact button name “Close Review.” Tested merge4f8498f63845585e6ed65774d2f81f03551be356used baseb41062471975aaf0011f90b10f6d527dd10da934. The dependent CI gate also failed; these historical failures remain recorded. Main independently acquired the exact “Close tab: file.ts” repair inff9c1b0bc8ae77b897d9d98f31a1fe1e90e18b9a, PR #146810, merged at 09:39:02 UTC on September 13. The repaired file blob9759b40cfc1b6a96e1870812d5d177fc6fc2c098is identical to the reviewed Scroll repair and is included in the new base. No duplicate formatter edit or test rerun was made. The prior separate label run 34748959326 failed HTTP 500 deleting size: S; that is a separate historical service failure. The rebased commit is remotely verified and its CI passes; native landing remains pending.The initial hosted run failed the real-Gateway delegation case after filling the composer: it was waiting for Send message and the captured draft was empty. The unchanged canonical case passed locally on Node 24 with the production bundle, including immediate fill/send, approval persistence across reloads, event ordering, config update, final history and cleanup. No readiness waits, timeout changes or test/product edits were introduced. That Windows Chromium result does not reproduce or repair the original Linux empty-draft symptom.
Hosted attempt 2 failed earlier in the separate desktop-resize proof. Its Node carrier passed; SSH failed the original viewer framebuffer check after successful control transfer, controller resize to 900×500 and guest keyboard input. The exported receipt lacks the failed viewer dimensions and socket state. Relevant desktop source is unchanged; no direct formatter attribution or clean-baseline reproduction is established. Attempt 2 never reached the original delegation suite.
Two isolated desktop diagnostics also failed before the application payload. The first diagnostic timed out during native full source sync. The debug diagnostic timed out during changed-file transfer and its native checksum-full fallback. Neither ran the source receiver, build or test, and neither produced an application observation. Cleanup completed; transfer rate/receiver errors do not establish the lower-level cause. These failures remain evidence gaps, not passed validation. Shared CI repairs in #146803 have since merged at
2e0bfa16; this does not attribute or reproduce the earlier application failures. The formatter candidate has now been refreshed and committed as identified above. Expanded selected checks completed with the inherited export failures recorded above; the remotely verified new commit has passed hosted CI and still requires native preparation and merge.All measured controls and limitations
Times are milliseconds per render. Template cells execute history row construction; DOM cells include synchronous Lit commit. Eight template renders or two DOM commits were measured per sample. Module startup, asynchronous widget updates and cleanup are excluded. Uncached Markdown uses new synthetic summaries per invocation. Fixtures use a fixed clock and synthetic records; no live Gateway or private data.
The combined proof process reached approximately 3.05 GB RSS on Node 24 and 1.46 GB on Node 26 after the rich/DOM workload. These are combined harness measurements, not candidate-versus-baseline retention figures. The unchanged every-task path also moved in the late DOM controls; no attribution or selective rerun is claimed.
All 32 Tasks controls and limitations
Incremental Tasks caller measurements over the frozen Cron helper. Values are milliseconds, medians of three process medians. Wins are process medians out of three and paired rounds out of nine. All 64 runtime rows are retained. Cold mounts occur in a warm jsdom process; timing excludes asynchronous agent-chip updates, browser layout/paint and Gateway handling.
The active-501 and progress-501 cells are stress cases; recent-200 respects the existing 50-row visible cap. Loading, error and disconnected fixtures retain available rows. Zero and invalid timestamps preserve the existing absence of an exact-date title. All initial adverse controls and final raw samples remain retained; no attribution to noise or selective rerun is claimed.