Skip to content

Surface active pull request status - #185

Merged
ymichael merged 6 commits into
mainfrom
bb/inspect-thread-work-thr_yav8x4nauy
Jun 17, 2026
Merged

ymichael merged 6 commits into
mainfrom
bb/inspect-thread-work-thr_yav8x4nauy

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Summary

  • expand the existing GitHub PR read path to include checks, review state, mergeability, branch names, and updated time
  • normalize those raw GitHub facts into app-facing PR status, attention, checks, review, and mergeability summaries
  • surface the active thread PR summary in the Info panel and prompt context banner using the existing icon wrapper

Validation

  • pnpm exec turbo run test --filter=@bb/host-workspace --filter=@bb/server --filter=@bb/host-daemon --filter=@bb/host-daemon-contract --filter=@bb/server-contract --force
  • pnpm exec turbo run test --filter=@bb/app --force
  • pnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/host-workspace --filter=@bb/host-daemon-contract --filter=@bb/server-contract --filter=@bb/server --filter=@bb/app --force
  • git diff --check

Notes

  • active-thread only; no sidebar PR cache, webhooks, or review-comment handling in this slice
  • uses the existing Hugeicons-backed Icon wrapper; no lucide added

@ymichael
ymichael force-pushed the bb/inspect-thread-work-thr_yav8x4nauy branch from f5129b2 to 2c5ec93 Compare June 17, 2026 03:17
@ymichael
ymichael force-pushed the bb/inspect-thread-work-thr_yav8x4nauy branch from 2c5ec93 to 0fdd5af Compare June 17, 2026 18:24
@ymichael
ymichael marked this pull request as ready for review June 17, 2026 19:00
@ymichael
ymichael merged commit fa6e36e into main Jun 17, 2026
6 checks passed
@ymichael
ymichael deleted the bb/inspect-thread-work-thr_yav8x4nauy branch June 17, 2026 19:22
SawyerHood added a commit that referenced this pull request Jun 17, 2026
…read-cancel #199)

Resolve conflicts and reconcile our automations migration with main's
hand-authored thread-search migrations:

