Skip to content

Commit 5a05e2c

Browse files
authored
Merge branch 'main' into sidebar
2 parents d3fb718 + 20949b8 commit 5a05e2c

File tree

7 files changed

+230
-69
lines changed

7 files changed

+230
-69
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ npm install -g pnpm
2323
pnpm install
2424

2525
# Run in development mode
26-
pnpm run dev
26+
pnpm run start
2727

2828
# Build for production
29-
pnpm run build
29+
pnpm run make
3030

3131
# Other useful commands
32-
pnpm run typecheck # Type checking
33-
pnpm run lint # Linting
32+
pnpm run check:write # Linting & typecheck
3433
```
3534

3635
### Building Distributables

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"dependencies": {
6767
"@ai-sdk/openai": "^2.0.52",
6868
"@phosphor-icons/react": "^2.1.10",
69-
"@posthog/agent": "1.13.0",
69+
"@posthog/agent": "1.15.0",
7070
"@radix-ui/react-icons": "^1.3.2",
7171
"@radix-ui/themes": "^3.2.1",
7272
"@tanstack/react-query": "^5.90.2",

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/components/LogView.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export function LogView({ logs, isRunning, onClearLogs }: LogViewProps) {
5858
const [viewMode, setViewMode] = useState<"pretty" | "raw">("pretty");
5959
const [highlightedIndex, setHighlightedIndex] = useState<number | null>(null);
6060
const [expandAll, setExpandAll] = useState<boolean>(false);
61+
const [autoScroll, setAutoScroll] = useState<boolean>(true);
6162
const scrollPositions = useRef<{ pretty: number; raw: number }>({
6263
pretty: 0,
6364
raw: 0,
@@ -189,11 +190,16 @@ export function LogView({ logs, isRunning, onClearLogs }: LogViewProps) {
189190
return processed;
190191
}, [logs]);
191192

192-
// Track scroll position continuously
193+
// Track scroll position and auto-scroll state
193194
useEffect(() => {
194195
const handleScroll = () => {
195196
if (scrollRef.current) {
196197
scrollPositions.current[viewMode] = scrollRef.current.scrollTop;
198+
199+
// Check if user is near the bottom (within 100px)
200+
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
201+
const isNearBottom = scrollHeight - scrollTop - clientHeight < 100;
202+
setAutoScroll(isNearBottom);
197203
}
198204
};
199205

@@ -216,12 +222,17 @@ export function LogView({ logs, isRunning, onClearLogs }: LogViewProps) {
216222
}
217223
}, [viewMode]);
218224

219-
// Auto-scroll to bottom when new logs arrive (only in pretty mode)
225+
// Auto-scroll to bottom when new logs arrive
220226
useEffect(() => {
221-
if (scrollRef.current && viewMode === "pretty") {
222-
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
227+
if (scrollRef.current && autoScroll) {
228+
// Use requestAnimationFrame to ensure DOM is updated with new content
229+
requestAnimationFrame(() => {
230+
if (scrollRef.current) {
231+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
232+
}
233+
});
223234
}
224-
}, [viewMode]);
235+
}, [autoScroll]);
225236

226237
if (logs.length === 0 && !isRunning) {
227238
return (

0 commit comments

Comments
 (0)