Skip to content

Host core: one running indicator for every UI - #116

Merged
agorischek merged 2 commits into
mainfrom
running-indicator
Nov 21, 2026
Merged

agorischek merged 2 commits into
mainfrom
running-indicator

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

Stacked on #114. Part of item G7 of the headless-host plan ("stranded helpers").

Why

runningIndicator decides when a running job's indicator shows: after 300 ms, so short jobs never flash it, and then for at least 400 ms. It is framework-free and timer-injectable, but it lived in the VS Code UI (vscode-ui/src/running.ts). So the default UI's "Updating…" chip (#65) showed for every job, however short. A custom UI had to copy the latch or go without.

What changed

  • packages/host/core/src/running.ts (moved with git mv): runningIndicator, runningText, runningDelayMs, runningMinimumMs, Running and RunningTimers. It has no React or DOM, so it gets its own entry, @githubnext/projections-host/running, and the root re-exports it too.
  • useRunningIndicator(running) in the core root: the hook that was the VS Code summary bar's private useShownRunning.
  • The default UI's UpdatingChip shows the job only through useRunningIndicator, so it follows the same delay and minimum.
  • The VS Code UI's src/running.ts re-exports the core's. @githubnext/projections-host-vscode/running and the extension are unchanged.

Behaviour change

The default UI's "Updating…" now appears only after a job has run for 300 ms, and stays at least 400 ms, as the VS Code UI's spinner and status bar already did.

Docs and checks

  • docs/guides/host-core.md gains "Running jobs".
  • The VS Code UI README notes the re-export.
  • tools check --fast: pass.
  • tsc for core and the VS Code UI: pass.
  • node --test packages/integrations/vscode/test/status-bar.test.mjs: 11/11. It drives runningIndicator through the re-export.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The minimum-display timer runs while the chip is hidden during renderer loading, allowing it to appear only after completion and disappear before the visible minimum duration has elapsed.

1 open issue
What changed in this PR

Moves running-indicator timing into host core so default, VS Code, and custom UIs can share the same behavior while preserving the existing VS Code import path.

Changes:

  • Exposes the framework-free indicator through the core root and /running entry point.
  • Shares useRunningIndicator between the default updating chip and VS Code summary bar.
  • Documents the shared 300 ms delay and 400 ms minimum display time.
File Description
packages/​host/​vscode-ui/​src/​summary-bar.tsx Replaces the private hook with the core hook.
packages/​host/​vscode-ui/​src/​running.ts Re-exports core helpers for compatibility.
packages/​host/​vscode-ui/​README.md Documents the core re-export.
packages/​host/​core/​src/​use-running.ts Adds the shared React hook.
packages/​host/​core/​src/​ui/​updating-chip.tsx Applies shared timing to the updating chip.
packages/​host/​core/​src/​running.ts Houses the framework-free indicator and timer types.
packages/​host/​core/​src/​index.ts Exports the indicator helpers and hook.
packages/​host/​core/​package.json Adds the /running package entry point.
docs/​guides/​host-core.md Documents running-job APIs and timing.

Review effort: Balanced

@agorischek
agorischek force-pushed the comparison-session branch 2 times, most recently from 5e1c6d8 to c8b3d8b Compare November 21, 2026 01:37
@agorischek
agorischek force-pushed the running-indicator branch 2 times, most recently from 8309ff8 to a24fd47 Compare November 21, 2026 15:19
@agorischek
agorischek force-pushed the comparison-session branch 2 times, most recently from 23f6ab3 to 971f433 Compare November 21, 2026 17:39
@agorischek
agorischek force-pushed the running-indicator branch 2 times, most recently from 80f5956 to c9de6b2 Compare November 21, 2026 19:07
Base automatically changed from comparison-session to main November 21, 2026 20:28
agorischek and others added 2 commits November 21, 2026 12:34
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>
@agorischek
agorischek merged commit ab8cab2 into main Nov 21, 2026
48 checks passed
@agorischek
agorischek deleted the running-indicator branch November 21, 2026 21:12
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.

2 participants