Skip to content

fix(web): open pull request markdown links in the panel - #10623

Merged
juliusmarminge merged 2 commits into
mainfrom
open-pr-links-in-panel
Sep 8, 2026
Merged

fix(web): open pull request markdown links in the panel#10623
juliusmarminge merged 2 commits into
mainfrom
open-pr-links-in-panel

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 8, 2026

Copy link
Copy Markdown
Member

Pull request links in PR descriptions, comments, and editor previews could leave the current panel, and code review comments lost the surrounding chat thread. They now use chat's PR link handler with the correct panel and environment. The PR page keeps its URL selection in sync without resetting list filters; Cmd/Ctrl-click keeps the external-browser behavior.

Verified with 93 focused tests and the web typecheck. The new regression fails on the original code because the panel remains empty, then passes with this change. Targeted lint and React Doctor report only existing warnings. Web and desktop share this renderer; mobile has no PR detail panel.

Browser interaction evidence is being collected.

Implemented with GPT-6 in Codex.

Note

Open pull request markdown links in the panel instead of navigating away

  • PullRequestMarkdownContext changes from a nullable repository URL string to an object carrying both the repository URL and an optional thread reference, so nested markdown knows which panel it lives in
  • ChatMarkdown gains an optional pullRequestPanelRef prop and passes the active environment ID when resolving change-request links, letting links from environment-owned markdown select the matching project
  • useOpenChangeRequestLink resolves the panel reference independently from the thread; when a thread exists, links open in that panel, and standalone opens navigate the pull-requests route with preserved list filters and resolved project/environment
  • Risk: PullRequestMarkdownContext consumers that read the context value as a plain string will break — they must now read .repositoryUrl off the context object

Macroscope summarized b9d8dc9.

Summary by CodeRabbit

  • New Features

    • Pull-request links now open in the appropriate pull-request panel and navigate to the relevant page.
    • Links opened from previews preserve the current thread and code-comment context.
    • Pull-request navigation now remains synchronized across environments and selections.
  • Bug Fixes

    • Improved handling of bare pull-request references and unavailable repositories.
    • Modified-click behavior continues to use the browser’s standard handling.
  • Tests

    • Added coverage for pull-request link navigation, context inheritance, validation, and click behavior.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 8, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b9d8dc9

Macroscope's review found this PR approvable — This is a focused four-file web bug fix that connects existing pull-request markdown links to the appropriate existing panel while preserving environment selection, filters, and external modifier-click behavior. Its runtime impact is localized to link navigation and does not alter schemas, product defaults, deployment, or sensitive code.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All clear

Posted via Macroscope — Effect Service Conventions

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: b30a3e4e-ddcf-4024-bf64-cc491f807090

📥 Commits

Reviewing files that changed from the base of the PR and between e0e0bcb and 3fd3fac.

📒 Files selected for processing (5)
  • apps/web/src/components/ChatMarkdown.tsx
  • apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
  • apps/web/src/components/pullRequest/PullRequestMarkdown.links.test.tsx
  • apps/web/src/components/pullRequest/PullRequestMarkdown.tsx
  • apps/web/src/lib/openPullRequestLink.ts

Included review availability: 6 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

Pull-request markdown now carries repository and thread context into ChatMarkdown. Link handling accepts an explicit panel reference, applies environment-aware navigation, and preserves existing click behavior. Tests cover panel routing, thread inheritance, reference resolution, and unavailable repositories.

Changes

Pull-request link routing

Layer / File(s) Summary
Markdown context wiring
apps/web/src/components/pullRequest/PullRequestMarkdown.tsx, apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx, apps/web/src/components/ChatMarkdown.tsx
The markdown context now includes repositoryUrl and threadRef. ChatMarkdown accepts and forwards pullRequestPanelRef.
Panel-aware link opening
apps/web/src/lib/openPullRequestLink.ts, apps/web/src/components/ChatMarkdown.tsx
Change-request links prefer the supplied panel reference, apply cross-environment settings, and navigate standalone openings with pull-request selections.
Link behavior validation
apps/web/src/components/pullRequest/PullRequestMarkdown.links.test.tsx
Tests cover panel opening, thread inheritance, bare reference resolution, modifier clicks, and unavailable repositories.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 3fd3f

