Skip to content

Add in-app pull request tracker - #113

Open
tirsen wants to merge 13 commits into
mainfrom
tirsen/in-app-pr-tracker
Open

Add in-app pull request tracker#113
tirsen wants to merge 13 commits into
mainfrom
tirsen/in-app-pr-tracker

Conversation

@tirsen

@tirsen tirsen commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates squareup/berd#1089 from the archived internal repository onto the current public repository.

Stack Info: Stacked on #115.

The original implementation and commit authorship remain attributed to Lauren Kenny. Migration-specific changes resolve conflicts with the current top bar and experiment registry and move Goose state-directory resolution into the always-available goose_config service so public builds compile without the internal feedback feature.

Related issue

  • Original archived PR: squareup/berd#1089
  • No current block/berd duplicate found.
  • Relevant architectural laws were reviewed; this feature does not alter the durable chat or agent invariants currently captured in LAWS/.

Testing

  • just check
  • just tauri-check
  • Pre-push just clippy
  • 49 focused Vitest tests covering Work Status, experiment settings, and the shared chat scroll container
  • 3 focused Rust PR-tracker tests

Original PR description

Category: new-feature
User Impact: Users can track their open pull requests and review status from a resizable popover in Berd’s top bar.

Problem: Pull request status lives outside Berd, making it harder to keep track of reviews and failing checks while working in chats. The longer-term Work Status concept also needs clear, platform-specific direction before adding menu-bar surfaces.

Solution: Add an experiment-gated in-app PR tracker that groups PRs by the Berd project of the session that created them, surfaces key review/check states, and handles loading, empty, disconnected, and failure states. This PR also documents the three planned product tracks; it intentionally contains no native macOS or Windows menu-bar implementation. Those surfaces will ship in later follow-up PRs.

demo1.mov
states2.mov

Scope

  • Included: in-app Pull Requests popover and the three-track platform plan.
  • Not included: macOS menu bar popover implementation or Windows system tray flyout implementation.
  • Follow-ups: implement the native macOS Work Status popover and Windows Work Status flyout in separate PRs.
File changes

docs/work-status-platform-surfaces.md
Defines the in-app, macOS, and Windows tracks and explicitly leaves native menu-bar surfaces to follow-up PRs.

src-tauri/src/commands/mod.rs
Registers the backend module used by the in-app tracker.

src-tauri/src/commands/pr_tracker.rs
Adds constrained GitHub CLI querying, secure GitHub URL opening, and project association through the originating Berd session.

src-tauri/src/lib.rs
Exposes the in-app PR tracker commands to the renderer.

src-tauri/src/services/log_export.rs
Shares Berd’s platform-aware Goose state-directory resolution with PR-to-session matching.

src/app/ui/TopBar.tsx
Adds the experiment-gated Pull Requests control to the top bar.

src/features/chat/ui/MessageTimelineScrollContainer.tsx
Moves the existing chat scrollbar behavior onto the shared scroll-intent component so the PR tracker can match it exactly.

src/features/design-system/generated/componentManifest.ts
Regenerates the design-system manifest for the new shared component.

src/features/experiments/tests/ExperimentsSettings.test.tsx
Covers the PR tracker experiment registration, default-on state, and opt-out behavior.

src/features/experiments/experimentDefinitions.ts
Registers the default-enabled PR tracker experiment.

src/features/work-status/PullRequestsPanel.tsx
Implements project-grouped PR rows, status presentation, collapsible sections, loading/empty/error designs, and dev-only state previews.

src/features/work-status/PullRequestsPopover.tsx
Provides the top-bar trigger, capped notification badge, reset-on-open default height, and vertical resizing.

src/features/work-status/WorkStatusBridge.tsx
Refreshes PR data while the experiment is enabled.

src/features/work-status/githubPullRequests.ts
Queries open authored PRs and maps GitHub review/check state into the tracker model.

src/features/work-status/statusModel.ts
Defines user-facing pull request status labels.

src/features/work-status/types.ts
Defines the in-app tracker’s typed snapshot and item contracts.

src/features/work-status/workStatusData.ts
Builds the PR-only snapshot consumed by the popover.

src/features/work-status/workStatusNative.ts
Wraps the minimal Tauri command needed to open PR URLs.

src/features/work-status/workStatusStore.ts
Stores the current PR snapshot and refresh timestamp.

