Skip to content

Keep sidebar windowed rows from getting stuck blank - #4064

Merged
ymichael merged 3 commits into
mainfrom
bb/explain-blank-sidebar-rows-thr_vunwn374ej
Sep 22, 2026
Merged

ymichael merged 3 commits into
mainfrom
bb/explain-blank-sidebar-rows-thr_vunwn374ej

Conversation

@ymichael

@ymichael ymichael commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Sidebar rows could remain blank when a list update discarded a concurrent observer promotion, a wrapper lost its observation, or the scroll container initially had zero height. Separately, the packages CI job failed because the provider-literal ratchet scanned temporary CLI bundles produced by another test and counted their generated provider references as new core source references.

What changed

Compose realized-row updates against current state, re-attach missing observations with idempotent observe calls when the list changes, and retry observer setup when an initially zero-height container receives a size. Exclude apps/cli/.packaged-plugin-build-* generated output from the provider-literal ratchet while continuing to scan CLI source.

How you verified

  • Sidebar regression tests cover concurrent promotion/list updates, re-observation, and zero-height container recovery.
  • Added a ratchet regression test with a temporary CLI bundle and real CLI source, verifying that only source references count.
  • pnpm exec turbo run typecheck lint test --filter=bb-plugin-thread-list --filter=@bb/scripts passed: 309 thread-list tests and 143 scripts tests, with both package typechecks passing.
  • Formatting checks and git diff --check passed.
  • Rebased onto origin/main at 4e0f9442f without conflicts.

Production Chromium benchmark: 3 alternating rounds × 40 measured updates at 100/500/2,000 rows. At 2,000 rows, median synchronous update time was 2.4–2.5 ms on the base, 2.7 ms in the original PR, and 2.4 ms after removing unnecessary unobserve calls and restoring the realized-row geometry-read skip. Observer entries per list update dropped from 2,000 to 2, matching the base. Revised/base p95 differences were at most 0.1 ms across the tested cases. These component measurements do not establish iOS or whole-app frame performance. Sidebar tests/typecheck passed again after the optimization.

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/explain-blank-sidebar-rows-thr_vunwn374ej branch from 249d95f to 75ec9b7 Compare September 22, 2026 05:36
ymichael and others added 2 commits September 22, 2026 10:56
Compose realized-key updates against live state, re-observe wrappers on
list changes, and connect the observer once a zero-height scroll
container gains height.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@ymichael
ymichael force-pushed the bb/explain-blank-sidebar-rows-thr_vunwn374ej branch from 75ec9b7 to 8f92df4 Compare September 22, 2026 17:57
@ymichael
ymichael merged commit 59130ae into main Sep 22, 2026
25 of 26 checks passed
@ymichael
ymichael deleted the bb/explain-blank-sidebar-rows-thr_vunwn374ej branch September 22, 2026 18:36
ymichael pushed a commit that referenced this pull request Dec 2, 2026
## Human comments

## What was wrong

The provider-literal ratchet walked the file system, so files that a
test run leaves in the tree counted as core code. `bb-app`'s
managed-json-process test bundles into
`packages/bb-app/.managed-json-cli-*`. When turbo cancels that test, the
bundle stays, and the ratchet fails until someone deletes it. This is
the third artifact of the kind. The first two got a path exclusion each
(#4064, #4976).

## What changed

- `scripts/check-provider-literal-ratchet.mjs`: `scanTree` lists files
with `git ls-files -z`, so untracked files never count. The same
`isIncluded` filter applies. The file walk is removed, together with the
exclusions that only skipped untracked artifacts
(`.packaged-plugin-build-`, `.runtime-test-`, `.wrangler`). Git tracks
no file under them. A new core file now counts locally after `git add`.
CI scans the committed tree, so the merge check is unchanged.
- `packages/scripts/test/provider-literal-ratchet.test.mjs`: each
fixture is a temporary git repository. `write()` stages the file, and
artifacts are written untracked. A case for
`packages/bb-app/.managed-json-cli-*/bb-app.mjs` is added.
- `.gitignore`: ignores `packages/bb-app/.managed-json-cli-*` and
`packages/plugin-sdk/.runtime-test-*`, like
`apps/cli/.packaged-plugin-build-*`, so `git add -A` cannot commit a
leaked bundle.
- `docs/debugging-and-qa.md`: says that the ratchet counts git-tracked
files.

Why not one more exclusion: it would fix only this artifact. Filtering
on git fixes the class and removes about 20 lines.

## How you verified

| check | main | this PR |
|---|---|---|
| `node scripts/check-provider-literal-ratchet.mjs --base origin/main`
(CI command), untracked `.managed-json-cli-PROBE/bb-app.mjs` present |
`FAILED vs origin/main`, exit 1 | exit 0 |
| same, clean tree | exit 0 | exit 0 |
| git-tracked scan vs file walk on the clean repo | - | identical: 13
references in 6 files |
| new test "does not count the untracked artifact
packages/bb-app/.managed-json-cli-…" | fails | passes (25/25) |

`turbo run typecheck lint test --filter=@bb/scripts` and `oxlint -c
.oxlintrc.type-aware.json scripts .github ./*.ts` pass.

Fixes #8527

> AGENT GENERATED
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