Repository navigation
feat: add right panel tabs for workspace apps and ports - #26208
Conversation
Docs preview📖 View docs preview for |
6e6d829 to
0476e85
Compare
be8f4c3 to
350cef5
Compare
0476e85 to
393908a
Compare
350cef5 to
5f8c3b8
Compare
393908a to
aa8b5f2
Compare
4c7360a to
eb4f9a3
Compare
51b7fad to
0887837
Compare
ef0f871 to
24eae83
Compare
24eae83 to
6beae33
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6beae330aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6beae33 to
2ead90b
Compare
|
@codex review |
|
/coder-agents-review |
|
Chat: Review in progress | View chat deep-review v0.7.1 | Round 2 | Last posted: Round 2, 16 findings (1 P2, 11 P3, 3 P4, 1 Nit), APPROVE. Review Finding inventoryFindings
Contested and acknowledgedCRF-2 (Nit, rightPanelTabs.ts:33) - Mixed indentation on union type closing braces
CRF-3 (P2, PortPreviewPanel.tsx:60) - Port preview iframe loads without active gating
CRF-9 (P3, AgentChatPageView.tsx:529) - display_name ?? slug passes through empty strings
CRF-11 (P3, WorkspacePillPorts.tsx:258) - Protocol snapshot, not live
CRF-14 (P4, AgentChatPageView.tsx:601) - initialCommand sent on every reconnection
Law analysisEffective LOC: 1197. Head SHA: 2ead90b47303. Verdict: Don't split. Enforcement: Advisory. Round logRound 1Panel. 1 P2, 11 P3, 3 P4. 2 Nit (not posted). Reviewed against b1c6010..2ead90b47303. Round 2Churn guard: PROCEED. 11 addressed, 5 contested. Panel: 0 new findings. All 5 contested findings closed unanimously. All 11 fixes verified. Reviewed against b1c6010..90024f74917e. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Clean work. The usePortsData extraction is well-motivated: three consumers on the same query keys without duplication. The discriminated union for UserRightPanelTab is the right type-level encoding. Validation, deduplication, and the raw-vs-filtered persistence split are all sound. The feature gate hides without destroying stored state, which is correct.
Severity summary: 1 P2, 11 P3, 3 P4.
The P2 is about port preview iframes loading immediately even when the tab is not active, unlike the WorkspaceAppFrame pattern which gates on an active prop.
"When you're chatting with an AI agent that's building a web app, and it says 'I updated the page layout,' you want to see it right there. Not in another browser tab you forgot about." (Luffy)
site/src/pages/AgentsPage/components/WorkspacePill.tsx:87
P3 [CRF-6] Inline port-forwarding gate diverges from canShowPortsMenu. This PR introduces canShowPortsMenu(agent, host) in WorkspacePillPorts.tsx:40 as the canonical gate, and two other call sites already use it. But WorkspacePill.tsx still inlines:
const portForwardingEnabled =
host !== "" && builtinApps.has("port_forwarding_helper");The inline version uses host !== "" while canShowPortsMenu uses host.trim() !== "", so the two copies disagree on whitespace handling. This file was already touched by the import change. Replace with canShowPortsMenu(agent, host).
(Robin, Zoro)
🤖
🤖 This review was automatically generated with Coder Agents.
|
Re CRF-6 (from the review summary, no inline thread since |
|
/coder-agents-review |
There was a problem hiding this comment.
All 16 findings from round 1 are resolved: 11 fixed in 90024f7, 5 contested and closed by unanimous panel vote.
The fixes are solid. CRF-6 (inline gate divergence) was generalized into a shared canShowPortsMenu utility with its own tests rather than a one-site patch. CRF-13 (story callback wiring) was fixed with full click-and-assert coverage for all four callback types. The port range guard, exhaustive switch, storage round-trips, and PortPreviewPanel play functions all address root causes.
The contested defenses held up under scrutiny. CRF-3 (iframe load gating): the panel verified that WorkspaceAppFrame.active is CSS-only and SidebarTabView mounts all panels eagerly, making the concern symmetric and architectural. CRF-9 (display_name ?? slug): confirmed omitempty on the Go struct prevents empty strings on the wire. CRF-14 (initialCommand on reconnect): Razor traced the contract to reconnectingpty/server.go LoadOrStore, confirming the backend ignores the command for existing tokens.
CI has a lint failure (run 80977494893) that should be checked before merge.
"I came looking for hidden couplings between the persisted tab state and the live workspace. The validation layer handles every transition I probed: app disappears, app changes embeddability, agent disconnects, wildcard hostname changes, port stops listening. The code held up." (Hisoka)
🤖 This review was automatically generated with Coder Agents.
| /** | ||
| * Used by both the workspace port-forward button and the AgentsPage right-panel | ||
| * ports menu so they stay on the same query keys and refresh cadence. | ||
| */ | ||
| export const usePortsData = ( |
There was a problem hiding this comment.
I'm slightly less opinionated but Kayla often pushes hard against having very single use hooks. I know we have a handful in the site and I'll be honest to saying I'm not entirely sure when we should and should not use them.
This one has been promoted from our silo'd AgentsPage/ into the proper frontend, and I'm hesitant to approve it.
Typically a suggestion would be: Just use a function that takes in the data required (obtained by useQuery) instead of creating a hook.
There was a problem hiding this comment.
Typically a suggestion would be: Just use a function that takes in the data required (obtained by useQuery) instead of creating a hook.
The hook is as much of an abstraction for calling two useQuerys as much as it is an abstraction for the output filtering work IMO.
I haven't written enough React to have much of an opinion here, but it seems reasonable to me in theory, given it's unifying the queries with those in PortForwardButton.tsx from the workspaces page.
On the other hand though, the hook's not exactly a huge saving of LOC 🤷
8ddce6c to
dc23d64
Compare
dc23d64 to
e5b95b9
Compare
Extend the Coder Agents right-panel add-tab control so users can open embeddable workspace apps and forwarded ports as right-panel tabs alongside terminals. The add-tab dropdown now lists the agent's visible workspace apps and a Ports submenu. Command apps (e.g. Claude Code) open as a renamed terminal tab running the app's command; embeddable subdomain apps open in a WorkspaceAppFrame tab; non-embeddable apps fall back to the normal app launcher. Selecting a listening or shared port opens a PortPreviewPanel tab built from the port-forward URL. The Ports submenu reuses the existing WorkspacePillPorts data hook and menu items, extended with an optional create-tab callback, instead of duplicating the port-forwarding query and rendering logic. Add the workspace_app and port variants to the right-panel tab model with hydration validation that drops app tabs whose app no longer exists and port tabs when wildcard access is unavailable, and document the feature.
…erminal numbering
e5b95b9 to
fce8738
Compare
The workspace-app and port preview tabs in the Coder Agents right panel
were previously gated behind a `devel` prerelease build check, which
can't be toggled in real deployments.
This replaces that check with a proper `agent-app-tabs` deployment
experiment, registered in `ExperimentsKnown`, so the feature can be
enabled via `CODER_EXPERIMENTS=agent-app-tabs` like any other
experiment. The frontend now reads
`experiments.includes("agent-app-tabs")` from the dashboard instead of
`getPrereleaseFlag(buildInfo) === "devel"`.
Depends on #26208

Adds workspace app and forwarded port tabs to the AgentsPage right panel, so app previews and port views can sit alongside terminals while working in the chat view.
usePortsDatahook keeps the add-tab control, workspace pill, and existingPortForwardButtonon the same port queries and refresh cadence.App and port tabs are limited toTODO: I'm just gonna switch to a backend experiment.develbuilds for now; terminal tabs remain generally available. This was done in favour of adding a backend experiment for a frontend-only feature.Closes CODAGT-346