Repository navigation
feat(github): resize the pull request panel - #551
Merged
Merged
Conversation
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
5 times, most recently
from
November 12, 2026 12:21
a7d8db2 to
7f6102d
Compare
nixuuu
force-pushed
the
feat/pr-panel-resize
branch
from
November 12, 2026 12:30
7f6102d to
8c55259
Compare
nixuuu
marked this pull request as ready for review
November 12, 2026 12:39
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
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: - Static implementation and copy review completed; additive protobuf contracts regenerated. - Mobile screen lint correction: extracted the summary/error/retry/account-access notices into `PullRequestNotices`, preserving sibling layout and copy. The complete repository `bun run lint` passes 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. - CI Static checks log identified two TS2769 errors at the fixture Request constructors. Explicitly branch between Request and string inputs before calling the overloaded constructor; forward the normalized URL with the original request options to the loopback fixture transport. Regenerated protobuf outputs after resolving the rebase against the merged picker and remote-panel contracts. Extracted the mobile change statistics/checkout row to keep the combined header under the 120-line function limit; rendering and copy remain unchanged. - Added fixture integration coverage for conditional 304 reuse, durable cache after gateway service restart, concurrent single-flight, owner boundaries, bot identity, avatar transport restrictions and no hidden polling. - Added an accelerated-clock fixture measurement for first open, reopen and five visible idle minutes. - bun install and gen:check passed during stack verification. Freshness correction adds fixture coverage for request budgets across 90-second lease renewals plus the maintenance sweep, legacy pending statuses, server poll intervals, completed/terminal transitions, changes-only page invalidation and abort-on-hide. After rebasing directly onto dev: focused gateway/cache/mobile-transport/timeline checks **19 passed, zero failed, 117 assertions**. Changed-file lint and formatting pass. Full tests/typecheck/builds run remotely in CI; no local check:tmp, per maintainer instruction. - Real-browser review used the actual fixture-backed gateway/BFF/web, with one gateway, one web server and one browser. Verified Summary/header including Merge at 320/1200 px, long commits, 2001-row diff, horizontal scroll/wrap, keyboard/reset/persistence, narrow 0/60, mixed timeline with noise removed and claude[bot] using gateway-fetched payload avatars, opaque read-only task boxes, check menus with Re-run / Re-run failed jobs / Cancel according to state, and light/dark desktop plus 390 px phone sheets. No browser requests went directly to GitHub or its avatar CDN. Avatars used opaque red fixture images, not real account images. - Delayed background refresh (1.5 seconds upstream latency) retained 2001 diff rows, expanded state and scrollTop=900 throughout 132 samples: zero diff subtree mutations, no Loading text, no detected layout shifts. Close/reopen retained Code, rows and scrollTop=2300. A new commit resource showed one first-load skeleton region and no visible Loading text. A mocked 503 retained Summary and checks with a compact stale-data message. Added Retry beside stale-data errors in web/mobile; cache expiry alone no longer inserts an offline warning or Retry during background revalidation. - EAS fingerprint engine (@expo/fingerprint, nightly, same project path): iOS **6ddec9ef559ee0095ac33e94ff9418a942053b17**, Android **5f6eae3ab278f1cd543e9ed763f923a319b65ec9**, both identical to the #551 baseline. Mobile changes are JS/TS only; no native configuration or dependencies changed. Native app UI was not exercised; phone coverage above is the web sheet. 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). | PR state | First open before → after | Second open before → after | Five minutes idle before → after | Idle before: 200 / 304 | Idle after: 200 / 304 | | --- | ---: | ---: | ---: | ---: | ---: | | Open, running checks | 2 → 3 | 0 → 0 | 23 → 23 | 23 / 0 | 0 / 23 | | Open, completed checks | 2 → 3 | 0 → 0 | 12 → 4 | 12 / 0 | 0 / 4 | | Merged | 2 → 0 | 0 → 0 | 1 → 0 | 1 / 0 | 0 / 0 | | Closed | 2 → 0 | 0 → 0 | 1 → 0 | 1 / 0 | 0 / 0 | | Hidden panel/window, any state | — | — | 0 → 0 | 0 / 0 | 0 / 0 | Endpoint breakdown for that comparison: | State | Before: POST /graphql operations (all 200) | After: conditional REST GETs (all 304) | | --- | --- | --- | | Running | CanopyChecks ×16, CanopyPullRequest ×4, CanopyTimeline ×3 | /repos/itsoltech/canopy/commits/<head>/check-runs ×19; /repos/itsoltech/canopy/pulls/42 ×2; /repos/itsoltech/canopy/commits/<head>/status ×2 | | Completed | CanopyChecks ×6, CanopyPullRequest ×3, CanopyTimeline ×3 | /repos/itsoltech/canopy/pulls/42 ×2; /repos/itsoltech/canopy/commits/<head>/check-runs ×1; /repos/itsoltech/canopy/commits/<head>/status ×1 | | Merged / closed | CanopyPullRequest ×1 each | None | | Hidden | None | None | 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): - Repeated “Loading…” messages → first-load skeletons and one reserved header refresh control, so background updates keep content readable. - Three icon-only check controls → “Check actions” menu with “Re-run”, “Re-run failed jobs” and “Cancel”; actions are named and only applicable choices appear. - Ambiguous fallback identity → payload login such as “claude[bot]”; initials remain a visual fallback. - Read failures keep prior content and provide Retry. New wording uses sentence case, short active sentences and existing terminology; no new glossary terms, humour or destructive operations. - Short, typical and long labels reviewed statically and visually at desktop, narrow and phone widths, light and dark. Retry reuses the existing action label. No new glossary terms, humour or destructive confirmations.
This was referenced Nov 12, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
Focusing the collapsed thread composer fed every intermediate footer height into the timeline spacer and scroll anchoring. Expansion, collapse and draft growth now stay in the bottom overlay, with a fixed reserve for the collapsed input and safe gap. - Observe the fixed footer rail instead of the animated composer. Preserve row measurements, reader intent, streaming follow-end and turn navigation. - Animate one bottom-aligned, clipped composer height using existing motion tokens. Its internal folds switch immediately; reduced motion switches the outer height immediately too. Keep the opaque backing and fade attached to the overlay. - Anchor “Jump to latest” above the collapsed edge and fade it while covered by the expanded composer. - Native thread folding already preserved its reserve, but multiline drafts and attachments still enlarged it. Give thread feeds a fixed collapsed reserve and latest-button anchor, while keeping measured keyboard geometry separate. Mobile changes are JS only. - Update the related Polish layout and performance documentation. Validation passed: `bun install --frozen-lockfile`, `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run format:check`, the web build and `git diff --check`. Svelte reported zero errors and warnings. CI's four test shards, generated-code checks, static checks and builds passed on this head. No web UI test suite was added or run; browser automation was disposable diagnostic tooling. The real seeded thread was reviewed in Chromium 155.0.8059.84 on Linux x86_64 with Bun 1.4.4. Coverage included light/dark, widths 1440/820/390 at height 900, normal/reduced motion, latest/scrolled-up, expansion/collapse, multiline drafts and eight uploaded attachments with long names. All 60 sampled scenarios reported **0 px scroll-position drift, 0 px scroll-height change and 0 px visible-message anchor drift**. The latest button retained its coordinates and became inert while covered. Screenshot review found no horizontal overflow or see-through seams. A focused reduced-motion pass recorded only endpoint heights, with no interpolation. No browser JavaScript errors were observed. The focused Performance trace maps the timeline's 1,734 DOM nodes to CDP backend node IDs and checks `Layout` roots and invalidations during three real expansion/collapse cycles. Marks begin at the composer's state change; collapse follows a real 100 px reader wheel gesture. | Trace interval | Timeline layout events | | --- | ---: | | Expansion 1 / 2 / 3 | **0 / 0 / 0** | | Collapse 1 / 2 / 3 | **0 / 0 / 1** | | Positive control: change a timeline border by 1 px | **1** | Each interval lasted 503–507 ms. Expansion had zero timeline layout invalidations. Each collapse had two timeline invalidations during the reader scroll/range update; the third included one timeline layout. There was no repeated timeline layout during the animation. Composer/global layout continued during its height transition: 18–22 events and 3.986–5.578 ms total per interval. These global events are not counted as timeline layout. The positive control confirms that an actual timeline layout is detected. This is a focused layout result, not a broad CPU or frame-rate benchmark. EAS CLI 27.4.1 fingerprints with the production build profile match the pre-change baseline on both platforms: | Platform | Before = after | | --- | --- | | iOS | `6ddec9ef559ee0095ac33e94ff9418a942053b17` | | Android | `5f6eae3ab278f1cd543e9ed763f923a319b65ec9` | Screenshots, raw trace and diagnostic summaries are retained outside the repository. No native device runtime was exercised. The expanded overlay deliberately leaves the timeline fixed and can cover its bottom rows. UI copy is unchanged; the copy audit for changed strings does not apply. History places the animated-reserve coupling before the recent PRs below; these links provide context rather than identifying a new regression introducer. Related: #497, #551, #554, #568
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
## Change Sidebar project filters, project grouping/order and the Working section now stay on each device. Changing a filter on a phone no longer changes the desktop or web list. Extend the existing typed `@canopy/domain/device-view` helper with these values and a gateway-scoped storage key. Web and Electron use localStorage; mobile uses the already installed Expo document-file storage because filter lists can exceed SecureStore's value limit. Each scope seeds missing values once from the previous local record and legacy account settings. Persisted empty filters, false values and default widths take precedence. Subsequent account updates only affect pins. Existing proto fields and DB data remain readable and writable by old clients; linked-computer config sync excludes the view fields in both directions. Web scopes are opaque hashes of the BFF gateway target; remote desktop uses the pinned gateway certificate. Mobile scopes include the pinned certificate and pairing device ID, so route changes keep the same scope and another pairing cannot reuse it. Native dependencies, app configuration and native sources are unchanged; this is JS-only on mobile. ### Preference audit | Preference | Decision and reason | | --- | --- | | Sidebar project filter, including mobile | Move to device/gateway storage: it selects the list currently being viewed. This checkout has a project picker, with no independent persisted computer/status filter. | | Sidebar project grouping, project order, Working section | Move to device/gateway storage: these organize the current list. Thread priority/activity sorting remains deterministic and has no separate saved preference. | | Archived thread/bot disclosure | Already local; add gateway/pairing scope because disclosure belongs to the current workspace view. The deprecated archived-mode flag remains ignored. | | Sidebar collapse/width | Already local; add gateway/pairing scope so another gateway cannot reuse its layout. Stop applying legacy account geometry in the HTML shell. | | Thread panel collapse | Already local; add gateway/pairing scope for the same layout isolation. | | PR panel width (#551) | Already local, despite the per-user description; retain it in the shared helper and add gateway scope. | | Timeline density, default activity expansion, manual folds | Already client preferences or in-memory state; leave local because they describe how this device presents the transcript. | | Last-open Settings section | Already route/tab or window memory; keep it transient and client-side. | | Updates popover disclosure | Already component state, with automatic opening for running updates; keep it client-side. Actual update policies remain unchanged. | | Theme, light/dark palettes, thread reading width | Keep account sync: these express the user's preferred appearance and reading measure, independently of panel geometry. | | Thread/bot pins | Keep account sync: they organize the user's resources across devices. Pin writes preserve legacy view fields for older clients without changing them. | | New-thread defaults, access/permission modes, Steer/Queue, confirmations and other behavior settings | Preserve their existing account sync: they control agent or application behavior. | | Notifications and keybindings | Preserve their existing scope. This checkout already stores notification delivery preferences and keybindings per device; changing those behavior settings or introducing new synchronization is outside this view-state fix. | Updated `docs/ui-api.md`, `docs/mobile.md` and `docs/settings-map.md` to describe the storage boundary and remove the previous account-scoped sidebar guidance. ### Copy audit (§8) Web and mobile Sidebar settings description: `Account` → `This device`, matching the new scope. Existing glossary term, sentence case, no new controls/errors/actions, no new dynamic text or color-only meaning. Reviewed the settings copy and short/typical/long names at desktop and phone widths in light and dark. Other copy and layout are unchanged. ## Verification - Reviewed the changed persistence paths and confirmed the gateway still accepts legacy settings. Added/updated integration scenarios for one-time migration, empty/default local overrides, device and gateway isolation, pins following account updates, partial old local records, and linked-computer exclusion with old-client writes still accepted. - On an isolated review machine: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run format:check`, and `bun run --filter @canopy/web build` pass. Ran the repository formatters and fixed spacing findings. `git diff --check` passes. - Focused integration tests: `device-view`, `config-sync`, `config-sync-recovery`, and `github-panel-cache`: **23 pass, 0 fail, 176 assertions**. The recovery test now waits for a newly synced pin instead of an already-set confirmation flag. No web UI tests were added. - Real Chromium, two persistent isolated profiles on the same gateway: both seed the old Alpha filter, Name grouping/order, Working section and 312px sidebar once. Profile A's filter, grouping/order and Working changes leave B unchanged and survive reload. A later legacy gateway write does not override either migrated record. Phone-width filter changes also remain independent after reload. Pinning still reaches the other profile. Filtering and layout edits leave the account settings version unchanged. - Browser layout checks: independent sidebar widths (344/312px), sidebar collapse, thread-panel collapse, archive disclosure, and PR-panel widths (608/576px) survive reload. PR width was exercised with an unavailable-PR panel; authenticated PR content was outside this fixture. Reviewed light/dark desktop and phone layouts with short, typical and long project/thread names. Unpinning also propagates live to the other profile without reloading. No uncaught browser errors; the unavailable PR produces the expected failed-resource responses. Both browser sessions, the review processes/container, and the review checkout were removed; assigned ports are free. - Native fingerprints generated with the Expo/EAS fingerprint engine for base and head, same checkout path and nightly environment: **iOS `6ddec9ef559ee0095ac33e94ff9418a942053b17`**, **Android `5f6eae3ab278f1cd543e9ed763f923a319b65ec9`**; both unchanged. No native mobile simulator/device review was performed. The sidebar filter has been synced since the original sidebar implementation (`31fe41992`), before the recent PRs; no recent introducing PR was found. The references below are context only. Related: #452 Related: #551
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.
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:
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.