Repository navigation
feat: Lens polish — Dashboard IA, 30d default, inbox clarity, drift lead (#654–#657) - #660
Conversation
Batch of four self-contained Lens web-UI polish fixes (all in the single-file offline SPA at tokenjam/ui/index.html), each closing an enhancement issue. No new external HTTP/deps (Rule #18) and no client-side re-implementation of framing/analysis — copy, markup, default-value, and nav-grouping changes only. #654 — Dashboard nav + default landing. The Dashboard's waste tiles + spend pivot serve both the Improve and Observe lenses equally, so it is now a persistent top-level sidebar entry (data-lens="all") seated ABOVE the Improve/Observe toggle, visible in either mode. The empty-hash default route now resolves to Dashboard in getRoute() (the single source of the default) instead of the Review inbox — no render-time location.hash redirect, which would race first paint (#132). #655 — one shared 30d window default. Traces defaulted to 24h and Cost to 7d while Optimize/Analytics already used 30d. A single DEFAULT_SINCE constant now feeds every window-driven screen's DEFAULTS.since, resolved in the param layer when no since is in the URL. Alerts keeps its all-alerts empty default on purpose (it filters, not windows; a 30d default would hide older unacknowledged alerts). #656 — Review inbox clarity. Added an appliable-count line ("N of M can be applied automatically — the rest are copy-and-apply") so "Open (6)" beside a single checkbox stops reading as unselected rows, and gated the bulk Select-all + action bar on more than one auto-appliable row. Reworded the Approve/apply affordances to state the write is a file/config change effective on the NEXT run — not live, in-path enforcement, and not a guaranteed saving (honesty Rule 14). #657 — Drift empty-state. Led the no-baselines screen with a scannable one-line headline stating the requirement, keeping the existing grey detail lines below. Guarded by static-grep assertions in the new tests/unit/test_lens_ui_regression.py (Dashboard persistence + default route, the 30d constant, the inbox count/Apply copy, the Drift headline); test_ui_offline.py and the node-extraction behaviour tests stay green. Closes #654 Closes #655 Closes #656 Closes #657 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
| Filename | Overview |
|---|---|
| tokenjam/ui/index.html | Updates SPA navigation, route synchronization, shared time-window defaults, review-inbox messaging and controls, and the Drift empty state; the three previously reported failures are corrected. |
| tests/unit/test_lens_ui_regression.py | Adds static regression assertions covering the UI polish and the fixes for all three previous review threads. |
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
The Lens polish batch (#654–#657) introduced three coupled regressions around the new lens-neutral Dashboard and the moved 30d window default. Greptile flagged all three as P1; all are pure routing/nav-sync logic in the single-file offline SPA. P1-1 — default route inconsistency. getRoute() defaults an empty hash to Dashboard, but the URL-normalization effect still replaceState'd #/review (the old Improve home), so the rendered page and the address bar disagreed and a refresh or shared bare link opened Review. The normalization now writes #/dashboard to match getRoute() — one default, no render-time hash redirect (#132 preserved). P1-2 — Traces drill-through dropped a non-default window. The default moved to 30d, but tracesHrefForWindow() still omitted the window at the retired 24h literal, so a Dashboard set to 24h drilled into Traces and silently fell back to 30d. Both tracesHrefForWindow and optimizeFindingHref now decide "omit since" against the shared DEFAULT_SINCE constant, so drill-through preserves the window the tile was computed from and the default can move again without dropping a real window. P1-3 — Dashboard nav reset the active lens. Dashboard is data-lens="all" (visible in both lenses) but was still mapped to 'improve' in VIEW_LENS, so opening it from Observe flipped the sidebar to Improve and hid the Observe nav. Dashboard is now absent from VIEW_LENS; the route-sync effect falls back to the sidebar's current lens for an unmapped (lens-neutral) view, so the active lens is preserved. Extends tests/unit/test_lens_ui_regression.py with three static-grep guards (default-route normalization agrees on dashboard; DEFAULT_SINCE-driven drill-through omission; Dashboard lens-neutral + lens-preserving fallback). node --check on the extracted module + lens scripts passes; test_lens_ui_regression, test_ui_offline, and the JS behaviour lens tests are green. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Fixed all three Greptile P1 findings (commit e665266) — all pure routing/nav-sync logic in P1-1 · Default route kept P1-2 · Traces drill-through dropped a non-default window → P1-3 · Dashboard nav reset the active lens → Dashboard ( Tests / verification
Not merging — leaving for review. (Note: this branch rebases over #659 at merge — separate concern.) |
# Conflicts: # tests/unit/test_lens_ui_regression.py
Four self-contained Lens web-UI polish fixes, all in the single-file offline SPA (
tokenjam/ui/index.html), each closing an enhancement issue. No new external HTTP/deps (Rule #18) and no client-side re-implementation of framing/analysis — copy, markup, default-value, and nav-grouping changes only.Summary
#654 — Dashboard nav + default landing
Closes #654
The Dashboard's waste tiles + spend pivot serve the Improve and Observe lenses equally, so it is now a persistent top-level sidebar entry (
data-lens="all") seated above the Improve/Observe toggle and visible in either mode (the improve/observe hide rules only target those two values, so an"all"link is never hidden). The empty-hash default route now resolves to Dashboard ingetRoute()(the single source of the default) instead of the Review inbox — no render-timelocation.hashredirect, which would race first paint (#132).#655 — one shared 30d window default
Closes #655
Traces defaulted to 24h and Cost to 7d, while Optimize/Analytics already used 30d. A single
DEFAULT_SINCE = '30d'constant now feeds every window-driven screen'sDEFAULTS.since, resolved in the param layer when nosinceis in the URL. Alerts keeps its all-alerts empty default on purpose (itssinceis a filter, not a window; a 30d default would hide older unacknowledged alerts). Drift and Budget have no window selector, so nothing to standardize there.#656 — Review inbox clarity
Closes #656
showBulkSelect = autoApplyCount > 1), instead of the old> 0which showed a bulk control governing a single row.apply_kindhints/buttons to state the write is a file/config change effective on the next run — not live, in-path enforcement, and not a guaranteed saving (honesty Rule 14). The ambiguous single-word "Apply change" button became "Write change".#657 — Drift empty-state
Closes #657
Led the no-baselines Drift screen with a scannable one-line headline ("Drift needs live SDK agents with 10+ completed sessions — Claude Code / Codex sessions and backfilled history aren't baselined."), keeping the existing grey detail lines below. Copy/markup only; no overclaiming.
Tests / Verification
tests/unit/test_lens_ui_regression.py— static-grep guards for Dashboard persistence + default route, the shared 30d constant, the inbox count/Apply copy, and the Drift headline.node --checkon the extracted<script type="module">block: passes.tests/unit/test_ui_offline.py+ the node-extraction behaviour tests (test_lens_select_all_behaviour.py,test_lens_dashboard_states.py): green.Rebase note
This PR shares
tokenjam/ui/index.htmlwith #653 (trace-detail / waterfall). I deliberately stayed out of that component, but a rebase over #653 may still be needed on merge.What's NOT in this PR
sincedefault (deliberately all-alerts; see Lens: default the time window to 30d everywhere (Traces defaults to 7d) #655 section).🤖 Generated with Claude Code