Pull-request links now route to the appropriate panel while preserving thread context, environment selection, list filters, and modified-click browser behavior. No concrete merge-blocking risk remains.

Suggested reviewers: maria-rcks, bil0000, t3dotgg

Sequence Diagram(s)

sequenceDiagram
  participant PullRequestMarkdown
  participant ChatMarkdown
  participant useOpenChangeRequestLink
  participant PullRequestPanel
  PullRequestMarkdown->>ChatMarkdown: provide resolved threadRef and panelRef
  ChatMarkdown->>useOpenChangeRequestLink: handle change-request link
  useOpenChangeRequestLink->>PullRequestPanel: open pull request with environment and selection filters
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: opening pull request markdown links in the panel.
Description check ✅ Passed The description is detailed and directly covers the change, motivation, verification, interaction behavior, and platform scope. It does not use the template headings or include completed UI evidence a…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch open-pr-links-in-panel

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.6 KiB +61 B (+0.4%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB +4 B (+0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.6 KiB +57 B (+0.9%) 7.8 KiB
Codex Live turn WebSocket decoded 57.0 KiB 57.1 KiB +88 B (+0.2%) 66.4 KiB
Codex Live turn messages 8 10 +2 (+25.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB +46 B (+0.3%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB +4 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.5 KiB +42 B (+0.6%) 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 57.9 KiB +88 B (+0.1%) 66.4 KiB
Claude Live turn messages 8 10 +2 (+25.0%) 21

Baseline: e0e0bcb · PR result: b9d8dc9 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@juliusmarminge
juliusmarminge enabled auto-merge (squash) September 8, 2026 00:11
@juliusmarminge
juliusmarminge merged commit d081ab7 into main Sep 8, 2026
26 checks passed
@juliusmarminge
juliusmarminge deleted the open-pr-links-in-panel branch September 8, 2026 00:12
@macroscopeapp

macroscopeapp Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

All clear

Posted via Macroscope — Effect Service Conventions

aorwall added a commit to aorwall/t3code that referenced this pull request Sep 8, 2026
Merges `pingdotgg/t3code` `8b2838e0e..a37c664` — 43 commits.

`343` files landed against `343` changed in the upstream range; fork
delta `723` files. Exact match, so nothing upstream changed was dropped.

Details in
[`docs/fork/upstream-merge-log.md`](../blob/merge/upstream-2026-09-08/docs/fork/upstream-merge-log.md).

## Two fork deltas this merge had to re-apply

**Upstream split the server-update banner into two routes.** pingdotgg#10596
added `useAutoBalanceUpdateBanner` beside the single-machine condition
the fork already gates. The conflict was on the first line only, so
resolving it correctly still left the auto-balance route ungated — an
auto-balanced project would have been offered `npx t3` against a backend
that does not implement `server.updateServer`.
`FEATURES.serverUpdateBanner` now carries two gates in `ChatView.tsx`.

**A new settings page needs a gate even though it degrades politely.**
pingdotgg#8103 added `/settings/snap-shot` for desktop window capture. Every
control drives `window.desktopBridge`, and upstream renders an
"unavailable" notice rather than hiding the page, so a hosted build
listed a sidebar section and six searchable rows for a feature it can
never run. Gated with `FEATURES.snapShots`.

Two smaller fixes: `packages/moatless-api` still ran `tsgo --noEmit`
after upstream replaced `@typescript/native-preview` with TypeScript
7.0.2, and `duplicate-adds.mjs` now skips `pnpm-lock.yaml` (it read
`iconv-lite: 0.6.3` as taken twice; `d3-dsv` and `encoding` each declare
it).

## Usable as-is

- Stop-thread keybinding command (pingdotgg#4308).
- Project import tolerates servers that predate the git-identity scan
(pingdotgg#10547).
- Proactive panels open when entering a thread (pingdotgg#10610); pull-request
markdown links open in the panel (pingdotgg#10623); markdown images navigate as
galleries (pingdotgg#10625); pull-request videos play inline (pingdotgg#10617).
- Settings project scopes are searchable and scrollable (pingdotgg#10570); ref
picker stays steady when opening (pingdotgg#9472); sidebar timer uses
`tabular-nums` (pingdotgg#10592); popup triggers stay steady when pressed
(pingdotgg#9468); settled PR colors restore on hover (pingdotgg#10023).
- Composer Fast mode persists across new chats (pingdotgg#2981); inserted
citations are removed on cancel (pingdotgg#10518).
- TypeScript 7.0.2 (pingdotgg#10663) and the knip desktop-export rules (pingdotgg#10269).

## Unsupported in Moatless / needs implementation

- **Cross-platform window capture** (pingdotgg#8103) —
`apps/desktop/src/snapShot/**`,
`apps/web/src/components/settings/SnapShotSettings.tsx`,
`apps/web/src/lib/desktopSnapShot.ts`. Needs an Electron
`window.desktopBridge`; a browser tab has none. Gated behind
`FEATURES.snapShots` in this PR.
- **Auto-balance server update** (pingdotgg#10596) —
`apps/web/src/components/chat/useAutoBalanceUpdateBanner.tsx`. Needs
`server.updateServer`, which Moatless does not dispatch. Gated behind
`FEATURES.serverUpdateBanner` in this PR.
- **Preview recording transfer** (pingdotgg#10572) —
`apps/server/src/mcp/toolkits/preview/handlers.ts`,
`apps/web/src/browser/browserRecordingUpload.ts`. Moves a finished
preview recording into the agent environment over the desktop bridge.
Adds four error types to `packages/contracts/src/previewAutomation.ts`
and no new RPC method, so no union changed. Sits behind the
`previewAutomation.connect` / `focusHost` / `respond` gap already in the
register.
- **Local media linked from remote threads** (pingdotgg#10619) and **browser
editing shortcuts** (pingdotgg#10621) — Electron shell only.
- **iOS Keychain access group** (pingdotgg#3665) and the mobile provider account
badge (pingdotgg#9899) — the fork ships no mobile build against Moatless.

## Backend behavior to consider reproducing in Moatless

- **Name the usage limit and its reset instead of relaying "out of
credits"** (pingdotgg#10473, `apps/server/src/provider/**` Codex adapter).
Moatless owns its provider runtime, so the clearer limit message has to
be produced there.
- **Report usage limits on retried turns** (pingdotgg#10549, Claude adapter). A
retry currently loses the limit signal; same ownership.
- **Disable executable capabilities in Claude metadata generation**
(pingdotgg#4169, `apps/server/src/textGeneration/ClaudeTextGeneration.ts`). Title
and metadata generation should not be able to run tools. Worth mirroring
wherever Moatless generates thread titles.

## Verification

`verify.mjs`: duplicate-adds, tripwires, resolution-check,
unsupported-methods (0 ADD, 0 DROP, 2 KEEP), fmt, lint and typecheck all
pass.

Tests pass except `@t3tools/desktop`, which cannot compile
`scripts/browser-secret-native.test.mjs` because the sandbox has no
`libsecret-1` — 1283 tests pass, 0 fail, and the file is byte-identical
to upstream. New entry in `docs/fork/gaps.md`. `t3` failed
`GrokAdapter.test.ts` once under parallel load and passes 42/42 alone.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
Moatless task:
https://moatless.soaplabstest.com/tasks/6d8ea486-2fcb-4c25-bd34-dcd15cc4a7ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant