Repository navigation
Host core: one format for revision labels, written and read in one place - #117
Merged
Merged
Conversation
agorischek
force-pushed
the
running-indicator
branch
from
November 20, 2026 23:45
cc2a54c to
ba07432
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 20, 2026 23:45
6942db1 to
8a04db6
Compare
agorischek
force-pushed
the
running-indicator
branch
from
November 20, 2026 23:50
ba07432 to
8e7977c
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 20, 2026 23:50
8a04db6 to
e74133c
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the centralized revision-label helpers and their UI integrations.
No open issues 🎉
What changed in this PR
Centralizes revision-label formatting and parsing in host core, giving built-in and custom UIs a shared way to display revision names, commit details, and ages.
Changes:
- Adds and exports shared formatting, parsing, short-name, and age helpers.
- Migrates the Inspector’s writer and UI readers to those helpers, retaining existing aliases.
- Documents the label format and adds tests for parsing, formatting, and age calculation.
| File | Description |
|---|---|
packages/host/vscode-ui/src/pickers.tsx |
Aliases shortRevisionLabel to the shared name helper. |
packages/host/inspector/src/app/revisions.ts |
Uses shared formatting and retains age as an alias. |
packages/host/core/test/revision-label.test.mjs |
Tests label round trips, parsing, and revision ages. |
packages/host/core/src/ui/pickers.tsx |
Uses the shared helper for compact revision names. |
packages/host/core/src/stage/labels.tsx |
Uses the shared parser for pane labels. |
packages/host/core/src/stage/chip-text.tsx |
Replaces local chip parsing with the shared parser. |
packages/host/core/src/revision-label.ts |
Defines revision-label types and shared helpers. |
packages/host/core/src/pair.ts |
Updates label documentation to reference the shared helpers. |
packages/host/core/src/index.ts |
Exports the revision-label helpers and type. |
docs/guides/host-core.md |
Documents the revision-label format and API. |
Review effort: Balanced
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 00:43
8e7977c to
70f36c3
Compare
agorischek
force-pushed
the
revision-labels
branch
2 times, most recently
from
November 21, 2026 01:08
00bcebb to
f438e6f
Compare
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 01:37
dc365b4 to
8309ff8
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 21, 2026 01:37
f438e6f to
3d089bb
Compare
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 15:19
8309ff8 to
a24fd47
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 21, 2026 15:19
3d089bb to
90b0ec8
Compare
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 16:08
a24fd47 to
1b42e21
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 21, 2026 16:08
90b0ec8 to
342d837
Compare
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 17:39
1b42e21 to
38fc8e9
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 21, 2026 17:39
342d837 to
21cc803
Compare
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 18:28
38fc8e9 to
80f5956
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 21, 2026 18:28
21cc803 to
52cbc8f
Compare
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 19:07
80f5956 to
c9de6b2
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 21, 2026 19:08
52cbc8f to
0fa5b05
Compare
The rule for when a running job's indicator shows (after 300 ms, then for at least 400 ms) lived in the VS Code UI, so the default UI's "Updating…" chip showed for every job, however short. The rule is now the core's: `runningIndicator` and its constants at `@githubnext/projections-host/running` (no React or DOM, for the VS Code extension host), and `useRunningIndicator`, which the default UI's chip and the VS Code UI's summary bar both use. The VS Code UI's `./running` entry re-exports it, so the extension is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The running indicator's minimum started while a loading pane kept the chip hidden, so a chip revealed as the renderer became ready could vanish at once. The latch now lives only while no pane is loading. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The Inspector wrote revision labels as `name · detail · when`, and four places read them back by splitting on ` · ` with their own rules: the default UI's and the VS Code UI's pair pickers (one trimmed, one didn't), the pane chips (with an age heuristic) and the pane label bands. The core now owns the format: `formatRevisionLabel`, `parseRevisionLabel`, `revisionLabelName` and `revisionAge` (the Inspector's `age`, moved). Every reader and the Inspector's writer use them; `shortRevisionLabel` and the Inspector's `age` keep their names. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
agorischek
force-pushed
the
running-indicator
branch
from
November 21, 2026 20:34
c9de6b2 to
c26262c
Compare
agorischek
force-pushed
the
revision-labels
branch
from
November 21, 2026 20:34
0fa5b05 to
7c43929
Compare
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.
Stacked on #116. This is item G8 of the headless-host plan ("structured revision labels"), in its smaller form: one documented format with one writer and one reader.
Why
A pair's labels (
ExtractionChoice.label, the view'sbeforeLabelandafterLabel) carry a revision's name, its commit subject and its age in one string,main · "Add auth" · 2 days ago. The Inspector wrote that string (app/revisions.ts). Four places read it back by splitting on' · ', each its own way:ui/pickers.tsxshortLabelvscode-ui/src/pickers.tsxshortRevisionLabelstage/chip-text.tsxchipPartsstage/labels.tsxRevisionTextA custom UI had to rediscover the format from the Inspector's source to draw the same chips.
What changed
packages/host/core/src/revision-label.ts, exported from the root:RevisionLabelParts {name, detail?, when?};formatRevisionLabel(parts);parseRevisionLabel(label)→{name, detail?, subject?, when?}. Any text is allname;subjectis the detail unquoted.revisionLabelName(label);revisionAge(date, now?), which is the Inspector'sage, moved.Every reader and the Inspector's writer use them.
shortRevisionLabel(VS Code UI) and the Inspector'sageremain as aliases. Labels render the same as before.Not here
A structured
ExtractionChoice(name,subjectanddatefields in place of the string) would touch the pair'ssubjectLabelsand every view's label props. It can follow once this one parser is the only place that reads the string.Docs and tests
docs/guides/host-core.mddescribes the format and the helpers.ExtractionChoice.label's doc points to them.packages/host/core/test/revision-label.test.mjscovers the format round trip, a subject containing the separator, named refs, plain text andrevisionAge. It has 2 tests.Run locally:
tools check --fast: pass.tscfor core and the VS Code UI: pass.