Repository navigation
Draw each site's server dot before its name in the sites list - #652
Merged
Merged
Conversation
The prototype draws the server's dot at the left of every site name in the sidebar, so which site is running can be seen without opening each. The app had the dot only in the open site's header, because a server lives in its site's view and the list knew nothing of it. Each site's view now reports its server's state to the window as it changes, and takes the report back when the view goes; the window hands the reports to sitesListRows by path, and every row carries a `server` the list draws with the header's own ProcessStatus: grey until the view has said otherwise, green running, amber starting, red for a server that went by itself or could not start. The dot's words are said after the name, as the attention dot's are, and only when the dot is not the grey every site starts with. The attention dot (#94) stays, after it. The journeys that click a running site's entry now name it with its dot's words, and the dev-server journey reads the list's dot at each turn. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Measured in the app, each dot's ink was centred on the 24px line box, 1.5px above the centre of the lowercase letters beside it. The name span is no longer a flex box: it is one nowrap line, cut with an ellipsis as the text span was, and the dots are inline boxes with `vertical-align: middle`, which centres a box on the parent's x-height whatever the font. Re-measured, the dot's centre and the letters' centre now share a pixel. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The same offset as in the sites list: a flex item of the menu's button, the dot sat 1.5px above the lowercase letters beside it. The dot and the words are now one inline line inside the button, and the dot an inline box with `vertical-align: middle`. Re-measured, the two centres are half a pixel apart. The words still give way to the dot alone when the header is short of room. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… header Two findings of the pre-PR review. The words a view reports of its server, and what a report does to the window's reports by path, were decided inline in index.jsx, where the suite cannot reach them; they are serverReport and withServerReport in sites-list.cjs now, with tests. And the space between a process's dot and its words was the dot's margin, which stayed when the words gave way to the dot in a short header and doubled the gap before the chevron; it is the words' own margin now, and goes with them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The prototype draws each site's server dot at the left of its name in the sites list, so which sites are running can be seen without opening each. The app had the dot only in the open site's header: a contributor with three sites had to open each one to learn which server was up. The dot also sat 1.5px above the lowercase letters beside it, in the header as in the list.
What changes
Every entry in the sites list now wears the header's own dot before its name: grey while the server is stopped, green running, amber starting, red for a server that went by itself or could not start, with the reason as the dot's tooltip. The attention dot for a stale or half-updated site (#94) stays, drawn after it.
A server lives in its site's view, open or not, so the view is the one thing that knows. Each
SiteRowreports its server's state to the window as it changes and takes the report back when it unmounts; the window keeps the reports by path and hands them tositesListRows. What a report says, what it does to the reports and what the dot shows are all decided insrc/renderer/sites-list.cjs, where the suite can reach them.For a screen reader the dot's words follow the name, as the attention dot's do, and only when the dot is not the grey every site starts with: said after every name, "Server stopped" would be the thing heard most and needed least. So an entry is named
my-sitewhile stopped andmy-site (Server running)while running.Both dots, and the header's, are now centred on the text's x-height with
vertical-align: middle, which centres an inline box on the parent font's x-height by definition and so holds on Windows with a different font. A flex item, which the dots were, is centred on the line box instead, 1.5px higher.Deliberately not in it: a dot for the build watch in the list, and any control on the list's dot. The dot reports; the header and the details act.
How to test this
Platforms: any. The x-height alignment is worth a look on Windows too, where the font differs: the rule is font-agnostic, but only a look confirms it.
The first journey in
tests/e2e/journeys/dev-server.spec.jswalks the reported path and reads the list's dot at each turn: starting, running, stopped and crashed, with the entry's name. It is red without the change. From the repository root:npx playwright test --project=journeys tests/e2e/journeys/dev-server.spec.jsWhat the journey cannot reach is a real server, since journeys stub the handler that starts one, and what the dots look like beside real text:
Starting state: two sites, both set up, neither server running. The Buildkite artifact for the head commit, on macOS or Windows.
What must not have happened: no site's entry has lost its name or project line; a long name still ends in an ellipsis; the attention dot of a stale site is still there, after the server dot; nothing else in the header moved.
Risks and limitations
6229fb6.Related
Follow-up to #590 (the sites list) and #595 (the server and the watch in the header).
Design decisions and alternatives considered
vertical-align: middleover a pixel offset. The dot was measured 1.5px high against the ink of the letters, in a screenshot of the running app. Amargin-topwould have fixed that for this font and this size;vertical-align: middleis the CSS definition of "centred on the x-height", so it follows the font.Review outcome (required — see AGENTS.md)
2 [fix here] · 0 [follow-up] — both fixed.
🟡 Architecture,
[fix here]: the words a view reports of its server, and what a report does to the window's reports, were decided inline inindex.jsx, where the suite cannot reach them. Fixed:serverReportandwithServerReportinsrc/renderer/sites-list.cjs, with unit tests.🔵 Layout,
[fix here]: the space between a process's dot and its words was the dot's margin, which stayed when the words gave way to the dot in a short header and doubled the gap before the chevron. Fixed: the margin is the words' own and goes with them.Review: completed — a separate agent context running
.github/instructions/code-review.instructions.md; reviewed headaad1b72/ base0cd70e4(origin/trunk);npm test2047 pass,eslint src tests scriptsand Stylelint clean (a repo-wideeslint .fails only on stale checkouts under.claude/worktrees, which are not part of the branch); outcome above.Since review:
aad1b72 → 6229fb6checked; the one commit applies the two findings and nothing else.npm test2049 pass, lint clean, and the dev-server, site-header, auto-start and logs journeys pass on the new head.CodeRabbit: not yet requested.
Implementation notes
src/renderer/sites-list.cjs:serverDot(what the row draws; unknown or missing reports are offline),serverReport(what a view reports fromserverProcess),withServerReport(the reducer).sitesListRowstakesserversby path.src/renderer/index.jsx:serverReportsstate and theonServerStatuscallback inApp; the reporting effect inSiteRow.src/renderer/components/sites-sidebar.jsx: drawsProcessStatusbefore the name and the hidden words after it.ProcessStatusinsite-header-actions.jsxgained an optionaltitle.src/renderer/shell.css: the name span is one nowrap line with the ellipsis, the dots inline boxes; the header's dot and words are one inline span inside the button.dev-server.spec.jsreads the list's dot at each state;logs.spec.jsandauto-start.spec.jsname a running site's entry with its dot's words, since the accessible name carries them.Screenshots or recording
The list before the alignment fix (dots centred on the line box) and after (dots on the x-height), and the header's menu, are to be attached from the measuring run;
ghcannot upload images, so they go in from the web UI.🤖 Generated with Claude Code