Minimal Electron shell over the DSH JSON-RPC runtime — a first-look at what a ChatGPT.app-style host on top of the DeepSeek Harness looks like, with the harness's normally-invisible internals (trace timeline, context surface, subagent tree, compaction, plugin registry, rubrics) brought forward as first-class UI surfaces so plugin authors and researchers can see what the agent is actually doing. Runs against three keyless-to-live profiles (stdio-echo works on master out of the box; daemon-echo / daemon-vibe-echo activate once the daemon-demo lands; stdio-deepseek and daemon-vibe hit the real DeepSeek API when you supply a key). HARNESS_DEV auto-resolves to the in-repo runtime when this shell ships under examples/desktop/, so a fresh clone launches without config; env DSH_DEV_ROOT overrides for custom layouts, and a sibling deepseek-harness-dev/ checkout is the original dev workflow. Cold-clone gate (P0 fixes for first-time-clone usability): - HARNESS_DEV: 3-candidate resolver (env → walk-up in-repo marker → sibling), unit-tested via mock fs so ordering is locked without needing either real layout on disk. - config yml leaves rewritten at assemble time so the sibling-clone paths (../../deepseek-harness-dev/examples/echo-agent/…) become the in-repo paths (../../echo-agent/…) in the released tree — source yml stays usable for local dev, released tree ships a working shape. - pnpm-workspace.yaml allowBuilds.electron = true (was placeholder). - missing-key card in stdio-deepseek offers a one-click switch to stdio-echo (the keyless profile that works on master) rather than daemon-echo (blocked on the not-yet-shipped daemon-demo). - assemble-oss-release.sh rewrites the source-side breadcrumb name 'dsh-desktop-demo' → 'dsh-desktop' for the released package.json. FOUC guard on the onboarding gate (41fc5df carried) keeps the first-launch splash from flashing before the runtime probe finishes. Test suite (1634 tests in source, 3990 in the runtime repo) covers resolver ordering, renderer classifiers, trace timeline shape, compaction diff rendering, rubric parity, and the missing-key onboarding paths.
67 lines
2.7 KiB
JavaScript
67 lines
2.7 KiB
JavaScript
// task #164: guard against .stream flex-column collapsing non-scrolling
|
|
// children (approval / exit_plan_mode / steer cards) to ~16px. The fix in
|
|
// style.css relies on two rules:
|
|
// 1. `.stream { min-height: 0; ... }` — lets stream itself scroll instead
|
|
// of overflowing its column-flex parent (.pane / .main).
|
|
// 2. `.stream > * { flex-shrink: 0; }` — each direct child renders at its
|
|
// intrinsic height so interaction cards with fixed textarea+buttons do
|
|
// not get squashed when the total body is taller than the viewport.
|
|
// Both regressed silently before because CSS isn't in the unit test loop; this
|
|
// file adds a source-string assertion so the ratchet catches removals.
|
|
|
|
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const CSS = fs.readFileSync(
|
|
path.join(__dirname, '..', 'src', 'renderer', 'style.css'),
|
|
'utf8',
|
|
);
|
|
|
|
test('#164: .stream declares min-height:0 so it can scroll inside column-flex parent', () => {
|
|
// find the first `.stream {` block (line 289 region) — the layout rule, not
|
|
// the theme rebase rule further down that only tweaks padding.
|
|
const idx = CSS.indexOf('.stream {');
|
|
assert.ok(idx >= 0, '.stream rule must exist');
|
|
const block = CSS.slice(idx, CSS.indexOf('}', idx) + 1);
|
|
assert.match(
|
|
block,
|
|
/min-height:\s*0\b/,
|
|
'.stream must set min-height:0 to allow internal scroll under flex parent',
|
|
);
|
|
assert.match(
|
|
block,
|
|
/flex-direction:\s*column/,
|
|
'sanity: the guarded block is still the column-flex stream rule',
|
|
);
|
|
assert.match(
|
|
block,
|
|
/overflow-y:\s*auto/,
|
|
'sanity: stream is still the scroll container',
|
|
);
|
|
});
|
|
|
|
test('#164: .stream > * has flex-shrink:0 so intrinsic-height children do not collapse', () => {
|
|
// The rule appears on its own line as `.stream > * { flex-shrink: 0; ... }`.
|
|
// Assert directly on that shape so a rewrite that reorders declarations
|
|
// still passes as long as the intent stays.
|
|
const re = /^\.stream\s*>\s*\*\s*\{[^}]*flex-shrink:\s*0/m;
|
|
assert.match(
|
|
CSS,
|
|
re,
|
|
'.stream > * must set flex-shrink:0 to keep interaction cards / rows from collapsing',
|
|
);
|
|
});
|
|
|
|
test('#164: guarded rules are documented in-place so future edits know why', () => {
|
|
// Both rules should carry a "#164" reference in a nearby comment so a
|
|
// subsequent editor sees the bug id before deleting them. The comment
|
|
// preceding `.stream > *` is the primary docstring for the fix.
|
|
const bookmark = CSS.match(/task #164:[\s\S]{0,600}\.stream > \*/);
|
|
assert.ok(
|
|
bookmark,
|
|
'a task #164 comment must sit adjacent to the .stream > * rule so the intent survives future refactors',
|
|
);
|
|
});
|