Skip to content

fix(website): collapse the desktop top bar instead of clipping it - #15656

Merged
CrysisDeu merged 1 commit into
kirodotdev:mainfrom
peterhieuvu:fix/topbar-flow-layout
Oct 6, 2026
Merged

CrysisDeu merged 1 commit into
kirodotdev:mainfrom
peterhieuvu:fix/topbar-flow-layout

Conversation

@peterhieuvu

@peterhieuvu peterhieuvu commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: At every desktop width, the top bar collapses its own items instead of clipping them, so the connection dot always stays on screen.

On nightly and insider builds, the "Report problem" chip makes the top bar's right group wider than the widths its collapse steps were measured for. The readout capsule then spills off the left of its group: the connection dot goes first, then most of CPU/MEM/DSK. In English this happens in bands between 1638px and 970px (first screenshot). Stable builds have no chip. #16744 reports a related overlap: at 1512px with the Command Bar app on, the search input covers the capsule's CPU and memory readings.

Why it matters

The dot is the bar's only connection signal, and everyone on a prerelease build loses it at common laptop widths. The chip is the second extra, after the update pill, that needs its own measured threshold shift. Extension segments, longer locales and any future pill would each need another, plus rules for every combination of them.

Not a goal

  • Phone widths (below 768px). The phone header keeps its container-query ladder unchanged.
  • Replacing main's container rungs on desktop. They keep firing at their widths; this PR only adds folds where they leave a group overflowing.
  • Changing which items the bar holds, how they look, or where the search sits.

What changed (motivation → approach → change)

When a side of the desktop top bar would still overflow, it now folds more of its own items to icons or hides them, in a fixed order, instead of cutting them off. Main's collapse rules and the centred search stay as they are.

Before After (desktop, tb-measured)
Side tracks Equal halves of what the search leaves Unchanged
Collapse trigger One container query per group, at widths measured for a fixed set of items The same container queries, plus useTopbarCollapse, which folds more wherever a group's contents still overflow its half
Search Always centred Unchanged

A container query sees a group's width, not whether its contents fit. So website/src/lib/useTopbarCollapse.ts reads each group's content width before paint through a .tb-measure wrapper that has no box of its own (display:contents) except during the read, picks the lowest step that fits the group's half, and sets tbl-N (identity) and tbr-N (actions) classes on the header; website/src/App.tsx wraps both groups and runs it for the desktop header. The groups stay size containers, so an item hides when either a rung in website/src/index.css or a measured step says so: the bar folds no later than main and never clips a built-in item. The measured step never sits below the last step main's rungs have folded, so both fold in one order and nothing comes back while the window narrows. Each side keeps the phone ladder's order, plus one new step that turns the feedback labels into icons before the pill goes: Back/Forward, crew names, the active crew chip; metrics numbers to the waveform icon, feedback labels to icons, credits, the feedback pill, the capsule down to the dot, and last the update pill's label, so no built-in item can push the bell out. FeedbackPill.tsx wraps both labels so they can go, names Request a Feature as an icon, and gives Report problem the same styled tip. The hook re-checks on resize, on element, text, group-class, font-family or theme changes, and on font loads. A group that still overflows at its last step (the open Windows menu, an extension widget) clips its own end; the right group clips from its far end, the bell first, so the dot goes last.

Pinned crews still give way first: the chip row adds no measured width and grows into spare room through the switcher wrappers (tb-crew-grow in InstanceTabBar.tsx). The crews list's error notice gives way only by its message, keeps its warning icon and hand-off whole, and takes spare room before the pins, up to 320px. The metrics control (website/src/shell/topbar/metricsReadout.tsx) keeps the same contents at every step and only changes what a click does, or the measurement would feed on its own result. When the metrics fail to load, the control is a plain icon and an ErrorNotice with its agent hand-off follows the capsule; it folds to its two icons with the capsule. The failure holds through each refetch, which react-query runs as pending, so the notice and the step no longer blink on every poll.

A maintainer asked, off this PR, that the search stay anchored at every width. Measuring brings back what 626f147 removed on purpose, here as a backstop to its container rungs; that still needs a ruling.

Backwards compatibility

Breaking: an actions group that still overflows after its last step now clips its far end (the bell first, the connection dot last), where main clipped its leading edge. Only a registered top-bar widget or capsule segment past its ~40px budget can get there; their own @container rules keyed off .tb-right keep firing on both forms. Writer sweep on origin/main @ cc7e798: no in-repo code registers a widget or segment (only the registries, website/src/extensions.ts and website/src/test/extensionSeams.test.tsx); editions live outside this repo. Phones, APIs, settings and stored state are unchanged.

Reader: website/docs/extension-seams.md:Width budget for both top-bar seams -- app -- updated here for the measured backstop and the clip direction, and both seams now state that a registered component must not resize with the collapse level

Tests

  • website/src/test/useTopbarCollapse.test.ts: each group settles on its own lowest fitting step, from 0 and from a higher stored step, and stops at its last; it measures through the group's .tb-measure wrapper and subtracts the group's padding (each fails on measuring the group itself); a group without the wrapper, or with no box, keeps every item; a step the container rungs have folded is a floor the level never drops below, and a step without a container rung never is (each fails without the floor); the hook's selector map and the stylesheet's container rungs name the same items in both directions; the wrapper's inline style is restored exactly and the group's is never written; a group gaining an element, changing its text or changing its own class re-settles (the text case fails without characterData, the class case without the class observer), and so does a font-family or theme change on <html>. The CSS steps match the hook's counts per group and keep the phone ladder's order; the wrapper is display:contents at every width; the metrics icon stand-in shows at the measured metrics step, and main's container rules show and hide it otherwise; the desktop form sets no track list of its own, so the search stays centred, and right-aligns safe; the capsule step skips the Liquid Glass layers ahead of the dot; pinned chips drop their name floor once names hide; the crews error notice gives way only by its message; the metrics failure notice folds to its icons at the capsule step and never gives way; the rules apply from the 768px breakpoint.
  • website/src/test/App.metricsPopover.test.tsx: the metrics control renders the same elements in both bands, and only the collapsed one opens a popover. It fails on a control that swaps to a bare icon, which made the bar flip between two steps without settling. A failed fetch shows an ErrorNotice with its agent hand-off after the capsule, the same in both bands; the capsule's plain icon still hides the readings in the inline band and opens the card that reports the failure in the collapsed band. In the collapsed band the glyph shows whether the card is pinned, through a group variant that reads the trigger's aria-expanded, so the classes stay the same in both bands; the muted variant compiles !important, because a theme's own .text-accent override (Kiro dark) otherwise wins.
  • website/src/test/App.shell.owners.test.ts: the pinned metrics-owner call now passes the actions group's level, so the owner re-reads its probe when that level moves.
  • website/src/test/InstanceTabBar.test.tsx: every wrapper between the inline bar and the pinned row carries tb-crew-grow. A wrapper without it holds the row at 0px, so every pin reads as cut. The list-failure notice carries tb-crew-notice, its message carries tb-crew-notice-msg (the only part that gives way), and the full message is its tooltip.
  • website/src/test/FeedbackPill.test.tsx: Report problem shows its own styled tip on hover and on keyboard focus, with no native title beside it; the tip repeats the button's accessible name, so it is not also its description.
  • website/src/test/metricsReadout.popoverLevel.test.tsx: the pinned metrics popover and the hover card close when the actions ladder changes level, which can move or hide their trigger without a window resize.
  • website/src/test/AppRootCoverage.test.tsx: the failure notice goes away when the capsule's metrics icon hides the readings.
  • website/src/test/metricsReadout.failureHold.test.tsx: a failing fetch keeps reporting the failure while a refetch is in flight and clears once a frame lands; it fails on reading isError alone.
  • website/src/test/UpdatePill.test.tsx: the pill's label carries the hook the last actions step folds, and the pill stays named.
  • website/scripts/capture-topbar-flow.mjs: pass/fail sweep of the capture harness (website/capture/topbar-search-variants.tsx, which renders the three pills as the Liquid Glass panes App.tsx ships) over 24 states (English and Chinese, crew switcher and pins, update pill, nightly chip) from 1920 to 768px in 2px steps. It passes: at every width the search is centred at its window width and nothing clips, overlaps or overflows; pins never move the actions ladder and move the identity ladder by no more than their one 4px gap.

