Skip to content

feat(flags): match Hub's look, compare environments, and show inventory drift - #5163

Merged
shepherdjerred merged 2 commits into
mainfrom
flags-ux-views
Nov 26, 2026
Merged

shepherdjerred merged 2 commits into
mainfrom
flags-ux-views

Conversation

@shepherdjerred

@shepherdjerred shepherdjerred commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Why

Flags could show only one deployment at a time, so comparing scout/beta with scout/prod meant clicking through two lists by eye. The live-vs-inventory drift report existed only as toolkit 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:

  • Page layout: every page is PageBody + PageHeading (actions prop). 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 are SummaryGrid and Card; search is SearchField; the compare Differences/All switch is Segmented.
  • State column: SeverityBadge pills (On is ok, Off is neutral with a minus glyph, Targeted is info with a crosshair).
  • Sidebar: lucide icons, a Views group (Overview, Compare, Drift with a total count), and the shared ⌘K button. Below 900px the shared TopBar and drawer replace the native deployment select.
  • ⌘K palette (shared console-ui palette): views, deployments, and flags across every deployment, sharing useDocument's cache.
  • Overview (/): one card per catalog with each stage's flag count, revision and sync state.
  • Compare (/compare?left=scout/beta&right=scout/prod): every key is classed as differs, only-left, only-right or identical. ?q=, ?same=1 and ?key= live in the URL. A selected row shows a side-by-side JSON line diff with links to both editors. With only left given, the catalog's other stage is the partner.
  • Drift (/drift): GET /v1/diff as 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 documented toolkit flags remediation command.
  • Live refresh: the deployment list and drift report refresh when a document arrives at a newer revision, e.g. after a save.
  • Wire schema: the diff response schemas move to the browser-safe feature-flags/src/flags-wire.ts (flags-drift.ts imports Node and the inventory, so the browser can't load it). invalid keeps its .default([]).
  • /v1/diff stays strict: a seeded deployment missing from the store still fails loudly, because startup seeds every inventory deployment. The drift page shows the error state.
  • Line diff, not Monaco: compare and drift use a small line diff, because the drift page renders many diffs at once. The single-flag save review keeps the Monaco diff (feat(flags): edit flags in Monaco with registry-driven JSON validation #5161).

Demo

Before (main) After
flags-boolean-editor-dark.png deployment-dark-1440.png
flags-boolean-editor-light.png deployment-light-1440.png
before-mobile.png deployment-dark-600.png

New views (seeded local data):

Overview Compare scout/beta ↔ scout/prod
overview-dark-1440.png compare-dark-1440.png
Drift ⌘K palette
drift-top-dark-1440.png palette-dark-1440.png

Monaco JSON editor inside the new shell, and live Hub at the same viewport for parity:

Editor Hub
editor-json-dark-1440.png hub-services-dark-1440.png

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/diff including 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.
  • Rendered locally, dark and light at 1440px and 600px, console and uncaught errors empty. Seeded data: beta/prod differences, drift on 3 flags, one invalid variant value, one undeclared and one missing key (written straight into SQLite, since the apply API refuses undeclared keys). The Monaco JSON editor was checked inside the new shell, and compared with live Hub at the same viewport.
  • 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.tsx holds 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, then activity-routing-replay.test.ts at the default 5s, tracked as AI-936). The replay test passes alone in 3.3s, and nothing in this PR touches Temporal.
  • Not yet verified: Woodpecker CI, image publish, ArgoCD, and live flags/prod.

Part of FM-228.

🤖 Generated with Claude Code

https://claude.ai/code/session_011u9pQnKWrycqkZxjQrvL4Q

@greptile-apps

greptile-apps Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T18:53:01.539961Z 1f96042 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Base automatically changed from flags-ux-monaco to main November 26, 2026 16:29
…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
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
@shepherdjerred
shepherdjerred marked this pull request as ready for review November 26, 2026 18:49
@shepherdjerred
shepherdjerred merged commit 2352dcf into main Nov 26, 2026
8 checks passed
@shepherdjerred
shepherdjerred deleted the flags-ux-views branch November 26, 2026 21:07
shepherdjerred added a commit that referenced this pull request Nov 26, 2026
…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>
shepherdjerred added a commit that referenced this pull request Nov 27, 2026
…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>
shepherdjerred added a commit that referenced this pull request Nov 27, 2026
…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>
shepherdjerred added a commit that referenced this pull request Nov 27, 2026
…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>
shepherdjerred added a commit that referenced this pull request Nov 27, 2026
…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>
shepherdjerred added a commit that referenced this pull request Nov 28, 2026
…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>
shepherdjerred added a commit that referenced this pull request Nov 28, 2026
…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>
shepherdjerred added a commit that referenced this pull request Nov 28, 2026
…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>
shepherdjerred added a commit that referenced this pull request Dec 3, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant