Repository navigation
fix(health-bar): multi-instance switcher with Popover+Command - #131
Merged
Merged
Conversation
…bobox variant
bin/commands/start.mjs: Replace heartbeat(id) with register({...entry,
heartbeatAt}) in the interval so a lost registry row (concurrent write race,
ADR-004 §5) is automatically re-added within 30 s instead of staying gone
forever. Extract instanceEntry once; heartbeat ticks spread it.
bin/lib/registry.mjs: Add TODO on heartbeat() silent-skip-if-missing gap;
fix stale "Heartbeat reconciles" comment in deregister().
template/src/shared/ui/combobox: Add ghost variant — transparent chrome that
blends into the header bar. Change icon from ChevronDown to ChevronsUpDown
(no rotation on open; bidirectional icon fits a select control better).
Add ghost-sm + ghost-md entries to playground showcase (rule 24).
template/src/entities/instance/api/store.ts: Reduce instance poll interval
3 s (was 5 s) for faster new-instance detection in the switcher combobox.
template/src/widgets/health-bar/ui/HealthBar.svelte: Use ghost variant for
the instance switcher so it blends into the monospace header.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…isible instance switcher with empty state Ghost variant hover/open now uses color-mix(in srgb, var(--fg) 10%, transparent) instead of var(--bg-1), giving a theme-adaptive subtle overlay (works in both dark and light themes) with no visible border. HealthBar always renders the instance combobox; when only one instance is running the dropdown shows an empty state explaining what the switcher does and how to start a second instance. Refs: PRD-027
…the dropdown bits-ui Combobox requires ComboboxInput to be in the DOM to register with the listbox context — without it clicking the Trigger does nothing. In the no-other-instances branch we now always mount the input but collapse it (visibility:hidden + height:0) so it takes no space and is not exposed to AT. Refs: PRD-027
bits-ui Combobox anchors its floating Content to the ComboboxInput via
FloatingLayer.Anchor. When Input is inside the Content (our pattern),
the floating layer sees a circular reference and mis-positions the popup
(Y=-253, off-screen).
Fix: pass customAnchor={switcherEl} to ComboboxContent which forwards it
to ComboboxPrimitive.Content (via restProps → PopperLayer). This tells
bits-ui's floating-ui to use the .project-switcher div as the reference
element instead of the Input, giving correct below-trigger positioning.
With the anchor fixed, ComboboxInput is only rendered when hasOtherInstances
(needed for search); the empty state branch has no Input at all and shows
a plain explanation div instead.
Refs: PRD-027
Replaces bits-ui Combobox with Popover.Root+Portal+Command.Root so the floating layer correctly escapes the header's backdrop-filter stacking context. Previous implementation anchored to ComboboxInput (the FloatingLayer.Anchor inside the portal), causing off-screen positioning and rendering behind the graph toolbar. Key changes: - Popover.Portal ensures content renders at body level (z-index clean) - Command.Empty auto-shows empty state when no instances listed - Command.Item with keywords for search filtering - Ghost trigger button styled via scoped .project-switcher :global() selectors — hover uses color-mix(in srgb, var(--fg) 10%, transparent) for adaptive semi-transparent overlay across all themes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
ComboboxtoPopover.Root+Popover.Portal+Command.Root(shadcn-svelte pattern)Popover.Portalescapes the header'sbackdrop-filterstacking context, which was trapping the floating layer inside the headerComboboxInput(theFloatingLayer.Anchor), causing broken positioning when the input was hidden or absentcolor-mix(in srgb, var(--fg) 10%, transparent)— adapts to light/dark/orch themes without borderCommand.Emptyauto-renders the empty state when no instances are listed (no manual{:else}needed)Command.Itemwithkeywordsprop enables search by project name, host, and portghostcombobox variant with semi-transparent hover/open statesWhy
Instances were spawning on different ports but the switcher showed nothing — the registry registrations were silently lost in concurrent-write races, and the dropdown positioned off-screen at Y=-253 due to the circular floating anchor dependency.
Test plan
npx @forgeplan/web startin another project) — switcher shows both with search input🤖 Generated with Claude Code