Repository navigation
feat(flags): match Hub's look, compare environments, and show inventory drift - #5163
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
ab5c34c to
970648c
Compare
970648c to
35e1f42
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
35e1f42 to
2f488d6
Compare
2f488d6 to
bcf797d
Compare
bcf797d to
3c13dea
Compare
3c13dea to
98fb38d
Compare
…ry drift Why Flags opened to a bare header and a table while Hub and Go link share a page kit, so the three consoles read as different products. Operators also had no way to see how beta and prod differ, or which deployments have drifted from managed-flag-inventory.json, without the toolkit CLI. What - Every Flags page is a console-ui PageBody with a PageHeading. A deployment's heading names the catalog and stage, shows its revision, links a drift badge to /drift#<id>, and offers "Compare with Beta/Prod". Summaries use SummaryGrid and Card; search uses SearchField and the identical-flags toggle uses Segmented. - Flag states are SeverityBadges with icons (On ok/check, Off unknown/minus, Targeted info/crosshair). - Sidebar: lucide icons, a Views group (Overview, Compare, Drift with the total drifted-item count) and the shared palette button. Below 900px the shared TopBar and drawer list the same views and deployments. - New /compare (two deployments' documents diffed per key, ?q= ?same=1 ?key=, side-by-side line diff), /drift (GET /v1/diff, strict server-side so a missing deployment still fails loudly; the page shows the error) and an overview with a card per catalog. - ⌘K palette on console-ui's CommandPalette searches views, deployments and flags across every deployment, loading documents under useDocument's key. - The browser-safe wire schemas move to feature-flags' flags-wire.ts (Zod only, keeping invalid's default) so the UI parses /v1/diff with the server's schema. - README Operator section and the check-flag-inventory how-to describe the views and the palette. Verification - bunx turbo run build typecheck test lint --filter=@shepherdjerred/flags --filter=@shepherdjerred/feature-flags --filter=@shepherdjerred/console-ui: 16 tasks passed (flags 79 tests, feature-flags 223, console-ui 259). - bunx turbo run typecheck --filter=@shepherdjerred/temporal --filter=@shepherdjerred/toolkit: 34 tasks passed. - bunx lefthook run pre-commit on the staged paths: passed. - Rendered the built UI against a seeded local server (beta/prod differences, an invalid variant value, an undeclared key and a missing key) in dark and light at 1440 and 600px: overview, deployment, compare with a selected row, drift, the open palette and the Monaco JSON editor; browser console and uncaught errors were empty. Compared against live Hub at the same viewports. - Not run: verify:extended (no affected extended steps); deployed Flags and the live release path (nothing deployed from this branch). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQnKWrycqkZxjQrvL4Q
98fb38d to
2d1fcea
Compare
Why: render.test.tsx and views/views.test.tsx each carried their own copy of the viewport stub, settle helper and app mount. jscpd's baseline ratchet rejected the new clone pair, and the copies would drift. What: app-harness.test-support.tsx owns settle, stubNarrowViewport and mountApp (container, root, query client, router, App and a caller-supplied location probe). Both test files import it and keep only their own Probe and query helpers. Verification: bunx turbo run build typecheck test lint --filter=@shepherdjerred/flags passes (79 tests); the jscpd baseline ratchet passes at exactly the baseline (932 clones across 681 pairs). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQnKWrycqkZxjQrvL4Q
…formance Why Flags restyle (#5163) landed on the old page kit, which CU1 deprecates. What Generate packages/flags/eslint-suppressions.json for no-deprecated and regenerate the Flags conformance allowlist from main's real code. Verification turbo typecheck lint test on flags, console-ui and the other consoles pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…formance Why Flags restyle (#5163) landed on the old page kit, which CU1 deprecates. What Generate packages/flags/eslint-suppressions.json for no-deprecated and regenerate the Flags conformance allowlist from main's real code. Verification turbo typecheck lint test on flags, console-ui and the other consoles pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g table (#5329) Why: since the table moved to the console-ui kit's .ui-data classes (#5163), cells wrap text, so a long variant value such as delivery-enabled-environments wrapped into a cell dozens of lines tall instead of truncating with an ellipsis. .fl-value relied on the old table's nowrap. What: .fl-value sets white-space: nowrap itself, so the existing max-width and text-overflow: ellipsis apply again. Verification: rendered a local Flags server with a long delivery-enabled-environments value; every .fl-value computes white-space: nowrap at one line (17px). bunx lefthook run pre-commit passes. Claude-Session: https://claude.ai/code/session_011u9pQnKWrycqkZxjQrvL4Q Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…formance Why Flags restyle (#5163) landed on the old page kit, which CU1 deprecates. What Generate packages/flags/eslint-suppressions.json for no-deprecated and regenerate the Flags conformance allowlist from main's real code. Verification turbo typecheck lint test on flags, console-ui and the other consoles pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…formance Why Flags restyle (#5163) landed on the old page kit, which CU1 deprecates. What Generate packages/flags/eslint-suppressions.json for no-deprecated and regenerate the Flags conformance allowlist from main's real code. Verification turbo typecheck lint test on flags, console-ui and the other consoles pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…formance Why Flags restyle (#5163) landed on the old page kit, which CU1 deprecates. What Generate packages/flags/eslint-suppressions.json for no-deprecated and regenerate the Flags conformance allowlist from main's real code. Verification turbo typecheck lint test on flags, console-ui and the other consoles pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…formance Why Flags restyle (#5163) landed on the old page kit, which CU1 deprecates. What Generate packages/flags/eslint-suppressions.json for no-deprecated and regenerate the Flags conformance allowlist from main's real code. Verification turbo typecheck lint test on flags, console-ui and the other consoles pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and consistency checks (#5279) * feat(console-ui): one vocabulary, tokens beyond colour, ConsoleShell and consistency checks Why console-ui held two looks: the chosen design and a page kit (#5151) that copied the old Hub (uppercase eyebrow, big title, stat cards, 36px controls, mono uppercase tables, pill badges). Only colour was tokenised, so spacing, type, radii and breakpoints were hard-coded per app, and the package contradicted itself (two focus rings, two backdrops, ten radii, 600 vs 650 weights, four breakpoints). Apps patched shared classes and four carried their own phone top bar. Nothing stopped the old vocabulary coming back. What - tokens.json gains spacing, type, weights, radii, sizes (28px controls, 44px hit areas on touch), layers, motion, translucent backdrop and shadows per theme, phone gutter, and breakpoints (also BREAKPOINTS and SIDEBAR_QUERY in TS). tokens.css is generated from it. - components.css is split into one file per piece under styles/components/, all on tokens: one focus ring, one backdrop, one radius scale, weights 400/500/600, breakpoints 600 and 900 in range syntax. - New pieces: ConsoleShell (nav declared once for sidebar and drawer, skip link, switcher, palette button, theme row), NavTabs, Banner, State, Section and .ui-columns, Dialog/DialogClose and ui-dialog classes, ICONS. HeaderBar gains lead, titleId, focusOnMount and phone wrapping; FigureStrip gains label, layout, href and glyphs; StatusGlyph gains icon and rich labels; Chip takes children or label/value plus href with no margin; Button gains danger; SearchField is 28px on the field look. .ui-table absorbs the apps' patches (row headers, current row, sticky head, mono .ui-num, tfoot, caption, empty row, truncation, row links) and one phone rule (scroll, or data-stack label/value lines). - createThemeStore() defaults to the shared ops-theme key, works without a DOM and keeps theme-color metas equal to the bg token. - Page kit, TopBar, ThemeToggle, SeverityBadge and size="page" are @deprecated; page.css keeps their look (Go link renders unchanged) and is held to a frozen allowlist. Go link's uses sit in eslint-suppressions.json. - Checks: vocabulary.test.ts (shared CSS), the per-app scan (@shepherdjerred/console-ui/testing) with a conformance.test.ts and an exact-count allowlist in all ten consoles, and consumers.test.ts. - Hub /kit and /kit/detail gallery, reachable from the palette only, with a Playwright spec (axe light/dark, overflow 375/1280, dialog focus). - README and wiki reference rewritten. Verification - bunx turbo run build typecheck test lint for console-ui, alert-dashboard, ops-model, golink, delivery, tracker, errors, mail, flags, feeds, charts, ci-cache: 65/65 tasks pass. - bun run jscpd: ratchet passed. bun scripts/tools/knip.ts: exit 0. - Hub Playwright (full suite) and the new kit.spec.ts pass locally. - Go link before/after pixel diff: identical except 49px of the workspace mark letter (weight 700 to 600). - Not run: exact-head Woodpecker CI, deployment, live acceptance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(flags): suppress deprecated console-ui imports and rebaseline conformance Why Flags restyle (#5163) landed on the old page kit, which CU1 deprecates. What Generate packages/flags/eslint-suppressions.json for no-deprecated and regenerate the Flags conformance allowlist from main's real code. Verification turbo typecheck lint test on flags, console-ui and the other consoles pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(alert-dashboard): baseline the Renovate queue's native select Why #5272 added Hub's Renovate ranking page after the CU1 baseline was taken. Its queue filter uses the deprecated `ui-select` class, so the restacked conformance scan fails Hub's tests. console-ui has no Select until CU4. What - One `deprecated-class` allowlist entry for renovate-ranking.tsx (count 1), with the reason and the PRs that remove it (CU4 Select, then H3/H4). Verification - `bun --bun vitest run src/client/conformance.test.ts` in alert-dashboard: 1 passed (failed before the entry). - turbo build typecheck test lint over console-ui's dependents and Go link on the restacked branch: 216/217, the one failure being this test. - `scripts/checks/check-directory-file-counts.ts` passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(flags): baseline #5325's new pages against the deprecated page kit Why #5325 (flag history, archive) merged after CU1's Flags baseline. Its new archive page and history panel import page-kit pieces that CU1 deprecates, and its test harness builds a theme store with Flags' own key. Merged onto main as it was, CU1 failed Flags' lint (no-deprecated) and conformance tests. What - eslint-suppressions.json: no-deprecated counts for archive-page.tsx (6) and history-panel.tsx (1), regenerated with `eslint --suppress-rule`. - Conformance allowlist: deprecated-import for archive-page.tsx (4) and history-panel.tsx (1), theme-store-key for app-harness.test-support.tsx (1), each to be removed by FL1. Verification - Found by merging CU1's head into current main in a scratch worktree: Flags conformance and lint failed there. - After this commit: `bunx eslint --cache . --max-warnings=0` clean; conformance test 1 passed; turbo build typecheck test lint over flags, console-ui, alert-dashboard, errors and golink 39/39. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Why Flags (#5163) was built on the deprecated console-ui page kit: eyebrow headings, stat cards, pill badges, a native <dialog> and local copies of shared pieces. Every other console is on the header bar, figure strip, sections and shared controls, and the page kit is deleted once its last consumer leaves. What - ConsoleShell frames the app (switcher, palette, one declared navigation, phone drawer); the theme uses the shared ops-theme key (the old flags-theme preference is migrated) and index.html carries theme-color. - Every page is a HeaderBar, a FigureStrip and Sections with .ui-table lists; status is StatusGlyph, tags Chip, view filters Tabs, loading and empty and error lines State and Banner, the list search FilterBar. - The editor shows a flag's facts in a DescriptionList, its review is the shared Dialog, the conflict is a Banner, and Form mode uses Field, Switch, Select, Textarea and Fieldset. Monaco stays; values are CodeBlock; "Last fetched", "Last changed" and "Last evaluated" are RelativeTime and audit times are ExactTime (Pacific). History is a table with expandable rows. - styles.css keeps only app classes (two-pane body, diff, form layout); the conformance allowlist and eslint suppressions are now empty. - Tests move one for one from class selectors to roles, labels and data attributes; the Select and Dialog are driven through Base UI. Verification - bunx turbo run build typecheck test lint --filter=@shepherdjerred/flags: 128 tests pass, lint clean. - bunx lefthook run pre-commit, bun run jscpd and the directory file-count check pass. - Rendered against fixture data in light, dark and 375px phone (before from origin/main, after from this branch). - Not run: live Flags deployment (acceptance after merge). Choosing Custom in the model picker no longer moves focus into the id field, because the shared Select returns focus to its trigger. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why
Flags could show only one deployment at a time, so comparing
scout/betawithscout/prodmeant clicking through two lists by eye. The live-vs-inventory drift report existed only astoolkit flags diff. The UI also looked older than Hub: a compact header, glyph-and-word states, no icons, no ⌘K.What
Built on
main's console-ui page kit (and the shared severity badge and ⌘K palette from #5160), so Flags uses the same components as Hub and Go link. The Monaco editor (#5161) and the value registry (#5158) are already merged:PageBody+PageHeading(actionsprop). A deployment page has the catalog as eyebrow and the stage as title, with a revision tag, a drift badge linking to/drift#<id>, and "Compare with Beta/Prod". Summaries areSummaryGridandCard; search isSearchField; the compare Differences/All switch isSegmented.SeverityBadgepills (On is ok, Off is neutral with a minus glyph, Targeted is info with a crosshair).TopBarand drawer replace the native deployment select.useDocument's cache./): one card per catalog with each stage's flag count, revision and sync state./compare?left=scout/beta&right=scout/prod): every key is classed as differs, only-left, only-right or identical.?q=,?same=1and?key=live in the URL. A selected row shows a side-by-side JSON line diff with links to both editors. With onlyleftgiven, the catalog's other stage is the partner./drift):GET /v1/diffas totals, then one section per drifted deployment, worst first: invalid values with schema issues, declared-vs-live diffs, missing and extra keys, each with its documentedtoolkit flagsremediation command.feature-flags/src/flags-wire.ts(flags-drift.tsimports Node and the inventory, so the browser can't load it).invalidkeeps its.default([])./v1/diffstays strict: a seeded deployment missing from the store still fails loudly, because startup seeds every inventory deployment. The drift page shows the error state.Demo
main)New views (seeded local data):
scout/beta↔scout/prodMonaco JSON editor inside the new shell, and live Hub at the same viewport for parity:
Verification
bunx turbo run build typecheck test lint --filter=@shepherdjerred/flags --filter=@shepherdjerred/feature-flags --filter=@shepherdjerred/console-ui: 16/16 pass (flags 79 tests, feature-flags 223, console-ui 259). New tests cover the compare model, line diff, drift model, compare page (rows, identical toggle, URL state, selected diff and links), deployment heading links, the drift page from a mocked/v1/diffincluding the failure state, palette navigation, the sidebar Views group, and the top-bar drawer.bunx turbo run typecheck --filter=@shepherdjerred/temporal --filter=@shepherdjerred/toolkit: 34/34 pass.bunx lefthook run pre-commit: green.bun scripts/tools/jscpd-check.ts: the duplication baseline ratchet passes at exactly the baseline (932 clones across 681 pairs);app-harness.test-support.tsxholds the mount harness shared by the two client test files.bun run verify:extended -- --filter='...[origin/main...HEAD]': two runs on this branch (before the harness commit, which only touches the flags client tests): 66/67 tasks, then Temporal's extended tier alone 83/84 files. The only failure both times was a Temporal test timing out under host load (a 60s series-pack integration test, thenactivity-routing-replay.test.tsat the default 5s, tracked as AI-936). The replay test passes alone in 3.3s, and nothing in this PR touches Temporal.flags/prod.Part of FM-228.
🤖 Generated with Claude Code
https://claude.ai/code/session_011u9pQnKWrycqkZxjQrvL4Q