github bowenliang123/dsh-context v0.73.3

2 hours ago

Install / Update

Install the dsh-context plugin on DeepSeek Harness with released NPM package:

dsh plugin --profile web add dsh-context@latest

Update the dsh-context plugin:

dsh plugin --profile web update dsh-context@latest

What's New

This is a performance release. On long sessions the Context tab now mounts and interacts several times cheaper: first paint is ~86% faster, the open no longer produces a main-thread long task, hover sweeps and DNA mode stop stacking full-view work, and the mounted DOM shrinks to about a quarter (a fifth with DNA). Every figure, tooltip, ordering, search, filter and DNA hit-test still reads the full data model — only rendering is windowed, so no readout or data path changed.

The work follows the #165 investigation. The 10s freeze reported there traced to a live-wallpaper compositing interaction rather than the plugin's data path, but the report's measurements exposed the plugin-side cost this release removes: every Context open mounted the full DOM for the whole session. Thanks @jidekaixin2dian for the reproduction data and the follow-up measurements.

Performance

  • The Context tab renders only what is visible, and every readout still reads the full model (#167)

    Measured A/B on the same 987-step / 33-turn session (4.9 MB compressed log, same host and scripts; the baseline is a build of the released 2ee5c96, v0.73.2):

    Test site Before (v0.73.2) After Change
    Context-tab first paint 475–587 ms 83–84 ms −86%
    Open total (script window) 984–1128 ms 502–504 ms −49%…−55%
    Open long tasks 2 (max 295–408 ms) 0 removed
    DOM after open 15,949 3,913 −75.5%
    Trend bars in DOM 987 145 (windowed) −85%
    JS heap after open 61.6–67.6 MB 54.4–54.6 MB −12%…−19%
    Hover ×30 30 long tasks / 2,425 ms 0 / 0 ms removed
    Rapid window jumps ×20 0 LT / 987 bars 0 LT / 72 bars DOM −93%
    DNA first bar visible 1,513 ms 317 ms −79%
    DNA open long task max 1,259 ms max 164 ms −87%
    DNA whole-page DOM 21,647 4,045 −81%
    DNA browser-card DOM 13,698 2,496 −82%
    DNA flat rows 1,156 29 + spacers −97%
    DNA trend bars 987 38 −96%
    JS heap after 5 tab switches 80.22 MB 56.53 MB −29.5%
    Heap growth (open → 5 switches) +18.6 MB +1.9 MB −90%
    • Trend bars, File Activity rows, dense timing-strip segments and the DNA flat feed render only their visible window plus overscan, with spacer pads that reproduce the full scroll height exactly (including the container flex gap).
    • The browser card and the below-fold event/file row mount behind height-matched skeletons on an idle slice or when near the conversation viewport; stats file-pill jumps force the row in and reveal it.
    • DNA bands build lazily per rendered window for long total-mode logs, the DNA window is tightened, gradient stops are sampled (≤64 per bar) — and DNA+delta stays eager so its per-key churn bounds the axis exactly.
    • Pure derivations (assemble, DNA/file aggregation) are cached across hover renders and remounts; forced layout is removed from the flow/timing read paths; the hidden sidebar copy is gated, and the step-picker options and tool tallies are memoized.
    • Pointer hovers are isolated: the chart's own hover/tip stays instant, cross-card previews trail (140 ms; 220 ms in DNA mode) so a sweep cannot stack full-view renders.
    • Rendering-only by construction: axes, tooltips, ordering, DNA hit-testing and all totals still come from the full model, and Ctrl/Cmd-F-style searches, filters and selections still see the complete data.

Fixes

  • DNA strands line up across bars again (#168) — the rework's gradient-stop cap sampled each bar's runs into a fixed number of equal parts, which broke the chart's long-standing invariant that every DNA bar shares one px-per-token scale, so a persistent band landed at a different offset in each column. Internal band boundaries now quantize to one shared 2px grid (the final boundary stays exact, same-colour runs merge, sub-grid slivers are absorbed); the tooltip, highlight and hit-testing still read the untouched band model.
  • Copilot review follow-ups on the rendering rework (#169) — six confirmed findings, each verified against the source and covered by a regression test:
    • the /context modal now passes the active locale through, so memoized step labels re-translate while the dialog stays open;
    • the browser height-cap measurement and its ResizeObserver re-run after the hidden sidebar copy remounts;
    • DNA band hover reveal works for off-window rows again: feed rows carry data-lc-key, a key→index map scrolls the window into place, and the reveal runs after the commit;
    • File Activity only windows when every row measures the same height — wrapped long paths (95 rows at 41px and 48 at 29px on the 987-step session) made the fixed-pitch spacers too short; a mixed-height list now renders in full with a truthful 5,571px scroll height;
    • the chart tip re-clamps its width when a different DNA band changes the tooltip text;
    • a tiny DNA bar falls back to its top band's solid colour instead of emitting an empty gradient.

Changes

  • Cross-card hover previews and the chart's request-detail link trail the pointer by 140 ms (220 ms in DNA mode) by design; the chart's own bar highlight and tip stay immediate.
  • Folding the Sidebar unmounts the hidden Context copy (the source of the hidden-sidebar DOM cut): data and view-level state return on re-expand, but card-local UI state (open browser rows/search, file filters/expanded row, list scroll position) resets. The main-tab copy is unaffected.
  • Windowing stays off where it cannot be truthful: narrow cards and mixed-height row lists render in full.
  • Known limitation, deliberately deferred: adaptive mode plus the 2px DNA grid can retain very large gradients for off-window bars. The released implementation also kept every run, so this is pre-existing, not introduced here; resolving it means choosing between making DNA and adaptive mutually exclusive, scaling to the rendered window, or a coarse shared grid.
  • pnpm run check --full at this tag: lint clean, typecheck clean, 138 files at 100% per-file coverage, 2,493 tests green.

Commits

  • perf(context): cut context-tab render, hover and DNA costs (#167) (a694adf)
  • fix(context): keep DNA strands aligned across bars (#168) (c786c51)
  • fix(context): address Copilot review findings (#169) (92e50e9)
  • chore(release): 0.73.3 (a7ce215)

v0.73.2...v0.73.3 · 4 commits

Contributors

Don't miss a new dsh-context release

NewReleases is sending notifications on new releases.