Skip to content

Workbench small improvements #305

Closed
Closed

Description

@nockawa

wb-dev.ps1 — Fix Ctrl+C terminal corruption

Start-Process -NoNewWindow attached Kestrel and Vite child processes to the terminal's console process group. When Ctrl+C was pressed, CTRL_C_EVENT was broadcast to the entire group, hitting npm/node which enables VT terminal processing but never restores the original console mode on forced kill — leaving the terminal in a broken state (no input accepted).

Fix: Launch via cmd.exe /c with -WindowStyle Hidden so children get their own hidden console session, fully detached from the terminal's process group. Added try/finally in Invoke-Start so pressing Ctrl+C during the 30 s startup wait still kills the child processes (they no longer receive the signal themselves).

CLAUDE.md — Document .NET 10 single-file script execution

Added a "Quick POC / single-file scripts (.NET 10)" section covering:

  • dotnet run file.cs — no .csproj required
  • Directives: #:package, #:sdk, #:property, #:project
  • Ready-to-use Typhon skeleton that pulls in Typhon.Engine.csproj directly via #:project
  • dotnet project convert for graduating a POC to a proper project

.gitignore — Add scratch/

Added scratch/ as the designated gitignored location for throwaway .cs POC scripts.

Activity

  1. self-assigned this
    on May 5, 2026
  2. added
    documentation
    on May 5, 2026
  3. moved this to Backlog in Typhon devon May 5, 2026
  4. moved this from Backlog to In Progress in Typhon devon May 5, 2026
  5. nockawa commented on May 5, 2026

    @nockawa
    CollaboratorAuthor

    Workbench UI — dockview v6, toggle-view commands, camel-hump palette, theme fix

    dockview v5 → v6 + Edge Groups

    • Upgraded dockview-react from 5.2.0 to 6.0.1.
    • ResourceTree (left), Detail (right), Logs + Top Spans (bottom) now live in native edge groups — always present, collapse/expand instead of add/remove.
    • Structural panels (ResourceTree, Detail, Logs, Top Spans, Profiler) are non-closable via a LockedTab custom tab component (DockviewDefaultTab with hideClose).
    • Layout store key bumped to v3 to discard incompatible v5 serialised layouts.
    • Deleted useTreeVisibilityStore — visibility is now driven by api.getEdgeGroup('left')?.collapse()/expand().

    Toggle View Commands

    • All palette commands renamed from Open X Panel to Toggle View X (e.g. Toggle View Resource Tree, Toggle View Logs).
    • Structural panels: toggle collapses/expands the edge group; expands and focuses if already collapsed.
    • Bottom edge group (Logs / Top Spans): smart toggle — if the panel is already active, collapses the group; otherwise focuses the panel without collapsing.
    • Dynamic panels (Component Browser, Archetype Browser, Schema Inspector, etc.): toggle closes if open, reopens via addPanel if closed.

    CamelCase Hump Filter for Command Palette

    • New camelHumpFilter.ts module: humpFilter (cmdk filter prop) + matchHighlight (character positions for highlighting).
    • Typing TVRT filters to Toggle View Resource Tree; tvrt works too (case-insensitive).
    • Matched word-initial characters highlighted in amber in the palette list.
    • Scores: hump match = 1.0, label substring = 0.8, keyword substring = 0.5, no match = 0.
    • 18 unit tests (Vitest).

    Theme-Reactive Dockview Chrome

    • Fixed cascade bug: @tailwindcss/vite was injecting globals.css before dockview.css, letting dockview's hardcoded #1e1e1e/white values win. Fixed by bumping override selector specificity to html .dockview-* (0-1-1 vs dockview's 0-1-0).
    • Switched to the dockview v6 theme prop (themeDark / themeLight objects) instead of a raw className string.
    • Tab bar height reduced to 22 px (was 35 px default / 28 px prior override).
  6. nockawa commented on May 6, 2026

    @nockawa
    CollaboratorAuthor

    Dynamic track height – viewport-aware chunk row fix

    Two bugs addressed in this session:

    1. Phantom extra row from +2 padding (timeAreaLayout.ts line 126)
    spanRegionHeight had a +2 px constant that made a single-depth slot (maxDepth=0) render 14px instead of 12px, which could visually imply a second row. Removed; each depth level is now exactly SPAN_ROW_HEIGHT (12px).

    2. Persistent two-row layout when only span bars are visible (no chunks in viewport)
    The chunk row height (chunkRowHeight = 12px) was allocated based on the session-wide slotsWithChunks set — if a slot ever emitted a chunk, the row was always reserved regardless of whether any chunk bars were actually visible in the current viewport window. For a worker slot showing only a BetweenTick span (depth 0) with no chunks in view, this gave 12 (empty chunk row) + 12 (span row) = 24px = 2 rows.

    Fix: extended the existing committed-depth grow/shrink pattern to also cover chunk row allocation:

    • Added deriveVisibleChunkSlots(ticks, viewRange) — scans all ticks for chunks intersecting the viewport, returns the set of slots that actually have visible bars.
    • Added committedChunkSlotsRef (mirrors committedDepthRef for spans): grows immediately (before paint) when a chunk enters the viewport, shrinks after 300ms when it leaves.
    • buildLayout now accepts committedChunkSlots?: Set<number> and uses it instead of session-wide slotsWithChunks when provided, so the chunk row is only allocated when a bar is actually rendered.

    Result: a slot with only BetweenTick spans visible now renders exactly as many rows as its visible span depth — no phantom empty chunk row above the spans.

  7. nockawa commented on May 6, 2026

    @nockawa
    CollaboratorAuthor

    Full change set for this branch

    Dynamic track height (TimeArea.tsx + timeAreaLayout.ts)
    Tracks now size to the deepest span visible in the current viewport rather than the session-wide maximum. Persisted setting (dynamicTrackHeight, default on). Three stability strategies layered on top:

    • Strategy 1 — scroll-anchor compensation (useLayoutEffect): finds the track straddling scrollY in the previous layout, adjusts scrollY by the delta so the same visual row stays pinned to the same screen position.
    • Strategy 2 — grow immediately / shrink after 300 ms: heights expand before the next paint (no flash); a debounced timer collapses them only after the viewport settles, so heights never jitter while panning.
    • Strategy 4 — smooth lerp animation (factor 0.15 per rAF frame): animTrackHeightsRef interpolates toward committed targets each frame; scrollPhantomRef updated imperatively so the scrollbar tracks correctly without triggering React re-renders.

    Chunk row allocation is also viewport-aware (committedChunkSlotsRef / deriveVisibleChunkSlots): the chunk row is only reserved for slots that have a bar actually visible in the viewport. Without this, a slot showing only a BetweenTick span had an empty 12 px chunk row allocated above it, making it appear as two rows even when only one bar was visible.

    Chunk bar rendering parity (timeArea.ts)
    Chunk bars in slot lanes now render identically to span bars: SPAN_BAR_MARGIN / SPAN_BAR_HEIGHT geometry, 12 px monospace font, duration label appended to the name, > 10 px label threshold.

    Two-pass span draw (timeArea.ts)
    drawSlotLane and drawMiniRowBars now use a two-pass approach: non-visible ticks first (background, native spans only — cross-tick ops excluded), visible ticks second (foreground, all spans). Fixes z-order: long-running cross-tick bars (Checkpoint.Cycle etc., stored in the tick where they complete) were overwriting viewport-native spans rendered from an earlier tick.

    Wall-clock chunk stats fix (selectionStats.ts)
    computeSelectionStats was summing individual chunk durations per system, inflating parallel systems by N× (4 threads each running 660 µs → reported 2640 µs instead of 660 µs). Now tracks min(clipStart) → max(clipEnd) per system per tick, reporting the wall-clock execution window regardless of parallelism.

    ProfilerDetail refactor (ProfilerDetail.tsx)
    SpanSourceRow / ChunkSourceRow eliminated as separate components; source attribution (File / Method rows + action buttons) folded inline into the <dl> card. overflow-y-auto added to all detail containers. min-w-0 added to all flex-truncate elements (CSS requirement for truncation to work inside flex children). Header h3 gets min-w-0.

    TickOverview sticky selection (TickOverview.tsx)
    When the viewport pans into a gap between ticks, computeSelectionIdxRange returns {-1, -1}. Previously this cleared the yellow selection overlay immediately. Now the last valid selection is retained as a navigation anchor while panning through empty time.

    Build progress SSE cache invalidation (useProfilerBuildProgress.ts)
    On phase === 'done' from the SSE stream, immediately invalidates the ['profiler', 'metadata', sessionId] TanStack Query instead of waiting for the next 2 s polling interval. Noticeable on files with an existing cache where the build completes in < 200 ms.

    Misc

    • index.html: favicon SVG link added.
    • drawSystemLane: unused track parameter removed.
  8. added a commit that references this issue on May 6, 2026
  9. moved this from In Progress to Done in Typhon devon May 6, 2026
  10. added theissue type on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentation

Type

Fields

Priority

None yet

Estimate

None yet

Area

None yet

Start date

None yet

Target date

None yet

Bug status

None yet

Product

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions