Skip to content

fix: Fix sidebar task scroll layout#2362

Merged
charlesvien merged 3 commits into
PostHog:mainfrom
Basit-Balogun10:fix-taskbar-task-scroll
Jun 4, 2026
Merged

fix: Fix sidebar task scroll layout#2362
charlesvien merged 3 commits into
PostHog:mainfrom
Basit-Balogun10:fix-taskbar-task-scroll

Conversation

@Basit-Balogun10
Copy link
Copy Markdown
Contributor

@Basit-Balogun10 Basit-Balogun10 commented May 25, 2026

Problem

The Tasks section in the sidebar was not height-constrained, so scrolling let it expand over the fixed controls instead of staying inside its intended area.

Closes #2359

Changes

Split the sidebar into a fixed controls block and a bounded task scroll region with a sticky task section header (section title "TASKS", search and filter icons)

How did you test this?

Verified the edited files and manually reviewed the layout change.

Demo

sidebar-tasks-section-overflow-scroll-fixed-with-sticky-controls-block-and-tasks-section-header.webm

Publish to changelog?

Do not publish to changelog.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 25, 2026

Comments Outside Diff (1)

  1. apps/code/src/renderer/features/sessions/hooks/useForkSession.ts, line 1124-1127 (link)

    P2 Unsafe double cast hides a type mismatch between the API response and Task

    newTask as unknown as Task is used to spread the create-task API response into a Task object. The double cast suppresses TypeScript's type check, so any field required by navigateToTask or downstream consumers that is absent from the create-task response will silently be undefined at runtime. If the Task type's required fields ever expand, this will break without a compiler error.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/code/src/renderer/features/sessions/hooks/useForkSession.ts
    Line: 1124-1127
    
    Comment:
    **Unsafe double cast hides a type mismatch between the API response and `Task`**
    
    `newTask as unknown as Task` is used to spread the create-task API response into a `Task` object. The double cast suppresses TypeScript's type check, so any field required by `navigateToTask` or downstream consumers that is absent from the create-task response will silently be `undefined` at runtime. If the `Task` type's required fields ever expand, this will break without a compiler error.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
apps/code/src/main/services/fork/service.ts:96-246
**Debug diagnostic blocks shipped to production**

Two large blocks explicitly labelled `"Diagnostic: …"` (lines 96–139 and 149–246) were left in `prepareFork`. They run on every fork invocation, iterate over the full `allEntries` array twice, build detailed in-memory data structures (`userMsgGroupPositions`, etc.), and call `log.info` with `sampleMethods` and `sampleSessionUpdates` — fields that can contain raw conversation content. In production these add measurable CPU overhead per fork and expose conversation data in logs.

### Issue 2 of 3
apps/code/src/renderer/utils/toast.tsx:89-101
**Global `toast.loading` changed to `duration: Infinity` — existing callers that never dismiss will produce immortal toasts**

`toast.loading` now never auto-dismisses. Since the component already hides the close button for `type="loading"`, there is no way for a user to clear a stuck toast. Any existing call site that captures the returned ID but fails to later call `toast.success`/`toast.error` with `{ id }` (e.g. because an exception escapes the try block, or the function returns early through an unguarded path) will leave a permanently-visible spinner in the UI. The fork flow is correctly wired, but this global change silently raises the stakes for every other caller.

### Issue 3 of 3
apps/code/src/renderer/features/sessions/hooks/useForkSession.ts:1124-1127
**Unsafe double cast hides a type mismatch between the API response and `Task`**

`newTask as unknown as Task` is used to spread the create-task API response into a `Task` object. The double cast suppresses TypeScript's type check, so any field required by `navigateToTask` or downstream consumers that is absent from the create-task response will silently be `undefined` at runtime. If the `Task` type's required fields ever expand, this will break without a compiler error.

Reviews (1): Last reviewed commit: "Fix sidebar task scroll layout" | Re-trigger Greptile

Comment thread apps/code/src/main/services/fork/service.ts Outdated
Comment thread apps/code/src/renderer/utils/toast.tsx
@Basit-Balogun10 Basit-Balogun10 force-pushed the fix-taskbar-task-scroll branch 2 times, most recently from c632202 to 7ab868a Compare June 1, 2026 11:31
@charlesvien charlesvien changed the title Fix sidebar task scroll layout fix: Fix sidebar task scroll layout Jun 4, 2026
Basit-Balogun10 and others added 3 commits June 4, 2026 14:54
- Top nav icons (new task, search, inbox, skills, etc.) now sit in a
  shrink-0 flex child so they never scroll away
- Task list moved into min-h-0 flex-1 ScrollArea so it fills the
  remaining height and scrolls independently
- Tasks section header (search + filter icons) is sticky top-0 within
  the scroll area
@charlesvien charlesvien force-pushed the fix-taskbar-task-scroll branch from 7ab868a to 8e6fc28 Compare June 4, 2026 22:15
@charlesvien charlesvien merged commit e38d724 into PostHog:main Jun 4, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks section scroll takes over entire sidebar height

2 participants