Skip to content

Scope Markdown reader offsets by panel identity - #5616

Merged
ymichael merged 2 commits into
mainfrom
slopcop/issue-5615
Oct 16, 2026
Merged

ymichael merged 2 commits into
mainfrom
slopcop/issue-5615

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human comments

What was wrong

Markdown reader offsets live in one panel instance even though the panel's tab list changes between threads. A different thread's tabs prune the previous thread's positions; remounting discards the map, while equal tab IDs can leak positions across threads.

Reproduction and root-cause report: https://get-bb.github.io/reports/issues/5615.html

What changed

Keep the in-session offset maps keyed by the existing panel-state identity. Preserve per-instance behavior for unscoped panels and keep closed-tab pruning within the current scope.

Extend the existing real-panel regression harness for disjoint tab lists, shared tab IDs, remounting, and scoped close/reopen behavior. Two secondary-panel files change; no new dependency, generated file, stored-data change, public API, or daemon protocol change.

Changed-line count against trusted origin/main: 83 text lines (69 additions + 14 deletions), 2 files.

How you verified

  • Before the production fix, the focused suite fails with 3 failed / 6 passed at trusted main 01affc197dc621cddc7343e09b1c5c10a5b9efcb. The same agent repeats those failures in a second clean checkout at that exact commit.
  • After the fix, pnpm exec turbo run test --filter=@bb/app -- src/components/secondary-panel/ThreadSecondaryPanel.markdown-scroll.test.tsx src/components/secondary-panel/ThreadSecondaryPanel.collapseControl.test.tsx src/components/secondary-panel/FilePreview.test.tsx src/components/secondary-panel/ThreadSecondaryPanelTabContent.markdown-images.test.tsx passes 72/72 across four files.
  • pnpm exec turbo run typecheck lint --filter=@bb/app passes; lint reports 250 existing warnings and 0 errors, with none in the changed panel file.
  • Isolated source app in Chromium: real sidebar navigation changes an open preview from scrollTop 6400 to 0 before the fix; the same sequence restores 6400 after the fix. The report includes inspected screenshots.
  • git diff --check and the secret-model scan pass. No binary changes.

Fixes #5615

AGENT GENERATED

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymichael
ymichael merged commit 81bf5c6 into main Oct 16, 2026
28 checks passed
@ymichael
ymichael deleted the slopcop/issue-5615 branch October 16, 2026 23:38
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.

Markdown preview loses reading position after switching to another thread and back

2 participants