Skip to content

Commit 3c353d9

Browse files
mattleavertonclaude
andcommitted
revert: remove unrelated changes from TabsView redesign PR
Remove ToolStrip simplification (in #251), test rewrites (in #249), precheck worktree fix (in #252), and .opencode config. This PR now contains only the TabsView device-centric card grid redesign. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3fab8ca commit 3c353d9

20 files changed

Lines changed: 744 additions & 924 deletions

.opencode/opencode.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/plans/fix-tool-strip-showtools-toggle.md

Lines changed: 0 additions & 189 deletions
This file was deleted.

scripts/precheck.ts

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99
* 3. Port conflicts - detects if freshell is already running
1010
*/
1111

12-
import { readFileSync } from 'fs'
12+
import { readFileSync, existsSync } from 'fs'
1313
import { resolve, dirname } from 'path'
1414
import { fileURLToPath } from 'url'
15-
import { createRequire } from 'module'
1615
import { runUpdateCheck, shouldSkipUpdateCheck } from '../server/updater/index.js'
1716

1817
const __dirname = dirname(fileURLToPath(import.meta.url))
1918
const rootDir = resolve(__dirname, '..')
20-
const workspaceRequire = createRequire(resolve(rootDir, 'package.json'))
2119

2220
// Load package.json for version
2321
function getPackageVersion(): string {
@@ -34,29 +32,6 @@ function getPackageVersion(): string {
3432
* Check if node_modules is missing required dependencies from package.json.
3533
* Returns list of missing packages.
3634
*/
37-
function hasInstalledDependency(dep: string): boolean {
38-
try {
39-
// Use Node's resolver so worktrees can inherit dependencies from the
40-
// parent checkout's node_modules instead of requiring a duplicate install.
41-
workspaceRequire.resolve(`${dep}/package.json`)
42-
return true
43-
} catch (error) {
44-
const code = typeof error === 'object' && error && 'code' in error
45-
? String((error as { code?: unknown }).code)
46-
: ''
47-
if (code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
48-
return false
49-
}
50-
}
51-
52-
try {
53-
workspaceRequire.resolve(dep)
54-
return true
55-
} catch {
56-
return false
57-
}
58-
}
59-
6035
function checkMissingDependencies(): string[] {
6136
const missing: string[] = []
6237
try {
@@ -68,7 +43,8 @@ function checkMissingDependencies(): string[] {
6843
}
6944

7045
for (const dep of Object.keys(allDeps)) {
71-
if (!hasInstalledDependency(dep)) {
46+
const depPath = resolve(rootDir, 'node_modules', dep)
47+
if (!existsSync(depPath)) {
7248
missing.push(dep)
7349
}
7450
}

src/components/agent-chat/AgentChatView.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,28 @@ export default function AgentChatView({ tabId, paneId, paneContent, hidden }: Ag
451451
const timelineItems = useMemo(() => session?.timelineItems ?? [], [session?.timelineItems])
452452
const timelineBodies = session?.timelineBodies ?? {}
453453

454+
// Auto-expand: count completed tools across all messages, expand the most recent N
455+
const RECENT_TOOLS_EXPANDED = 3
454456
const messages = useMemo(() => session?.messages ?? [], [session?.messages])
457+
const { completedToolOffsets, autoExpandAbove } = useMemo(() => {
458+
let totalCompletedTools = 0
459+
const offsets: number[] = []
460+
for (const msg of messages) {
461+
offsets.push(totalCompletedTools)
462+
for (const b of msg.content) {
463+
if (b.type === 'tool_use' && b.id) {
464+
const hasResult = msg.content.some(
465+
r => r.type === 'tool_result' && r.tool_use_id === b.id
466+
)
467+
if (hasResult) totalCompletedTools++
468+
}
469+
}
470+
}
471+
return {
472+
completedToolOffsets: offsets,
473+
autoExpandAbove: Math.max(0, totalCompletedTools - RECENT_TOOLS_EXPANDED),
474+
}
475+
}, [messages])
455476

456477
// Debounce streaming text to limit markdown re-parsing to ~20x/sec
457478
const debouncedStreamingText = useStreamDebounce(
@@ -640,6 +661,8 @@ export default function AgentChatView({ tabId, paneId, paneContent, hidden }: Ag
640661
showThinking={paneContent.showThinking ?? defaultShowThinking}
641662
showTools={paneContent.showTools ?? defaultShowTools}
642663
showTimecodes={paneContent.showTimecodes ?? defaultShowTimecodes}
664+
completedToolOffset={completedToolOffsets[item.msgIndices[1]]}
665+
autoExpandAbove={autoExpandAbove}
643666
/>
644667
</React.Fragment>
645668
)
@@ -656,6 +679,8 @@ export default function AgentChatView({ tabId, paneId, paneContent, hidden }: Ag
656679
showThinking={paneContent.showThinking ?? defaultShowThinking}
657680
showTools={paneContent.showTools ?? defaultShowTools}
658681
showTimecodes={paneContent.showTimecodes ?? defaultShowTimecodes}
682+
completedToolOffset={completedToolOffsets[item.msgIndex]}
683+
autoExpandAbove={autoExpandAbove}
659684
/>
660685
)
661686
})

0 commit comments

Comments
 (0)