Skip to content

Commit 3118dbe

Browse files
committed
chore(app): fix lint spacing in the shell panel files
1 parent cf4f4d6 commit 3118dbe

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/app/src/session/composer/activity-chips.stories.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type PreviewArgs = { stage: number; subagents: number; shells: number }
6565
function Preview(props: PreviewArgs) {
6666
const value = createMemo(() => liveDocument(stages[props.stage] ?? stages[0]))
6767
// Built once per count, so each item keeps the start time it had when it appeared.
68+
6869
const activity = createMemo(() => ({
6970
subagents: Array.from({ length: props.subagents }, (_, index) => subagentItem(index)),
7071
shells: Array.from({ length: props.shells }, (_, index) => shellItem(index)),

‎packages/app/src/session/composer/activity-chips.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ export function SessionActivityChips(props: {
114114

115115
// Focus moves a frame late: the menu refocuses itself when the selected row unmounts. One pending move at a time.
116116
let frame = 0
117+
117118
const later = (move: () => void) => {
118119
cancelAnimationFrame(frame)
119120
frame = requestAnimationFrame(move)
120121
}
122+
121123
onCleanup(() => cancelAnimationFrame(frame))
122124

123125
// Opening a shell moves focus to its back arrow.
@@ -368,7 +370,9 @@ export function SessionActivityChips(props: {
368370

369371
function endLabel(end: ShellEnd, t: ReturnType<typeof useLanguage>["t"]) {
370372
if (end.status === "timeout") return t("session.activity.shell.timeout")
373+
371374
if (end.status === "killed") return t("session.activity.shell.killed")
375+
372376
if (end.exit === undefined) return t("session.activity.shell.exited")
373377

374378
return t("session.activity.shell.exitCode", { code: String(end.exit) })
@@ -385,6 +389,7 @@ function ShellTail(props: {
385389
load: (input: ShellOutputInput) => Promise<ShellOutputOutput>
386390
}) {
387391
const language = useLanguage()
392+
388393
const output = createShellTail({
389394
id: () => props.id,
390395
directory: () => props.directory,

‎packages/app/src/session/composer/shell-panel.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export function createShellPanel(input: {
6969
setState("stopping", true)
7070
void input.stop(item).then((stopped) => {
7171
if (!shown(item.key)) return
72+
7273
if (stopped && !state.end) setState("end", { status: "killed", completed: Date.now() })
7374
setState("stopping", false)
7475
})
@@ -91,24 +92,29 @@ export function createShellTail(input: {
9192
const id = input.id()
9293
let loaded = false
9394
let retired = false
95+
9496
const dispose = () => {
9597
retiring.delete(dispose)
9698
stop()
9799
}
100+
98101
const stop = followShellOutput({
99102
id,
100103
directory: input.directory(),
101104
running: input.running(),
102105
load: input.load,
103106
onOutput: (text) => {
104107
loaded = true
108+
105109
if (!retired || input.id() === id) setOutput(text)
110+
106111
if (retired) dispose()
107112
},
108113
})
109114

110115
onCleanup(() => {
111116
retired = true
117+
112118
if (loaded) return dispose()
113119
retiring.add(dispose)
114120
})

‎packages/app/test-browser/shell-panel.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const server: SessionActivityItem = {
1111
target: "sh_dev",
1212
started: 1_000,
1313
}
14+
1415
const watcher: SessionActivityItem = {
1516
key: "sh_test",
1617
type: "shell",
@@ -23,6 +24,7 @@ type Ended = Awaited<ReturnType<Parameters<typeof createShellPanel>[0]["ended"]>
2324

2425
function deferred<T>() {
2526
let resolve = (_: T) => {}
27+
2628
const promise = new Promise<T>((done) => (resolve = done))
2729

2830
return { promise, resolve }
@@ -179,6 +181,7 @@ describe("createShellTail", () => {
179181
test("a first read still in flight when the shell ends still lands", async () => {
180182
const [running, setRunning] = createSignal(true)
181183
const reads: { input: ShellOutputInput; result: ReturnType<typeof deferred<ShellOutputOutput>> }[] = []
184+
182185
const view = createRoot((dispose) => ({
183186
dispose,
184187
output: createShellTail({

0 commit comments

Comments
 (0)