- Backfill drizzle snapshots for main's hand-authored 0039_thread_search and
  0040_thread_search_rowid_fts (replayed via drizzle-kit against main's schema,
  preserving main's FTS SQL); regenerate our automations migration as
  0041_add_automations with its own snapshot. Full snapshot chain now intact.
- migration-journal.test.ts: add a CI guard that every journal entry has a
  snapshot and the prevId chain is unbroken (prevents snapshot-less
  hand-authored migrations from recurring).
- migrate.test.ts: keep both cleanup paths in the thread-provenance rewind;
  add resetMigrationsAfterThreadSearch so the thread-search replay tests stay
  valid now that a migration (automations) lands after thread search.
- AppSidebar.tsx / ProjectList.tsx: keep both main's thread-search UI and our
  Automations nav entry.
- CLI timeline fixtures: add systemMessageKind/systemMessageSubject (required
  on the user conversation row since #192).
- pnpm install for main's new remark-breaks dependency.

Verified: turbo build typecheck lint test --force --continue -> 69/69 tasks pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
SawyerHood pushed a commit that referenced this pull request Aug 10, 2026
Fixes #1246.
Fixes #1250.

## What changed

- Keep the selected merge-base branch local to each thread view instead
of sharing it across split panes.
- Keep pending file and commit diff actions with the pane that requested
them.
- Deduplicate composer stack-height measurements before scheduling React
state updates.

## Why

Split panes could have different merge-base branches while reading and
writing the same global selection. Each pane then restored its own
value, causing the values to alternate and the panes to rerender until
React threw error #185 and blanked the route.

## Verification

- Full @bb/app suite: 326 files, 2,456 tests passed.
- Turbo typecheck passed for @bb/app.
- Regression tests cover two simultaneous merge-base owners, environment
changes, delayed pane-local diff actions, and stale-action cleanup.
- Installable bb-app tarball smoke test passed.
- Packaged browser QA passed on the affected thread: initial split, two
close/reopen cycles, and persisted split reload. Both panes and
composers remained visible, with no React #185 or merge-base request
loop.
amadad pushed a commit to amadad/bb that referenced this pull request Aug 14, 2026
Fixes get-bb#1246.
Fixes get-bb#1250.

## What changed

- Keep the selected merge-base branch local to each thread view instead
of sharing it across split panes.
- Keep pending file and commit diff actions with the pane that requested
them.
- Deduplicate composer stack-height measurements before scheduling React
state updates.

## Why

Split panes could have different merge-base branches while reading and
writing the same global selection. Each pane then restored its own
value, causing the values to alternate and the panes to rerender until
React threw error get-bb#185 and blanked the route.

## Verification

- Full @bb/app suite: 326 files, 2,456 tests passed.
- Turbo typecheck passed for @bb/app.
- Regression tests cover two simultaneous merge-base owners, environment
changes, delayed pane-local diff actions, and stale-action cleanup.
- Installable bb-app tarball smoke test passed.
- Packaged browser QA passed on the affected thread: initial split, two
close/reopen cycles, and persisted split reload. Both panes and
composers remained visible, with no React get-bb#185 or merge-base request
loop.
ymichael added a commit that referenced this pull request Aug 18, 2026
## Summary

- deduplicate composer history resets before React state dispatch
- mark history sessions active before recall updates and inactive before
reset updates

## Problem

Opening a bb thread could fail with React error #185 (`Maximum update
depth exceeded`). The production stack pointed to `PromptBoxInternal`'s
history reset effect and `resetHistorySession`.

## Root cause

Callers may recreate an empty `history` object while React is processing
overlapping transition and synchronous updates. Each effect pass
unconditionally dispatched three `null` state updates. With another
update lane already pending, React could not always take its eager
same-value bailout, so the redundant passive-effect commit could feed
another render and eventually hit the nested update limit.

## Fix

The reset now uses a ref as the accepted session-transition marker.
History recall marks the session active before state dispatch. Reset
marks it inactive before dispatching its three clears, so inactive
sessions perform no state updates and re-entrant effects cannot enqueue
the same reset twice.

## User impact

Thread composers no longer risk blanking the route with React #185 when
empty history props are recreated during concurrent rendering. Normal
history recall and reset behavior is preserved.

## Validation

- `pnpm exec turbo run test --filter=@bb/app --force --
src/components/promptbox/PromptBoxInternal.test.tsx` — 97 passed
- `pnpm exec turbo run typecheck --filter=@bb/app --force` — passed

> AGENT GENERATED: by GPT-5.6

---------

Co-authored-by: Michael Yong <[email protected]>
SawyerHood added a commit that referenced this pull request Aug 19, 2026
## What was wrong

The crash in #1830 is a feedback loop in the sidebar section-thread drag
(`useSectionThreadDnd`, the multi-container sorter in `ProjectRow`), not
a defect in dnd-kit's `useRect`. `handleDragOver` re-projects the
dragged row into whatever list dnd-kit reports as `over`. That
projection re-renders the row into another list, so its droppable
re-registers and dnd-kit re-measures every container in the same commit
chain. When the sidebar is scrolled and the row is projected into a
section above the viewport, the browser's scroll anchoring moves
`scrollTop` to keep the visible rows still, but dnd-kit offsets its
measured rects by that scroll delta even though nothing moved on screen.
`over` then resolves to the source list under a pointer that never
moved, the row is un-projected, `over` flips again, and each hop is a
layout-effect or synchronously flushed passive-effect update. React
counts them as nested updates and aborts with error #185; the thrower is
whichever `setState` runs 51st, which is why the packaged stack lands on
dnd-kit's `setRect`.

Reproduced on this branch with a headless Chromium script: manual
sidebar mode, a 520px-tall viewport so the sidebar scrolls, scroll to
the bottom, drag a section thread to the bottom edge and then to the top
edge, hold. Every attempt logged `Maximum update depth exceeded` and
`[bb] the app crashed`; the per-`over` log shows the projection flipping
Alpha → Beta → Alpha with `scrollTop` alternating 172 ↔ 203 and the raw
pointer fixed at y=160. The same script no longer crashes with this fix
(3/3 runs), and reverting the fix crashes again.

## What changed

- `apps/app/src/components/sidebar/useSectionThreadDnd.ts`:
`SectionThreadProjectionGate` allows each projection target at most once
per user input (pointer move, touch move, wheel, key press). A revert
that arrives without new input is our own render feeding back and is
dropped. The hook tracks input with capture listeners on `document` from
drag start until end, cancel, or unmount.
- `apps/app/src/app.css`: `overflow-anchor: none` on the sidebar
scroller while `body[data-sidebar-dragging="true"]`, so a projection
cannot move `scrollTop` and desynchronize dnd-kit's rects from the
pointer. Either change alone stops the reproduced crash; the gate is the
general guard against the feedback loop, the CSS removes the geometry
trigger.
- No wire or CLI changes.

## How you verified

- New `useSectionThreadDnd.projection.test.tsx`: renders the hook, drags
a thread over section B, then reports `over` on the source section with
no input. Fails before (`expected null to be 'chronological::b'`),
passes after. Also covers that unvisited targets stay allowed, that
input reopens targets, that listeners are removed on cancel/unmount, and
the gate itself.
- `pnpm exec turbo run typecheck --filter=@bb/app` and `pnpm exec turbo
run test --filter=@bb/app` (360 files, 2862 tests) pass.
- Manual: headless Chromium repro above crashes on `main` and does not
crash with the fix; a normal drag from Alpha into Beta still projects
and drops (thread `sectionId` updated).

Fixes #1830

> AGENT GENERATED: by Claude Opus 5

Co-authored-by: Claude <[email protected]>
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.

1 participant