Manual verification

  • The sweep above: the three-track layout clips on English nightly builds between 1638px and 970px; the measured form never does. The same sweep passes in Firefox 146 and WebKit 26.0 (Playwright's mcr.microsoft.com/playwright:v1.58.2-noble image, 4px steps).
  • Real dashboard on a local gateway running this branch, 768–1920px in 8px steps, read twice per width and revisited from the other end: nightly with the update pill and 3 pinned crews; stable without crews; the crews list failing, alone and after 3 pins were cached; the metrics failing with readings on; Command Bar overlaps system metrics at laptop widths #16744's case (Command Bar owning the search, readings on). In every state both groups stay size containers, the search is centred at its window width, the header never overflows, the dot stays on screen, no group clips, neither step changes while the window is still, and the crews and metrics hand-offs stay whole. With a 160–320px item no step can hide added to one group, that group clips its own end (from 856px the crews hand-off, with 120px in the identity group) and the other group's step does not move.
  • With 3 pins and a failed crews refetch, the notice sits 12px after the dropdown: 226px at 1100px with the pins in the dropdown, 320px at 1920px with all three pins whole.
  • Command Bar overlaps system metrics at laptop widths #16744's case at 1512×982: both steps 0, CPU/MEM/DSK visible, the search centred clear of the capsule.
  • The Windows caption inset (142px of right padding) with the nightly chip, the update pill and 3 pins, 768–1920px: nothing clips, and the bell stays on screen; below 824px the update pill folds to its icon.
  • Nightly with the update pill and 3 pins, 1920 to 768px: the actions steps go 1, 2, 3, 4, 5 and never back; the same in the harness sweep, where the feedback labels fold at 1648px and stay folded.
  • Metrics failing with a 240px stand-in, watched for 95s at one width: the step holds through every poll.
  • Keyboard focus: Report problem's tip opens on focus where its label has collapsed; the crews hand-off's focus ring stays inside its group at 900px.
  • Collapsed metrics glyph on Kiro dark, Kiro light, dark and light: the computed colour is the theme's muted colour while the card is closed and its accent once pinned.
  • Not checked: Safari releases older than WebKit 26.0, the desktop app's window-control insets, the Windows app menu, real extension capsule segments.

Screenshots / video

Fork PR without write access, so the evidence is committed under temp-screenshots/topbar-flow/. The real-dashboard captures come from a local gateway running this branch.

English nightly build, measured ladders above, the container ladder on main below

Real dashboard, nightly with the update pill and three pinned crews: main's rungs do most of the folding; the measured step folds the feedback labels where the nightly chip would otherwise overflow

Real dashboard: nightly, three pinned crews, with and without the update pill, at 1920, 1440, 1100 and 900px

Real dashboard, crews list failing, at 1920, 1100, 900 and 768px, and at 768px with a 120px item no step can hide in the identity group, which then clips its own end

Real dashboard, nightly at 1548px (actions level 2): Report problem as an icon, its styled tip open on keyboard focus

Real dashboard at 768px, nightly with the update pill and 3 pins: the pill still labelled at step 5; with a 120px item no step can hide added to the actions group, step 6 folds it to its icon and the bell stays on screen

Real dashboard, metrics fetch failing: the notice follows the capsule at 1920 and 1100px; at 768px with a 240px stand-in item it folds to its warning and hand-off icons

At 1600px a click on the capsule's metrics icon pins the card, which reports the failure with its own hand-off; the readout stays switched on

#16744's case at 1512x982: the Command Bar owns the search, which stays centred clear of the readings

Real dashboard at 1100px, three pinned crews and a failed crews refetch: the notice takes the spare room first, the cut pins stay in the dropdown

The same state at 1920px: the notice at its 320px cap and all three pinned crews whole beside it

Recording: a live resize from 1920 to 768px and back, then a stand-in for the update pill mounting and unmounting while the window is still (the corner label shows the window width and each group's level).

Live resize and a pill mounting

Pinned crews, update pill and nightly chip together

Measured ladders and the container ladder with pinned crews, update pill and nightly chip

Related Issues

Fixes #16744

Pattern harvest

Not generalizable: the defect is the top bar's hand-measured collapse thresholds, which desktop keeps, with a measured ladder added as their backstop.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Oct 1, 2026
@dwu96

dwu96 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review.

When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically.

2 similar comments
@dwu96

dwu96 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review.

When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically.

@dwu96

dwu96 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review.

When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically.

@peterhieuvu
peterhieuvu force-pushed the fix/topbar-flow-layout branch from ab5ff7a to 2b161de Compare October 1, 2026 09:02
@peterhieuvu
peterhieuvu marked this pull request as ready for review October 1, 2026 09:02
@peterhieuvu
peterhieuvu requested a review from a team October 1, 2026 09:02
@peterhieuvu
peterhieuvu requested a review from a team as a code owner October 1, 2026 09:02
@peterhieuvu
peterhieuvu requested a review from kyleseaman October 1, 2026 09:02
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of d64b16203ffeacb4f2e376666b320028e89dcb60 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The desktop bar now runs two collapse ladders that must be kept in step by hand, and the PR itself says reviving measurement "still needs a ruling."

Watch

  • The second ladder and its unresolved ruling. The base index.css header comment says the layout works with "no measurement, no ResizeObserver". This PR keeps the container rungs and adds useTopbarCollapse with its own tbl-N/tbr-N rules on top. It also adds a floor read off the container rungs (TOPBAR_CONTAINER_FOLDS), which copies their selectors into TypeScript. From now on, every change to a top-bar item means editing three places in step: the container rung, the measured rule, and the selector map. The description says: "Measuring brings back what 626f147 removed on purpose … that still needs a ruling." Merging first makes that decision without the maintainer.
    Clears when: a maintainer rules on measured collapse (ideally as a docs/decisions/ entry), choosing either this two-ladder design or measured-only on desktop.
  • The extension contract is only written down. extension-seams.md now says a widget or segment "must not change its size in response to the header's collapse classes … or [it] re-lays the bar out without ever settling." Nothing enforces this. A widget from an edition that ignores it would re-trigger the MutationObserver → settleTopbarSide → re-render cycle in every desktop session.
    Clears when: the hook caps re-settles per frame (or detects a level that keeps flipping) and stops, with a test that fails on a component that resizes with the level.

[DESIGN-REVIEWED] d64b162

Description read

[DESCRIPTION-READ] d737924a13547d0bf96a9e95c51cecdc7a8a13be3ff33323331ebb866b64309c

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — 🟡 CONCERNS

UX-level review of d64b16203ffeacb4f2e376666b320028e89dcb60 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

When the crews list fails, its error message shrinks to a useless stub with a blank gap after it, and it still takes the pinned crews' room. No first-time reader has seen these screens.

Watch

  • Crews-list error message shrinks to nothing useful. The notice is allowed to give way down to a few letters (.tb-crew-notice-msg{width:0;…max-width:max-content}), but it grows ahead of the pinned row (flex:100 1 auto).
    • What users see:
      • In crews-notice-pins-1100.png, the bar reads "registry…", then about 100px of empty space, then "Ask the agent". The pinned crews have shrunk down to a lone divider.
      • At 900px and 768px (crews-failing.png) the message is just "r." or "r".
    • So the bar keeps a meaningless fragment and blank space, and drops the crews the user pinned.
    • Severity: moderate. It shows on every view while the crews list is failing, at common laptop widths.
    • Fix: below a readable width, fold the message the way tbr-5 folds the metrics notice (warning icon plus hand-off). Also stop the notice from claiming more width than its clamped text actually uses.
  • Feedback buttons become bare icons early. From actions step 2, Request a Feature and Report problem show only a lightbulb and a bug (tbr-2 … .tb-drop-feedback-label{display:none}). In sweep-en-nightly.png that happens from about 1288px down to 970px, which covers common laptop widths.
    • Neither glyph is a universal icon. Their meaning now depends on hover tips (report-problem-tip.png), and the two look alike at 13px.
    • Severity: moderate. It applies all day at those widths, and the cost is guessing rather than failing.
    • Fix: fold the credits counter (step 3) before the feedback labels, or keep the "Report problem" label until the whole pill goes.

Suggestions

  • MetricsErrorNotice at tbr-5: the hand-off folds to a lone sparkle icon (metrics-failed.png, 768px). Keep the visible "Ask the agent" label, or drop the hand-off and leave only the warning icon.

[UX-REVIEWED] d64b162

Description read

[DESCRIPTION-READ] f41deba2472f814781c77395e561f1f2068e95fd189646ff66d363d75df18559

That sha256 names everything this verdict read: the PR description, plus the 15 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed d64b16203ffeacb4f2e376666b320028e89dcb60 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d64b162

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🟡 CONCERNS

Premise-level review of d64b16203ffeacb4f2e376666b320028e89dcb60 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The measured ladder fixes the cause, but the desktop now runs two ladders kept in step by a hand-copied selector map, and a new feedback-label step rides along with no named harm.

Not justified as shipped

  • Item 4 — rides along: "plus one new step that turns the feedback labels into icons before the pill goes" names no failing user. The measured ladder already stops the clipping without it, and step 2 brings its own tip, aria-label and aria-describedby changes (item 5).
    Subtraction: delete tbr-2/.tb-drop-feedback-label, the second useInstantTip, and the aria-label it needed; TOPBAR_LEVELS.right becomes 5.
    Clears when: the step is removed, or the description names who failed without it.
  • Item 10 — oversized: TOPBAR_CONTAINER_FOLDS re-states 5 CSS rung selectors from index.css:2127-2167, and containerFolded() is its only consumer. It exists only so the measured ladder never drops below rungs that measuring already covers on desktop.
    Subtraction: limit the container rungs to the phone form (max-width:767px), then delete TOPBAR_CONTAINER_FOLDS, containerFolded and the floor loop.
    Clears when: the map and floor are removed, or a maintainer amends ## Not a goal.

What this change ships

Inventory (10 items) — 7 justified

Intent: keep every desktop top-bar item, and above all the connection dot, on screen at every width on prerelease builds. FIX.

  1. Desktop bar folds items by measuring overflow instead of clipping — justified
  2. An actions group that still overflows clips the bell first, not the leading edge — justified
  3. Update pill label hides at the last desktop step — justified
  4. New step: feedback labels become icons before the pill hides — rides along
  5. Report problem: native title replaced by a styled tip; Request a Feature gets an aria-label — rides along, exists only for item 4
  6. Metrics failure moves into an ErrorNotice with the agent hand-off — justified
  7. Metrics failure no longer blinks on each refetch — justified
  8. Pinned crews and the crews error notice give way first; the message truncates with a tooltip — justified
  9. Metrics cards close when the ladder level changes — justified
  10. Desktop runs both container rungs and a measured ladder, kept in step by a mirrored selector map — oversized: one consumer, duplicates the CSS rungs

[FIRST-PRINCIPLES-REVIEWED] d64b162

Description read

[DESCRIPTION-READ] 2cbed1f3b8ed11d7098ef9a4b41bfa5ddf12b060cb31c179a98c3e434ac9f9e6

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=f1fedcf2ee37 — needs-a-decision: the two reversals of 626f147

Outcome: needs-a-decision. This PR reverses two points 626f147 settled: on desktop the collapse trigger measures the row again (website/src/lib/useTopbarCollapse.ts), and the search may leave the centre once the metrics numbers and feedback labels have collapsed.
Why measurement: whether the row fits depends on the search cell, a sibling of the side groups; a container query can only measure an ancestor, so no CSS-only trigger can express it.
Why the old premise fails: the committed sweep shows the three-track layout clipping the connection dot on English nightly builds in bands from 1638px to 970px, and every extra item (prerelease chip, update pill, locale, extension) needs its own measured threshold shift.
Question for a maintainer: do you accept (1) measuring the row instead of per-group thresholds and (2) a search that slides off centre when the bar is crowded? If not, the fallback keeps both decisions: a widest-locale width budget for the chip, like the update pill's.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=cc3a81c60bdf — needs-a-decision: inventory item 2 (row measurement, search leaving centre)

Outcome: needs-a-decision. Item 2 is the one reversal in the inventory; the other seven are marked justified.
It is load-bearing, not riding along: keeping the search centred AND sizing the side tracks by content is what lets an unplanned extra collapse something instead of clipping the dot, and the flow track sizing is what makes the search move.
This is a fork PR, so the override path is not open to its author: a maintainer can push the branch to this repository and post the override, or land the decision on the base branch first.
Question for a maintainer: do you accept the row measurement and an off-centre search when crowded? If not, I will replace this approach with a widest-locale width budget for the prerelease chip that keeps both 626f147 decisions.

@peterhieuvu
peterhieuvu force-pushed the fix/topbar-flow-layout branch from 2b161de to 04a5e50 Compare October 1, 2026 11:01
@peterhieuvu

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • span=1461f955f94d — fixed in 04a5e50: the metrics-error button is no longer edited

Outcome: fixed. The diff no longer touches the grandfathered sysMetricsError button in website/src/App.tsx: it is byte-identical to the base line, so errors-use-error-notice has no edited site to migrate.
The earlier edit only made its words collapse with the metrics numbers. Dropping it keeps the band invariant (the button renders the same contents at every level), and the words stay readable when the bar is crowded.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=31b1b11440bc — fixed in 04a5e50: the collapsed-band metrics error is text again

Outcome: fixed. The "Metrics unavailable" words no longer carry tb-drop-metrics, so no collapse level hides them: the failure reads as words beside the red waveform at every width, not as colour alone.
Evidence added to the description for this lane's gaps: temp-screenshots/topbar-flow/levels.png (every level 0-9, including the floor), crews-failing.png (the crews error notice truncating) and resize.webm (a live resize plus the update pill mounting and unmounting at a still width).

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=c22909c6d91b — fixed in 04a5e50, plus a Firefox run

Outcome: fixed. A laid-out header whose resolved grid-template-columns cannot be read now settles on the floor level, whose minmax(0,1fr) sides clip each group's tail, instead of staying at level 0 and overflowing (topbarFits; a new test fails without the change).
Firefox 153: the capture sweep passes in all 24 states, 1920 to 768px in 4px steps.
Safari: unverified. WebKit cannot start on the Linux host used (it lacks the GTK 4, Vulkan and ICU 74 libraries), which the description states; the floor fallback covers an engine that does not resolve the tracks to px.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=cfaf0b592e70 — adopted in 04a5e50

Outcome: fixed. On a parse failure with a laid-out header, topbarFits returns true only at TOPBAR_MAX_LEVEL, so the climb stops on the floor; clientWidth === 0 still keeps level 0, as the no-layout case needs.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed d64b16203ffeacb4f2e376666b320028e89dcb60 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d64b162

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=80f8f1902598 — needs-a-decision: the desktop top bar's collapse model

Outcome: needs-a-decision. No base RFC covers the top bar, so a maintainer has to rule on the shape this PR proposes before it can merge.
Question for a maintainer: do you accept (1) measuring the row (useTopbarCollapse.ts) instead of per-group container thresholds, and (2) a search that slides off centre once the metrics numbers and feedback labels have collapsed?
If yes: this is a fork PR, so this lane clears when the branch is pushed to this repository and /ai-review override first-principles <head>: <decision> is recorded. The ruling can get a docs/decisions/ record in the same change.
If no: the fallback is the subtraction under span=b52491c9df1d, a prerelease-chip rung set beside tb-has-update, with the flow layout taken to an RFC.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=62a702bb3e8e — needs-a-decision: items 2-3, the sliding search and row measurement

Outcome: needs-a-decision. These are the two points span=80f8f1902598 puts to a maintainer; nothing here changes before that ruling.
Why item 3 measures: whether the row fits depends on the search cell, a sibling of the side groups, and a container query can only measure an ancestor.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=b52491c9df1d — needs-a-decision: the flow layout or the shifted-rung subtraction

Outcome: needs-a-decision. The subtraction fixes the harm this PR names: a prerelease-chip rung set beside tb-has-update stops the dot clipping on nightly builds, with no measurement and the search always centred.
What it leaves: each extra needs its own threshold shift sized for the widest locale, and extras combine (update pill plus chip is a third rung set). Extras no rung can hide (the open Windows menu, extension segments and widgets, the crews-list error) get no rung set; where they sit in the actions group, its clip starts at the dot.
Question for a maintainer: ship the flow layout here (the ruling on span=80f8f1902598), or ship the shifted-rung fix now and take the flow layout to an RFC?

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=b24ecb731025 — needs-a-decision: row measurement and the sliding search

Outcome: needs-a-decision, put to a maintainer on the First Principles span=80f8f1902598: accept row measurement and a search that can leave the centre, or keep both 626f147 decisions and fix the prerelease chip with a rung set beside tb-has-update.
If accepted, the ruling gets a record under docs/decisions/ in this PR.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=5c5d7bc97b33 — needs-a-decision: when the inert desktop container rungs go

Outcome: needs-a-decision. Deleting the desktop container rungs and their budget tests depends on span=b24ecb731025: if the flow layout is accepted they are dead on desktop, and if it is not they stay.
Question for a maintainer: delete them in this PR (larger diff, one ladder at merge) or in a follow-up PR straight after it (smaller diff to review here)?

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=8ba68536bdab — needs-a-decision: the search leaving the centre line

Outcome: needs-a-decision, put to a maintainer on the First Principles span=80f8f1902598.
The trade: the search stays centred until the metrics numbers and feedback labels have collapsed, then slides (up to ~159px with three pinned crews and an update pending on nightly) before anything else hides. The alternative keeps it centred and fixes the prerelease chip with a rung set beside tb-has-update.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=b717be41b640 — rebutted: the sweep passes under Playwright WebKit

Outcome: rebutted. The clearing run is done: website/scripts/capture-topbar-flow.mjs at this head, with only its import switched to webkit, ran in mcr.microsoft.com/playwright:v1.58.2-noble (WebKit 26.0) at STEP=4 over all 24 states, 1920 to 768px.
Result: exit 0, "flow layout holds across 24 states", 0 failures. WebKit took the normal path with its own track readings, and every assertion held: dot on screen, no group clipping or overlapping the search, the 240px search floor, pinned crews never moving the ladder, the same level on revisiting a width.
Not covered: Safari releases older than WebKit 26.0.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 1, 2026
@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=1fd4f4fe7ebe -- rebutted: dropping the hand-off glyph at the last step

Outcome: rebutted. At tbr-5 the metrics button is folded with the capsule, so the notice is the failure's only visible trace; its hand-off button keeps its name and title, and the sr-only message keeps the alert readable to assistive tech.
Letting the warning glyph open the card means a second click target for the same card in the same group; the card's own hand-off is the same AskAgentButton, so a user who reaches it sees the same glyph there.
A styled tip on the glyph is a change to the shared AskAgentButton, used by over 200 error surfaces, which is outside this PR.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=20f4cc498da6 -- rebutted: folding the metrics notice before the feedback pill

Outcome: rebutted. Folding the notice at tbr-4 instead of tbr-5 shows the bare two-glyph form (item 1fd4f4fe7ebe) across every mid width while metrics fail, to keep a feedback pill the ladder folds a step later anyway.
The notice reports a failed state, which errors-use-error-notice requires to render through ErrorNotice with its hand-off; the feedback pill's icon form keeps both of its actions reachable at that step.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=789cf5a50014 -- rebutted: sentence case for the metrics failure string

Outcome: rebutted (out of scope). app.metrics_unavailable is main's existing catalog value, shown in the same bar today, with translations in every shipped locale; this PR moves where it renders and does not edit catalog values.

On prerelease builds the "Report problem" chip widened the right group past
the widths its container-query rungs were measured against, so the readout
capsule clipped from the left, connection dot first.

The desktop header keeps its three tracks and its container rungs, so the
search stays centred, and adds a measured backstop (`.topbar.tb-measured`):
useTopbarCollapse reads each group's contents through a display:contents
wrapper and folds more, per group and in the phone ladder's order, wherever
the container rungs still leave the group overflowing. Its level never sits
below the last step the container rungs have folded, so both fold in one
order. Pinned crews still give way before anything collapses. Phones are
unchanged.
@peterhieuvu
peterhieuvu force-pushed the fix/topbar-flow-layout branch from 9e69502 to d64b162 Compare October 6, 2026 09:49
@peterhieuvu

Copy link
Copy Markdown
Contributor Author

Round 13 (d64b162): rebased onto cc7e798, which carries #17309, main's fix for the test_source_pin_budget failure that reddened the backend shards on every PR since #15301. This PR shares no file with the commits since 5edf2fe.

One addition, for the Design item on the hook's selector map being tested one way only: useTopbarCollapse.test.ts now also checks the reverse direction, that every item a @container rung hides has an entry in TOPBAR_CONTAINER_FOLDS, under the side the rung scopes it to. Removing an entry fails it. Nothing else changed.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=8ef8268e7269 -- needs-a-decision: measured collapse as a backstop to the container rungs

Outcome: needs-a-decision. Maintainers: may the measured ladder (useTopbarCollapse) run beside the container rungs 626f147 introduced, as their backstop, with its level never below their last fold? A PR comment citing 626f147 records it; measured-only on desktop is the alternative this comment can also record.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=bcf6911dde4e -- rebutted: a re-settle cap for a widget that resizes with the level

Outcome: rebutted (disproportional here). The hazard needs a registered widget or segment that violates the contract both seams state; the stock build registers none, and a built-in that varied with the level is what App.metricsPopover.test.tsx pins against.
A container query carries the same hazard class on main: a widget whose contents respond to the group's @container state feeds the box it is measured against, and nothing caps that either.
A flip detector is a reasonable follow-up to the hook; it is not part of making the bar collapse instead of clip.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=1c309e941ee5 -- rebutted: the crews message giving way ahead of the pinned row

Outcome: rebutted. The notice takes room ahead of the pins so the failure stays readable while any room is spare (320px at 1920px, 226px at 1100px with the pins in the dropdown); the pins are never lost, the dropdown lists them by name.
Hiding the message below a readable width needs a size query on the notice, which drops its contents from the identity group's measured width and clips the hand-off (the round-6 defect); a fixed minimum folds Back/Forward and the crew names earlier to keep a few letters on screen.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=9e7d6da3fc08 -- rebutted: part of the crews-message item (see 1c309e941ee5)

Outcome: rebutted. The clamped message ends at a word boundary because main's line-clamp-1 breaks between words (InstanceTabBar.test.tsx pins "prose not cut mid-word"), and inlineNoticeTruncate.test.ts forbids the mid-word cut that would close the blank; the full message is the tooltip, and the warning icon and hand-off stay whole at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=78674fe27bee -- rebutted: part of the crews-message item (see 1c309e941ee5)

Outcome: rebutted. The clamped message ends at a word boundary because main's line-clamp-1 breaks between words (InstanceTabBar.test.tsx pins "prose not cut mid-word"), and inlineNoticeTruncate.test.ts forbids the mid-word cut that would close the blank; the full message is the tooltip, and the warning icon and hand-off stay whole at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=fe990bd254ae -- rebutted: part of the crews-message item (see 1c309e941ee5)

Outcome: rebutted. The clamped message ends at a word boundary because main's line-clamp-1 breaks between words (InstanceTabBar.test.tsx pins "prose not cut mid-word"), and inlineNoticeTruncate.test.ts forbids the mid-word cut that would close the blank; the full message is the tooltip, and the warning icon and hand-off stay whole at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=cc4e888a6ae8 -- rebutted: part of the crews-message item (see 1c309e941ee5)

Outcome: rebutted. The clamped message ends at a word boundary because main's line-clamp-1 breaks between words (InstanceTabBar.test.tsx pins "prose not cut mid-word"), and inlineNoticeTruncate.test.ts forbids the mid-word cut that would close the blank; the full message is the tooltip, and the warning icon and hand-off stay whole at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=5e63b9c65f96 -- rebutted: part of the crews-message item (see 1c309e941ee5)

Outcome: rebutted. The clamped message ends at a word boundary because main's line-clamp-1 breaks between words (InstanceTabBar.test.tsx pins "prose not cut mid-word"), and inlineNoticeTruncate.test.ts forbids the mid-word cut that would close the blank; the full message is the tooltip, and the warning icon and hand-off stay whole at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=cb954aad47a0 -- rebutted: folding the crews message like the metrics notice

Outcome: rebutted. The metrics notice folds through a header class at a measured step; the crews message's room is a property of the identity group's flex layout, so a fold keyed to its own width needs a size container on the notice, which removes its contents from the measured width and clips the hand-off (the round-6 defect).
The notice claims no width beyond its clamped text: the message box is the room the group has for it, and the clamp leaves that room blank rather than cut a word.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=45795fbe1037 -- needs-a-decision: fold the credits counter before the feedback labels

Outcome: needs-a-decision. Peter (the author's owner) decides the order: today the labels fold at step 2 and the credits counter at step 3, so a live number stays on screen while two label words become icons with tips; swapping them keeps the labels longer at the cost of the number. First Principles asks for the labels step to go entirely (item a85b1872fc68), which this question also covers.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=19c69b28de81 -- needs-a-decision: part of the feedback-icons item (see 45795fbe1037)

Outcome: needs-a-decision. Whether the credits counter folds before the feedback labels is the order question put to Peter under 45795fbe1037; both icons keep an accessible name and a styled tip on hover and keyboard focus at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=8124eff7151e -- needs-a-decision: part of the feedback-icons item (see 45795fbe1037)

Outcome: needs-a-decision. Whether the credits counter folds before the feedback labels is the order question put to Peter under 45795fbe1037; both icons keep an accessible name and a styled tip on hover and keyboard focus at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=a870d6c096ac -- needs-a-decision: part of the feedback-icons item (see 45795fbe1037)

Outcome: needs-a-decision. Whether the credits counter folds before the feedback labels is the order question put to Peter under 45795fbe1037; both icons keep an accessible name and a styled tip on hover and keyboard focus at every width.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=4121fb93d526 -- rebutted: the hand-off glyph at the last step

Outcome: rebutted. At tbr-5 the metrics button is folded with the capsule, so the notice is the failure's only visible trace; dropping the hand-off there leaves an alarm with no action, and keeping the label costs the room the step exists to free. The button keeps its name and title, and the sr-only message keeps the alert readable.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=a85b1872fc68 -- needs-a-decision: the feedback-labels step

Outcome: needs-a-decision. Without the step, the pill goes from two labelled actions to hidden in one fold: on an English nightly build between 1288px and 970px the ladder would fold the credits counter instead to make room for the chip. The step keeps the live number on screen there and both actions reachable as named icons with tips. UX (45795fbe1037) prefers the credits folded first; whether the step stays, moves after the credits, or goes is put to Peter with that item.

@peterhieuvu

Copy link
Copy Markdown
Contributor Author
  • span=bb135a4df3df -- rebutted: the container-fold floor is a measured fix, not duplication

Outcome: rebutted. The floor fixes a defect the UX lane measured on round 10: with the update pill, the container rung folded the credits at 1600px, the measured level dropped back, and the feedback labels reappeared while the window narrowed (1648 icons, 1600 labels, 1486 icons). With the floor the folds are monotone (harness sweep and real dashboard, 1920 to 768px).
Limiting the container rungs to phones is the design the maintainer ruling rejected for this PR: the search must stay anchored and main's thresholds keep their timing; the measured ladder only folds more. The map is pinned in both directions by tests, so a rung cannot drift from it silently.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Reviewed, not approving (crew-pr-reviewer). This is a large (+1987/-172) layout change to the desktop top bar. It needs a maintainer's or design review with screenshots.

@CrysisDeu
CrysisDeu merged commit 97a955f into kirodotdev:main Oct 6, 2026
104 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command Bar overlaps system metrics at laptop widths

4 participants