feat(tui): open the diff side panel by default (#55780)

This commit is contained in:
James Long
2026-10-15 13:06:34 -04:00
committed by GitHub
Unverified
parent 86755e1cea
commit 09a075d90c
3 changed files with 2 additions and 26 deletions
@@ -14,13 +14,7 @@ type Experiment = {
// In-flight features anyone can opt into. Each entry is temporary: an
// experiment either graduates (delete the entry, make the behavior
// unconditional) or dies (delete the entry and the branch it gated).
export const experiments: Experiment[] = [
{
id: "diff-panel",
title: "Diff side panel",
description: "Open /diff in a panel beside the session instead of full screen",
},
]
export const experiments: Experiment[] = []
export function DialogExperiments() {
const config = useConfig()
@@ -1325,8 +1325,8 @@ function Commands(props: { context: Plugin.Context }) {
props.context.ui.panel.close()
return
}
// Outside a session there is no panel slot, so /diff falls back to the full-screen route.
if (
config.data.experimental?.["diff-panel"] === true &&
props.context.ui.panel.open(ROUTE, {
presentation: config.data.diffs?.fullscreen === true ? "fullscreen" : "panel",
})
-18
View File
@@ -13,22 +13,6 @@ import { createAppFixture } from "./fixture/app"
import { directory, json } from "./fixture/tui-client"
import { tmpdir } from "./fixture/fixture"
test("/diff opens the full-screen diff when the side panel experiment is off", async () => {
await using state = await tmpdir()
await using setup = await createSessionFixture(state.path, { panel: false })
await ready(setup)
await setup.mockInput.typeText("/diff")
await setup.waitForFrame((frame) => frame.includes("Open diff viewer"))
setup.mockInput.pressEnter()
await setup.waitForFrame((frame) => frame.includes("file00.txt"), { maxPasses: 120 })
expect(setup.renderer.root.findDescendantById("session-panel")).toBeUndefined()
expect(setup.renderer.root.findDescendantById("diff-footer")).toBeUndefined()
expect(setup.captureCharFrame()).not.toContain("Transcript item 11")
setup.mockInput.pressKey("q")
await setup.waitForFrame((frame) => frame.includes("Transcript item 11") && !frame.includes("file00.txt"))
expect(setup.renderer.root.findDescendantById("session-panel")).toBeUndefined()
})
test("/diff focuses the production session panel without sending typing to the prompt", async () => {
await using state = await tmpdir()
await using setup = await createSessionFixture(state.path)
@@ -573,7 +557,6 @@ async function createSessionFixture(
keybinds?: Config.Info["keybinds"]
permission?: boolean
form?: boolean
panel?: boolean
} = {},
) {
// Drafts survive app disposal in memory, so each production app needs its own session identity.
@@ -628,7 +611,6 @@ async function createSessionFixture(
session: { sidebar: "hide" },
// Keep patch geometry stable while testing host presentation changes, not split/unified diff layout.
diffs: { tree: false, view: "unified", ...input.diffs },
experimental: { "diff-panel": input.panel ?? true },
keybinds: { "diff.open": "f6", ...input.keybinds },
},
fetch: async (url, request) => {