Repository navigation
feat(github): cache and polish pull request loading - #555
Merged
Merged
Conversation
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
from
November 12, 2026 08:28
4c2915b to
e016583
Compare
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
3 times, most recently
from
November 12, 2026 09:10
1151642 to
c171012
Compare
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
from
November 12, 2026 09:10
e016583 to
c52008e
Compare
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
from
November 12, 2026 09:31
c171012 to
409c725
Compare
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
from
November 12, 2026 10:30
c52008e to
f778e39
Compare
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
from
November 12, 2026 10:30
409c725 to
ac895a1
Compare
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
from
November 12, 2026 11:16
f778e39 to
a7d8db2
Compare
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
2 times, most recently
from
November 12, 2026 12:21
ff463e2 to
da3a9a1
Compare
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
from
November 12, 2026 12:21
a7d8db2 to
7f6102d
Compare
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
from
November 12, 2026 12:30
da3a9a1 to
b30acb1
Compare
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
from
November 12, 2026 12:30
7f6102d to
8c55259
Compare
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
2 times, most recently
from
November 12, 2026 12:37
59b7fcf to
5683f91
Compare
nixuuu
marked this pull request as ready for review
November 12, 2026 12:39
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
from
November 12, 2026 12:56
5683f91 to
f6e9408
Compare
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
The PR panel was fixed at one width, diff rows included blank bands, and long commit subjects could stretch the picker over the thread. Reuse the sidebar's accessible ResizeHandle on the panel's left edge, with device-local persistence, a 320–1200 px preferred range, a 576 px reset, and a 384 px minimum thread column. During a drag, requestAnimationFrame updates a CSS variable; state and storage change on release. Keep diff whitespace on code cells so rows remain compact and files scroll horizontally when wrapping is off. Bound the commit menu, preserve the viewed numbers at narrow widths, show event descriptions, and omit missing relative times. Preserve PR numbers and long Summary content at narrow widths. Hide MentionedEvent, SubscribedEvent and UnsubscribedEvent regardless of whether they contain actor/time fields. Share this filter between gateway projection and web/mobile activity so previously cached entries are hidden too. Unsupported union members with no date/content remain hidden. Actor and time come from the payload's actor/author and createdAt fields. Add fixtures for type-only and metadata-bearing noise, plus a gateway integration scenario that preserves pagination past a noise-only page and verifies payload identity/time and an undated comment. Stack: layer 1, targets dev. Layer 2 is #555, based on this branch, and adds payload avatars, loading/cache polish, check action menus and mobile parity. Both layers are submitted together for the maintainer to merge after CI passes. Validation: - Rebased both layers onto dev with gh stack and pushed. bun install and gen:check pass. Focused gateway cache/polling/timeline integration tests: 8 pass, 0 fail, 38 assertions. The timeline case verifies noise filtering, pagination past a noise-only page, payload actor/time and an undated comment. Changed-file lint and formatting pass. Full suite, typecheck and builds run in CI; no local check:tmp, per maintainer instruction. - Reviewed the actual gateway/BFF/web in one real browser using mocked GitHub transports: 320–1200 px drag, 576 px double-click reset, arrow/Shift-arrow resizing, persistence on reopen, separator ARIA values, 2001-row diff with 20 px rows, horizontal scrolling and wrapping, bounded 448 px commit menu with 902-character subjects, SHA, ellipsis, full-text tooltip and keyboard navigation, and visible 0/60 at 320 px. - Reviewed Summary/header, mixed Timeline, desktop and 390 px phone sheet in light/dark. Mention/subscription noise is absent; payload actor/time remain, with no empty GitHub/ago rows. No browser requests to GitHub or its avatar CDN. - During an automated long-diff drag, the diff subtree had zero DOM mutations. Shared-host frame samples included 83–100 ms stalls on large width jumps; this is functional browser verification, not a dedicated smoothness benchmark. Copy audit (§8): new “Resize pull request panel” names the control and keeps keyboard/ARIA values; narrow “X/N viewed” → “X/N” preserves the numbers and an accessible label; empty “GitHub / ago” → omit mention/subscription noise, unsupported blank entries and missing times, including cached data; event type names → sentence-case actions (“Requested a review”, “Changed the title”, “Added a label”, branch/assignee equivalents). Existing Glossary terms retained; no new errors, destructive confirmations or humour. The explicit noise filter adds no UI labels. Short, typical and long text reviewed statically and visually at desktop, narrow and phone widths, light and dark.
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
2 times, most recently
from
November 12, 2026 13:20
f921377 to
79af354
Compare
nixuuu
force-pushed
the
feat/pr-panel-loading
branch
from
November 12, 2026 13:37
79af354 to
a0d9d0a
Compare
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
Concurrent avatar reads could fetch the same image twice. The shared cache client checked its in-flight map after asynchronous cache I/O, and a second service could reacquire a released SQL lease without reusing a fresh result if the first fill completed before its generation sample. Register the shared promise before cache I/O and recheck freshness after acquiring the SQL lease. Keep forced refreshes separate from ordinary cache reads, and remove promises and controllers on either success or failure. This common client also handles cached PR resources; owner/account/access-revision boundaries and credential-free image requests remain intact. The avatar integration fixture now gates upstream responses. A regression holds an independent service's cache miss until the first service has completed its fill, then verifies that both responses share one upstream image fetch. It matches the canonical avatar URL, including the proxy's `s=64` parameter. The initial regression test used the raw URL's hash, so its gate never matched and it deadlocked; the production fill was waiting for the test to release upstream. Each shared fill has a 55-second deadline. Timeout aborts it, clears its flight entry, and releases the fenced SQL cache lease even if an upstream transport ignores cancellation. A waiter can attempt one replacement fill; another timeout surfaces an error. Gated integration cases cover a successful replacement, a stalled replacement, and subsequent cache recovery. Existing coverage checks concurrent callers, persisted reuse, bot identity, owner scoping, absent credentials and retry after image rejection. Validation: the specifically authorized `nice -n 19 bun test tests/integration/github-panel-cache.test.ts` passes all 9 tests. Changed files pass spacing autofix, oxlint, oxfmt and `git diff --check`. No full local test suite, typecheck, builds or install ran while the host performance measurement is active. CI verification is pending, including a full workflow rerun after the first clean run on the final head. Copy audit: new timeout error, `Loading GitHub data timed out. Try again.` It states the outcome and the next action in two short sentences, uses sentence case and plain words, and does not depend on names, icons or color. No controls or layout changed. Fixes: #555
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
## Change The pull request panel now scrolls its header, tabs and content together. After the full header scrolls away, a compact sticky bar retains the PR state, repository and number, truncated title with tooltip, check status, primary lifecycle action, menu and close button. The tabs, Timeline filter and Code controls stack below it with opaque backgrounds. The full header keeps its flow height, so switching to the compact bar changes neither the content offset nor scroll position. IntersectionObserver supplies a 16 px hysteresis band; ResizeObserver updates dimensions on resize. The transition uses existing motion tokens and becomes instant with reduced motion. Each tab retains its own session scroll position. The compact primary action shares the original lifecycle controller and confirmation dialog. Long action labels truncate within the compact button without covering the menu. This applies to web/desktop and the phone-width web sheet. Native mobile has a separate virtualized-list layout whose headers already scroll with their lists; its code is unchanged. Rebased onto dev after #589. Related: #551, #555 ## Verification - Dependency installation, `bun run gen:check`, full typecheck, lint, format check and web build passed on the review machine. The final build used `nice -n 10`. Final-head CI static checks and web/Linux builds passed; the full test suite with temp-directory checks is running in GitHub CI at the maintainer's request. No web UI tests added. - Fixture-only Chromium review covered a 200-comment timeline, 90-file Code tab with a 1,500-line expanded diff, short PR, long names/title/branches, 320/576/1056 px panel widths, 390 px phone width, light/dark, reduced motion, menu, title tooltip, close and primary-action confirmation. No application errors. No live GitHub calls from the fixture app. Review processes, containers and scratch checkout were cleaned up. - Slow threshold crossings retained the compact state across the 16 px deadband. Content flow position stayed at 300 px through compaction; requested scroll positions did not change. Timeline 1600 px and Code 900 px positions restored on tab switches. Diff scrolling remained horizontal per file; no nested vertical viewport. Reduced-motion transition duration was 0s. Sticky surfaces had no visible gaps or see-through seams. - Chromium 155 Performance traces on the final source: 180 animation-frame samples each. Timeline: 3 layout events totaling 1.038 ms; expanded diff: 0 layout events. Both: 0 long tasks, maximum frame interval 16.8 ms, 0 intervals above 25 ms. Evidence remains outside the repository. - EAS fingerprints before/after, generated locally with `nice -n 19`, are unchanged: iOS `74705db3a68907bc28379bb9b1080a227bc0755b`; Android `7d38be8f5c9bf842d62060c75820a206f99c87e3`. Copy audit (§8): compact controls reuse existing state, check and lifecycle labels. Refresh remains available in the compact menu (`Refresh pull request`, reused wording). Icons retain accessible labels. Truncation retains the full title in a verified tooltip, the PR number stays visible, and primary actions retain their full accessible labels and tooltips. Short and long text was checked at narrow, wide and phone widths. No new errors, empty states, glossary terms or humorous copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening or refreshing a pull request could replace content with loaders, lose the current reading state, and repeatedly fetch unchanged resources. Bot actors also lost their identity/avatar, while every check showed three permanent icon actions.
Reuse the existing owner/account/access-scoped durable GitHub cache, real REST ETags and SQL single-flight leases. Serve expired pages while revalidating, keep client pages and presentation state across panel reopen, preserve keyed rows and expanded replies, and show skeletons only before the first result. Visible completed/open PRs share one conditional REST request slot every 60 seconds across metadata, check-runs and legacy commit statuses. With one page per resource each endpoint is revisited about every three minutes; this deliberately meets the aggregate five-request budget rather than polling all three every minute. Only resources with running checks get the faster 15-second schedule. Respect upstream x-poll-interval. Merged/closed PRs and hidden panels/windows do not poll. Stream renewals and the maintenance sweep share deadlines and single-flight; hiding the last observer aborts its in-flight probe. Timeline/reviews refresh on metadata changes, files/commits on SHA changes, or through explicit refresh/mutations. Unchanged signals never trigger periodic GraphQL reads. Check changes update the check summary without fetching PR metadata.
Preserve payload avatar URLs and bot logins including [bot]. Fetch raster avatars through an authorized gateway RPC and the durable cache, with a fixed CDN allowlist, no credentials or cookies, no redirects, bounded size and timeout. Initials are an opaque fallback. Read-only markdown task boxes keep normal contrast. Replace check icons with a compact labeled action menu, reserved row space, and applicable actions. Apply equivalent loading, avatar and action changes on mobile using TypeScript only; native configuration and dependencies are unchanged.
Based directly on dev after #551 was squash-merged and #559 added the remote thread panel. This PR contains only the loading/cache/avatar/check-action changes; the merged resize, diff/commit-picker and timeline layout fixes remain in dev. Rebase resolution preserves the repository account-access controls, Link pull request picker route and all remote connector/schedule RPCs from #559.
Validation:
PullRequestNotices, preserving sibling layout and copy. The complete repositorybun run lintpasses with the 120-line function limit enabled. Local nightly fingerprints before/after the extraction are identical on both iOS (6ddec9ef559ee0095ac33e94ff9418a942053b17) and Android (5f6eae3ab278f1cd543e9ed763f923a319b65ec9). No native configuration or dependencies changed.Request measurements (mock transport, five simulated minutes, fixed +5% jitter):
The previously reported 27 → 27 was an open PR with running checks, not completed/idle CI. Replaying that exact continuous-stream harness against the previous #555 head (5683f91) produces 19 CanopyChecks + 4 CanopyPullRequest + 4 CanopyTimeline = 27 POST /graphql requests; 27 HTTP 200, zero conditional requests, zero 304. The old cache avoided reopen work but did not reduce this periodic GraphQL traffic. That was insufficient for the intended freshness policy.
The following apples-to-apples comparison includes 90-second stream renewals and a maintenance sweep on every simulated wait, for both versions. Before = previous #555 head, after = this correction. Metadata was already verified during PR linking. Counts cover the visible PR watch, excluding authentication/discovery, avatars and user-triggered tab/file/page loads. Cold validator setup is deliberately counted on first open; unchanged idle traffic after the fix is entirely conditional (If-None-Match).
Endpoint breakdown for that comparison:
REST check/status pages use per_page=100&page=1 in this fixture. First-open requests before were one GraphQL Checks and one Timeline; after they are three REST 200s priming metadata/check-runs/status validators (none for terminal PRs). The new watch does not eagerly load Timeline or Checks pages. The renewal-aware baseline differs from the original continuous-stream 27 because the old scheduler/cache deadlines reset on reconnect; both ledgers are reported separately rather than conflated. Targets are met: completed 4 ≤ 5, merged/closed 0, hidden 0; fast running polling is restricted to check resources. Tests also exercise legacy pending statuses, the upstream minimum interval, concurrent sweeps, metadata/check invalidation and last-observer cancellation. No real GitHub product API was contacted.
Copy audit (§8):