src/main.tsx
Mounts the experiment-aware PR refresh bridge in the main renderer.

src/shared/i18n/locales/en/settings.json
Adds English experiment settings copy.

src/shared/i18n/locales/es/settings.json
Adds Spanish experiment settings copy.

src/shared/ui/scroll-intent-area.tsx
Extracts the subtle, intent-revealed scrollbar behavior shared with chat sessions.

src/shared/ui/sidebar-tokens.ts
Adds a shared compact row inset used by the tracker.


Update Aug 19, 19:05 CEST: Stacked the tracker on #115 and addressed the shared-row review feedback.

  • Both PR surfaces now render PullRequestListItem for consistent repository, number, title, status, external-link, hover, and focus treatment.
  • Kept each feature’s grouping, data fetching, status mapping, and URL-opening behavior separate.
  • Full Vitest: 1,422 suites passed; 6,679 tests passed; 1 skipped.
  • just check, just tauri-check, just clippy, and pre-push validation passed at 84bd48bd.

Generated with Codex

@tirsen
tirsen marked this pull request as ready for review August 19, 2026 16:41
@tirsen
tirsen requested a review from a team August 19, 2026 16:41
loganj
loganj previously requested changes Aug 19, 2026

@loganj loganj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖

Reviewed at exact head dca08da4f1254dc6d0ea008de6e7c6f73c1739f6. The subprocess, IPC-validation, SQL-parameterization, timeout, and URL-boundary work is unusually careful, and the scroll/state-dir refactors are coherent.

Update after discussion: I am withdrawing my earlier findings about transcript-based project association and stale PR rows after authentication loss. The remaining concern is the default 30-second polling behavior and its database-query cost.

Blocking behavior

The production-default experiment continuously polls GitHub for every user without an explicit override.

src/features/experiments/experimentDefinitions.ts:89-93 sets defaultEnabled: true. This is not dev-only: resolveAutoEnabled returns autoEnable || defaultEnabled, and experimentPreferences.test.tsx:219-230 explicitly asserts that a defaultEnabled: true experiment is enabled with DEV=false. That mounts WorkStatusBridge, whose initial request and 30-second interval (WorkStatusBridge.tsx:76-78) repeatedly shell out to gh api graphql.

Please remove the production default-on override, increase or otherwise avoid the unconditional 30-second polling cadence, or document the explicit product decision and a bounded polling design.

Performance risk worth investigating

WORKSPACE_CANDIDATES_QUERY (src-tauri/src/commands/pr_tracker.rs:31-79) joins and aggregates the complete messages history before applying the 25-workspace limit on every enabled refresh. The outer timeout limits waiting but may not bound the SQLite work itself. Please investigate the query plan against a realistically large history and, if it confirms the risk, move bounded/indexed activity selection ahead of full aggregation or otherwise avoid repeatedly rescanning all messages.

The nine GitHub checks were green at the reviewed head. Independent Blox validation also reported full Vitest (566 files / 6,668 tests, 1 skipped) and the sanctioned Tauri test recipe passing. Those checks did not establish the production polling/query-cost behavior above.

tirsen and others added 13 commits August 19, 2026 18:46
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Extract the PR identity, status, and external-link treatment so the session rail and tracker can render the same recognizable row.

Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
Render tracker entries through the same presentational component as session-related pull requests while keeping tracker-specific data fetching and URL handling separate.

Co-authored-by: Jon Tirsen <tirsen@squareup.com>
Signed-off-by: Jon Tirsen <tirsen@squareup.com>
@tirsen
tirsen force-pushed the tirsen/in-app-pr-tracker branch from dca08da to 84bd48b Compare August 19, 2026 17:05
@tirsen
tirsen changed the base branch from main to tirsen/session-related-prs August 19, 2026 17:06
@loganj
loganj dismissed their stale review August 19, 2026 17:07

Dismissing the blocking state per repo-owner policy: our agent reviews post findings as comments, never as Request Changes. The findings above stand as review comments for the author to weigh.

loganj
loganj previously approved these changes Aug 19, 2026

@loganj loganj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on the presumption that we make it -not- default-on for everyone.

Base automatically changed from tirsen/session-related-prs to main August 21, 2026 07:07
@tirsen
tirsen dismissed loganj’s stale review August 21, 2026 07:07

The base branch was changed.

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.

3 participants