Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/specs/terminal-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ Source of truth: `context` in `standalone/sidecar/pty-core.js`; `terminalContext

Port action overflow follows `docs/specs/layout.md` → "Header context menu".

Source of truth: `TerminalContextView` in `lib/src/components/wall/TerminalContextView.tsx`.

The Window-host workspace picker follows `docs/specs/layout.md` → Moving Surfaces between Workspaces.

Source of truth: `TerminalContextView` in `lib/src/components/wall/TerminalContextView.tsx`.

## Tool context

**Must show a Tool's primary Session in Terminal Context instead of creating an auxiliary helper**; one whose run ended is a plain terminal with a helper (`docs/specs/dor-tool.md` → Run end). Reuse the title explanation, directory, port, and alert presentation, showing Tool command status without helper Modify, Reset, or Promote controls; a preview slot's adds Keep open (`docs/specs/layout.md` → Pane header). Pending approval cannot open context.
Expand Down
2 changes: 1 addition & 1 deletion dor-tools-builtin/test/atomic-save.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { join, win32 } from 'node:path';
import { spawn } from 'node:child_process';
import { once } from 'node:events';
import { beforeEach, afterEach, test } from 'node:test';
import { saveFileOperations, windowsReplaceCommand } from '../dist/atomic-save.js';
import { windowsReplaceCommand } from '../dist/atomic-save.js';
import { editorStore } from '../dist/editor-store.js';
import { readText, saveText } from '../dist/editor-routes.js';
let root, file;
Expand Down
2 changes: 1 addition & 1 deletion dor-tools-builtin/viewer/image/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function center(zoom: number, w: number, h: number, viewW: number, viewH:
return { zoom, x: Math.round((viewW - w * zoom) / 2), y: Math.round((viewH - h * zoom) / 2), fit };
}

/** `view` scaled by `factor` about the device point (cx, cy), which stays put. */
/** `view` zoomed to `zoom` (clamped) about the device point (cx, cy), which stays put. */
export function zoomAt(view: View, zoom: number, cx: number, cy: number): View {
zoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, zoom));
const k = zoom / view.zoom;
Expand Down
10 changes: 5 additions & 5 deletions lib/src/components/design.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ describe('terminal radius constants', () => {
});
});

// The header palette crossfade must resolve on the same timing as the focus
// ring's travel. Tailwind can't build a class from a JS constant, so the class
// is a hand-written literal — this ties it back to FOCUS_MOTION_MS and the house
// curve so the two can't silently drift apart.
// Same reason as above: Tailwind scans source statically, so the viewport caps
// Tailwind scans source statically, so the viewport caps
// are hand-written literals. These tie them back to the constants they are
// derived from — `clampOverlayPosition`'s margin, and the modal overlay's own
// inset — so a change to either can't silently leave the cap behind.
Expand Down Expand Up @@ -89,6 +85,10 @@ describe('viewport-bounded overlay caps', () => {
});
});

// The header palette crossfade must resolve on the same timing as the focus
// ring's travel. Tailwind can't build a class from a JS constant, so the class
// is a hand-written literal — this ties it back to FOCUS_MOTION_MS and the house
// curve so the two can't silently drift apart.
describe('focus-ring motion timing', () => {
it('header crossfade duration + curve track FOCUS_MOTION_MS', () => {
expect(FOCUS_MOTION_MS).toBe(220);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/wall/LathHost.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe('LathHost — node identity (the no-re-parent guarantee)', () => {
});

describe('LathHost — parked leaves', () => {
it('retains the same document after more than eight browsers are minimized', () => {
it('retains a parked leaf\'s document however many leaves park after it', () => {
const meta = leafMeta({ component: 'terminal' });
const store = seeded(rowOf('a', 'b'), [['a', meta], ['b', meta]]);
mount(store);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/host/tool-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* `tool-host.cjs` and imported directly by the VS Code extension host.
*
* One method: resolve a tool name against the nearest `dormouse.yml`, list
* the Tools there, read browser settings, and record a trust decision a human
* made in Dormouse's own chrome. Everything crossing back to the webview is
* the Tools there, resolve and list `dor open` handlers, read browser
* settings, and record a trust decision a human made in Dormouse's own chrome. Everything crossing back to the webview is
* plain JSON — the standalone path goes through Rust.
*/
import { dirname } from 'node:path';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/lib/mouse-selection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('mouse-selection: default state', () => {
});

describe('mouse-selection: shadowed program drags', () => {
it('drops a shadowed drag, with its editor, when the program stops reporting', () => {
it('drops a shadowed drag when the program stops reporting', () => {
setMouseReporting('a', 'vt200');
setSelection('a', { startRow: 0, startCol: 0, endRow: 0, endCol: 4, shape: 'linewise', dragging: false, startedInScrollback: false, owner: 'program' });
setMouseReporting('a', 'none');
Expand Down
2 changes: 1 addition & 1 deletion lib/src/remote/direct/direct-endpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ describe('DirectEndpoint', () => {

expect(run.offerer.sent).toEqual([]);
expect(run.answerer.peers).toEqual([]);
// And the attempt is spent: a signal arriving later cannot start one.
// The session stays relayed.
expect(run.offerer.endpoint.path).toBe('relay');
});

Expand Down
3 changes: 2 additions & 1 deletion lib/src/stories/ScanInvitation.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export const CameraUnsupported: Story = {
};

// A pasted string that is not a setup code for this server. One fixed line —
// the parser answers a complete invitation or nothing, never a reason.
// the parser answers a complete invitation or nothing, never a reason; only an
// expired code for this server reads differently.
export const PastedCodeRejected: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
Expand Down
2 changes: 1 addition & 1 deletion remote-lib-common/test/harness/frame-socket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

/**
* The most frames either log keeps. A test case sends tens; `scripts/fake-burrow.mjs`
* The most frames either log keeps. A test case sends tens; `relay/scripts/fake-burrow.mjs`
* is a long-running dev stand-in driving a live echo terminal, and would
* otherwise retain every relayed PTY byte for the life of the process.
*/
Expand Down
11 changes: 4 additions & 7 deletions standalone/src/quit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { TauriAdapter } from "./tauri-adapter";

// The orchestrator is pure webview-side glue: it listens for one Rust event,
// calls adapter/updater primitives, and invokes three Rust commands. Mock the
// Tauri surface (core invoke + event listen) like updater.test.ts, plus the two
// collaborators (countRunningSessions, the updater install pair) so ordering is
// observable. The adapter is injected into initQuitFlow, so it needs no module
// calls adapter/updater primitives, and invokes the `quit_*` Rust commands.
// Mock the Tauri surface (core invoke + event listen) like updater.test.ts, plus
// its collaborators (countRunningSessions, the session flush, the workspace
// store, the updater install pair) so ordering is observable. The adapter is injected into initQuitFlow, so it needs no module
// mock. quit.ts imports TauriAdapter as a type only (erased) — no runtime dep.
const mocks = vi.hoisted(() => ({
invoke: vi.fn(async (_cmd: string) => undefined as unknown),
Expand All @@ -22,9 +22,6 @@ vi.mock("@tauri-apps/api/event", () => ({ listen: mocks.listen }));
vi.mock("dormouse-lib/lib/terminal-registry", () => ({
countRunningSessions: mocks.countRunningSessions,
}));
// The Rust command the close path removes a snapshot with; the quit path never
// calls it (a quit keeps every window's blob, which is what a relaunch reads).

// The aggregator's write step. Mocked for the same reason as the registry: what
// this file tests is where it sits in the order.
vi.mock("dormouse-lib/lib/window-session-aggregator", () => ({
Expand Down
Loading