Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2fd4894
The whole integration suite green on the refactored branch: a code li…
tomeyer97 Nov 25, 2026
64c5d06
The integration suite passes on GitHub's slower runners: no races in …
tomeyer97 Nov 25, 2026
fb0969f
The check CLI: no check on the default branch, its own files never co…
tomeyer97 Nov 26, 2026
955c7f4
Saving a note never loses anyone's words: agent fields kept, replies …
tomeyer97 Nov 26, 2026
cbf5189
Adding a note: the box keeps the keyboard, file and folder notes ask …
tomeyer97 Nov 26, 2026
fd9f91b
The journey walk keeps 80 columns of code, survives binary files and …
tomeyer97 Nov 26, 2026
65867d4
The Notes view: one row shape, sessions read as a severity list, hone…
tomeyer97 Nov 26, 2026
cf24d97
Ask Claude: a labelled button, never an empty paid run, Stop keeps wh…
tomeyer97 Nov 26, 2026
a8e96ff
Writing journeys: say when there is nothing to refresh, refuse vague …
tomeyer97 Nov 26, 2026
9780a34
The check in the editor: hidden on the default branch, background run…
tomeyer97 Nov 26, 2026
57691dd
Listen: speed remembered, damaged audio in Problems, one player at a …
tomeyer97 Nov 26, 2026
71c960e
The map opens readable: no overlapping labels, nothing cut at the edg…
tomeyer97 Nov 26, 2026
b4fb194
The Journeys view: one row per journey in small repos, plain descript…
tomeyer97 Nov 26, 2026
8606b8b
Threads and anchors: stale lines visible in the editor, a clear move,…
tomeyer97 Nov 26, 2026
5d7f13f
The manifest says what the extension does: welcome texts, palette, me…
tomeyer97 Nov 26, 2026
44862f9
The README and docs match the code: no promises it doesn't keep, a Gi…
tomeyer97 Nov 26, 2026
d20029a
The whole integration suite green after the fixes: tests follow the d…
tomeyer97 Nov 27, 2026
e4e451e
Merge main (its tree equals this branch's base)
tomeyer97 Nov 27, 2026
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
8 changes: 5 additions & 3 deletions src/journeys/panel/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,15 @@ export class PanelLayout {
/**
* A step opened with the panel beside it: the code keeps its 80 columns. Squeezed under them (a panel opened by
* Ctrl+' V or left open while the window narrowed), the panel shrinks to leave them, or closes: the step card alone.
* The map's room asked for while the panel is open stays, and so does the listening width.
* The map's room asked for while the panel is open stays, and so does the listening width. Nothing is changed once
* `current` says the step is no longer the one shown.
*/
async keepCodeRoom(): Promise<void> {
async keepCodeRoom(current: () => boolean = () => true): Promise<void> {
if (!this.d.isOpen()) { this.readerChose = false; return }
if (this.d.episodeOn()) return
const s = await this.sideBySide()
if (!s) return
// `current`: the step is still the one shown (the layout read is a round trip; another journey may be open now).
if (!s || !current()) return
const look = this.editorLook()
const move = codeRoomMove({
codePx: s.layout.groups[1 - s.panel].size ?? 0,
Expand Down
2 changes: 2 additions & 0 deletions src/podcast/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function snapshot(p: Podcasts, ports: Pick<PodcastPorts, 'journeys' | 'mapPanel'
hostIn: host.in,
unlocked: host.unlocks,
hostAlive: host.alive(),
/** The Listen view's page (hostAlive is the player that has the audio, which may be the panel). */
listenAlive: host.listen.alive,
hostVisible: host.listen.visible,
panelHosts: host.panelHosts,
rate: p.store.rate,
Expand Down
6 changes: 3 additions & 3 deletions src/sidebar/journeyRowText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { ClaudeRun, runProgress } from '../core/agentRun'
import { clock } from '../core/format/podcast/model'
import type { PodcastStatus } from '../tour/api'

/** The groups under which a journey's row lists its step questions: All and its areas, and a row of no group (the
* Code Notes view's). A row is listed once there. */
export const nestsQuestions = (group: string | undefined) => !group || group === 'all' || group.startsWith('area:')
/** The groups under which a journey's row lists its step questions: Continue, All and its areas, and a row of no group
* (the Code Notes view's). A journey is listed once there (a walked one only in Continue); "In this file" repeats it. */
export const nestsQuestions = (group: string | undefined) => !group || group === 'all' || group === 'continue' || group.startsWith('area:')

/** What a journey's row says, worked out once: its description, tooltip, screen-reader label, icon and menus are all
* made from it. */
Expand Down
7 changes: 5 additions & 2 deletions src/tour/walk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,11 @@ export class Walk {
const editor = await this.openStepFile(lj, n, uri, opts, token)
if (!editor) return
await this.revealStep(lj, n, editor, uri)
// Beside an open panel the code keeps its 80 columns (the panel narrower, or the step card alone).
if (mapPanel().journey && this.tour.isAt(lj, n)) await panelLayout().keepCodeRoom()
// Beside an open panel the code keeps its 80 columns (the panel narrower, or the step card alone). The trade-off,
// on purpose: one waited layout read per step (a round trip to the window, counted apart in the round-trip test).
// Not waited for, it races the layout a journey sets as it opens and can close the panel it just opened.
const shown = () => this.tour.isAt(lj, n) && mapPanel().journey?.key === lj.key
if (shown()) await panelLayout().keepCodeRoom(shown)
}

/** The tour is on step n now (another journey's walk ended first), stored, its map and lists follow. False: superseded. */
Expand Down
11 changes: 6 additions & 5 deletions test/integration/check/branches.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Drift and branches: uncommitted lines asking for a top-up, another branch hiding the check's threads, a branch switch
// Drift and branches: uncommitted lines asking for one more question, another branch hiding the check's threads, a branch switch
// while questions are written, another git user. Each test puts the branch, the files and the git config back in
// `finally`, so a failure here doesn't leave the next tests on another branch.
import * as vscode from 'vscode'
Expand All @@ -25,15 +25,16 @@ function backTo(branch: string): void {
}

export const branchesTests = [
test('drift from uncommitted lines: amber "Needs top-up: +46 lines" in the status bar and the view (Commit… first)', async () => {
test('drift from uncommitted lines: "Understanding: +1 question" in the status bar (amber), the line count in the view (Commit… first)', async () => {
const saved = fs.readFileSync(limitsPath, 'utf8')
try {
// 45 new lines (uncommitted) → amber "Needs top-up" before any push.
// 45 new lines (uncommitted) → one more question asked for before any push; how much it grew is in the view.
fs.appendFileSync(limitsPath, Array.from({ length: 45 }, (_, i) => `export const MORE_${i} = ${i}`).join('\n') + '\n')
await vscode.commands.executeCommand('workbench.action.files.revert').then(undefined, () => undefined)
void api.checkRefresh()
await until('needs top-up', () => /^\$\(warning\) Needs top-up: \+4\d lines$/.test(chk().item))
await untilEqual('the warning in the status bar and the view', () => [chk().itemWarn, view().tone, view().action?.id], [true, 'warn', 'scm'], CHECK_WAIT_MS)
await until('one more question asked for', () => chk().item === '$(checklist) Understanding: +1 question')
await untilEqual('amber in the status bar; the view says how much it grew and offers Commit… first', () => [chk().itemWarn, view().tone, /^Your change grew by 4\d code lines$/.test(view().title ?? ''), view().line, view().action?.id],
[true, 'todo', true, 'Commit, then add 1 question about the new lines.', 'scm'], CHECK_WAIT_MS)
await pageShot('check-4-drift')
} finally {
fs.writeFileSync(limitsPath, saved)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/main/journeyFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const journeyFilesTests = withAfter([
await vscode.commands.executeCommand('codeNotes.refreshJourney', vscode.Uri.file(diskPath).toString())
await until('refreshed: the file rewritten, the step fresh', () => JSON.parse(fs.readFileSync(diskPath, 'utf8')).steps[0].anchor?.v === 3 && !diskStep().stale, 20000)
assert.equal(snap().notes.length, notesBeforeRefresh, 'Refresh writes no note in the reader\'s name')
assert.ok(!fs.readdirSync(path.join(ctx.notesDir, '.writing')).length, 'the staging folder is cleaned up')
assert.ok(!fs.existsSync(path.join(ctx.notesDir, '.writing')), 'the staging folder is cleaned up, no empty .writing left')
fs.unlinkSync(diskPath)
await until('disk gone', () => !snap().journeys.some((x: any) => x.id === 'disk'))
}),
Expand Down
24 changes: 15 additions & 9 deletions test/integration/main/journeyTour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const withBinaryStep = () => journey('binary', [
const moving = (title: string, from = 0) => journey('moving', demoSteps.slice(from).map((x) => ({ ...x, id: `m-${x.id}` })), { title })

export const journeyTourTests = [
test('v2 journeys load (v1 and broken files skipped); steps are not notes; the group lists titles, new ones marked', async () => {
test('v2 journeys load (v1 and broken files skipped); steps are not notes; the view lists titles, new ones marked', async () => {
writeLines(wsPath('src', 'flow.ts'), ['export function a() {', ' return b()', '}', '', 'export function b() {', ' return 2', '}'])
writeLines(wsPath('src', 'flow2.ts'), ['// two', 'export const c = 3'])
writeLines(wsPath('lib', 'mail', 'address.go'), Array.from({ length: 60 }, (_, i) => `// line ${i + 1}`))
Expand All @@ -127,14 +127,13 @@ export const journeyTourTests = [
assert.equal(snap().notes.length, notesBefore, 'steps are not notes')
assert.equal(snap().broken, brokenBefore, 'journey files are not read as notes')
assert.equal(snap().badge, badgeBefore, 'steps never count as unread')
// 0.24: journeys have their own view (Journeys), grouped by area; the Notes view lists notes only.
// Journeys have their own view (Journeys); the Notes view lists notes only. Fewer than 8 journeys: one flat list,
// a row each (no area or "All" group above it), its length and "new" in the description.
const rows = journeysTree()
assert.ok(!notesTree().some((l) => /^journeys:|journey:/.test(l)), 'no journeys in the Notes view')
const demoRow = rows.findIndex((l) => /journey:Demo · new$/.test(l))
assert.ok(demoRow > 0 && /^\s+jgroup:src · 1$/.test(rows[demoRow - 1]), `Demo under its area (not said again), "new":\n${rows.join('\n')}`)
assert.ok(rows.some((l) => /^jgroup:All · 1$/.test(l)), `an "All" group:\n${rows.join('\n')}`)
// Files that never were valid journeys: one dimmed row each, after the groups.
assert.deepEqual(rows.slice(-2), ['badJourney: · ⚠ half-written.json', 'badJourney: · ⚠ old-v1.json'], `never-valid files are dimmed rows:\n${rows.join('\n')}`)
assert.ok(!rows.some((l) => /jgroup:/.test(l)), `a few journeys are not grouped:\n${rows.join('\n')}`)
// Files that never were valid journeys: one dimmed row each, after the journeys.
assert.deepEqual(rows, ['journey:Demo · 3 steps · new', 'badJourney: · ⚠ half-written.json', 'badJourney: · ⚠ old-v1.json'], `Demo a top row, "3 steps · new"; never-valid files are dimmed rows after it:\n${rows.join('\n')}`)
}),

test('Open Journey: the map and step 1\'s code, the panel at most 40 %; a read-only step card above the lines, details folded', async () => {
Expand Down Expand Up @@ -300,8 +299,15 @@ export const journeyTourTests = [
assert.equal(question.session, undefined, 'a normal private note')
assert.equal(question.unread, 0)
const rows = journeysTree()
const row = rows.findIndex((l) => /^ {6}note:Step 2 · Why does b return 2\?/.test(l))
assert.ok(row > 0 && /^ {4}journey:Demo\b/.test(rows[row - 1]) && !/question/.test(rows[row - 1]), `listed right under its journey, with its step; no count on the row:\n${rows.join('\n')}`)
// The walked journey is listed once, in Continue: its questions under it there.
const row = rows.findIndex((l) => /^ {4}note:Step 2 · Why does b return 2\?/.test(l))
assert.ok(row > 1, `the question listed:\n${rows.join('\n')}`)
// Right under its journey (the walked one, in Continue), with its step; no question count on the journey's row.
assert.deepEqual(rows.slice(row - 2, row + 1).map((l) => l.replace(/ \[[^\]]*\]$/, '')), [
'jgroup:Continue · 1',
' journey:Demo · step 2/3',
' note:Step 2 · Why does b return 2? · flow.ts:8',
], `listed right under its journey, with its step; no count on the row:\n${rows.join('\n')}`)
assert.ok(!rows.some((l) => /^note:Why does b return 2/.test(l)), 'not a loose row too')
const askedThread = await until('the asked note\'s thread', () => ctx.api.thread(question.id))
assert.ok(!/openStepLink|About the step/.test(bodyOf(askedThread.comments[0])), 'on that very step: no back-link')
Expand Down
6 changes: 5 additions & 1 deletion test/integration/main/notesReview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ export const notesReviewTests = [
await vscode.commands.executeCommand('type', { text: 'Typed into the box' })
await vscode.commands.executeCommand('editor.action.submitComment')
await until('Add Note saved a note', () => snap().notes.length === notesBefore + 1 && snap().notes.some((x: any) => x.messages[0].body === 'Typed into the box'), 8000)
assert.equal(vscode.workspace.getConfiguration('comments').get('maxHeight'), false, 'More grows the card: no nested scroll')
// Of VS Code's comment defaults the extension changes only openView (no Comments panel on every note);
// comments.maxHeight stays VS Code's own, for every comment extension.
const comments = vscode.workspace.getConfiguration('comments')
assert.equal(comments.inspect('maxHeight')?.defaultValue, true, 'comments.maxHeight left at VS Code\'s default')
assert.equal(comments.get('openView'), 'never', 'no Comments panel popping up on every note')
}),
]
11 changes: 7 additions & 4 deletions test/integration/main/podcast/playback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const playbackTests = [
// Nothing listened to: no Listen view (nor its focus command), no transport in the palette, a plain row.
assert.ok(!pod().listening && !pod().hostAlive, 'no Listen view before a journey is listened to')
const idle = ctx.api.journeyRow('podauto')!
assert.match(idle.description ?? '', /^♪ 0:40( · |$)/, `the row: its length: ${idle.description}`)
assert.match(idle.description ?? '', /^1 step · ♪ 0:40( · |$)/, `the row: its steps, then its podcast's length: ${idle.description}`)
assert.match(idle.contextValue!, /;podcast$/, 'its ▶ Listen')
assert.doesNotMatch(String(idle.tooltip), /podcast|Listen/i, 'no podcast line in the tooltip')
await shots('listen-idle', true)
Expand All @@ -49,7 +49,7 @@ export const playbackTests = [
await audioMoves(pf, 'played in the panel')
assert.equal(await pf.evaluate(() => { const e = (globalThis as any).document.querySelector('.pod-err'); return e.hidden ? '' : e.textContent }), '', 'no hint or error line')
assert.ok(pod().unlocked.panel && !pod().unlocked.listen, `the panel unlocked, the Listen view not: ${JSON.stringify(pod().unlocked)}`)
await podUntil('the panel has the audio: the Listen view is not there (codeNotes.listening off)', () => pod().panelHosts && !pod().hostAlive && !pod().hostVisible, QUICK_MS)
await podUntil('the panel has the audio: the Listen view is not there (codeNotes.listening off)', () => pod().panelHosts && !pod().listenAlive && !pod().hostVisible, QUICK_MS)

// 2. Closing the panel: the audio goes to the Listen view, which may not play yet: it waits there, paused, where
// it was (the one start that still needs a click: the status item or ▶ opens the panel again).
Expand All @@ -72,7 +72,7 @@ export const playbackTests = [
const pf2 = await frameOf('journey', { quiet: true })
await realClick(pf2, '.pod-b.play')
await podUntil('the click on the panel\'s ▶: playing in the panel', () => pod().playing && pod().hostIn === 'panel', MOVE_MS)
await podUntil('the Listen view went: the panel\'s player is the one', () => !pod().hostAlive && !pod().hostVisible, QUICK_MS)
await podUntil('the Listen view went: the panel\'s player is the one', () => pod().panelHosts && !pod().listenAlive && !pod().hostVisible, QUICK_MS)
await audioMoves(pf2, 'the panel\'s ▶')
assert.ok(Math.abs(pod().t - tClose) < 4, `on from where it was: ${tClose} → ${pod().t}`)

Expand All @@ -88,7 +88,8 @@ export const playbackTests = [
await pause()
await closePanel()
await podUntil('the audio back in the Listen view', () => pod().hostIn === 'listen' && pod().hostAlive && pod().hostVisible, MOVE_MS)
const lf = await frameOf('listen', { quiet: true })
// Found by its player (not `quiet`): the side bar has other webviews (the Check view).
const lf = await frameOf('listen')
await realClick(lf, '.pod-b.play')
await podUntil('the Listen view\'s ▶ plays there; the Listen view unlocked', () => pod().playing && pod().hostIn === 'listen' && pod().unlocked.listen, MOVE_MS)
assert.equal(await lf.evaluate(() => (globalThis as any).document.querySelector('.ls-title')?.textContent), 'Pod auto', 'the view names the journey')
Expand Down Expand Up @@ -336,6 +337,8 @@ export const playbackTests = [
podTest('podcast › the speed is remembered', async () => {
await listenTo('podbeat', writeBeatJourney)
const f = await frameOf('journey')
// The speed button is at the panel's bottom right, under VS Code's own toasts ("extensions are disabled").
await vscode.commands.executeCommand('notifications.clearAll')
const speedTo = async (r: number) => {
for (let i = 0; i < 5 && pod().rate !== r; i++) {
await f.click('.pod-rate')
Expand Down
10 changes: 9 additions & 1 deletion test/integration/main/roundTrips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ const activeUri = () => vscode.window.activeTextEditor?.document.uri.toString()
/** What each action may call at most besides storing its place (stored in the background, not waited for). */
const MOST: Record<string, number> = { next: 1, previous: 1, link: 1, back: 1, same: 0, chatBack: 1 }

/** Opening a step (Next, Previous, Back to the step) waits for one more round trip, on purpose: an editor layout read
* after the step is shown, so the code beside the journey panel keeps its 80 columns. Counted apart from MOST. */
const LAYOUT_PROBE = 'command vscode.getEditorLayout'
const STEP_ACTIONS = new Set(['next', 'previous', 'back'])

/** The code link that goes into another file than the card's, and the one into the card's own file. */
const TO_OTHER_FILE = 1, TO_CARD_FILE = 0

Expand Down Expand Up @@ -164,8 +169,11 @@ export const roundTripsTests = [
await chatLinks(c, r)
fs.rmSync(tripsPath)
for (const [k, n] of Object.entries(MOST)) {
const waited = r[k].calls.filter((x) => !x.startsWith('store '))
// The step's layout read is waited for too; it is held to its own limit below, not to MOST.
const waited = r[k].calls.filter((x) => !x.startsWith('store ') && !(STEP_ACTIONS.has(k) && x === LAYOUT_PROBE))
assert.ok(waited.length <= n, `${k}: ${waited.length} calls into the window (at most ${n}): ${waited.join(', ')}`)
const probes = r[k].calls.filter((x) => x === LAYOUT_PROBE).length
assert.ok(probes <= (STEP_ACTIONS.has(k) ? 1 : 0), `${k}: ${probes} waited layout reads (opening a step: at most one, after the step is shown; other actions: none)`)
}
} finally { c.dispose() }
}),
Expand Down
4 changes: 2 additions & 2 deletions test/journeyRowText.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ test('a podcast: its length on the row and in the label; one that cannot play sa
assert.equal(podcastContext(undefined), '')
})

test('questions nest under All, its areas and a row of no group only', () => {
assert.deepEqual([undefined, 'all', 'area:api', 'here', 'continue'].map(nestsQuestions), [true, true, true, false, false])
test('questions nest under Continue, All, its areas and a row of no group; not under In this file', () => {
assert.deepEqual([undefined, 'all', 'area:api', 'here', 'continue'].map(nestsQuestions), [true, true, true, false, true])
})

test('a journey being written: its question, then the clock and what Claude is doing', () => {
Expand Down
Loading