Repository navigation
feat(work-panel): open plan and goal artifacts in the bundled file view - #621
Merged
Merged
Conversation
The contract approval card's opener handed the immutable .pi/plan or .pi/goal markdown to the host file tab, while every other project file the conversation names already opens in the bundled pi.file-manager view, so a plan or goal landed in the one surface the user does not browse project files in. Both callers now pick their tab through one preference helper: the file view when it is launchable, the host file tab otherwise. The chat file-reference hook shares the same launcher check instead of repeating it, and the decision log records the amendment as D452. Renderer only; the approval reveal keeps creating or activating a tab in its originating session.
The English decision log gained the D452 row and two specs gained a clause about which surface opens a plan or goal artifact, but the Chinese mirrors kept their old shape. The docs test compares table shape between every English page and its zh-CN mirror, so the missing row failed 'every English specification has a valid Chinese mirror'. Mirror the row and both clauses so the pair stays structurally and semantically in sync.
…tore bootstrap opened each pending plan's artifact before the renderer had read the launchable plugin views, so a restart or reload with a live approval fell back to the host file tab and then took a second tab when selectSession restored the same proposal. Refresh the view list before that loop, which is what the surface choice needs. Also record the surface's consequence: the bundled file view can edit and save the artifact, so a plan changed before Approve fails the host's recorded-hash check (PLAN_ARTIFACT_HASH_MISMATCH) until the proposal is resubmitted, and align the E2E wording with 'not launchable'.
…tore The previous assertion only required the view refresh to appear within 400 characters before some openPlanArtifact call, which a move into the restore loop itself would still satisfy, and nothing covered the slice call sites that forward the live list. Pin the bootstrap order instead - the refresh, then the pending-plan loop, then the first artifact open - and require both slices to pass get().pluginViews.
The same 'for (const proposal of activePendingPlans)' shape also runs once before the set({ ready }) that precedes the restore, so a plain indexOf matched the planning-state loop and the new assertion failed for the wrong reason.
Search from the refresh index instead, which finds the restore loop and the artifact open it guards.
PR #609 removed the tool-result Review gate but left present-tense claims that a tool result or a conversation artifact still opens, creates, or activates Review: two ADRs, the ADR 0019/0042 work-panel notes, the E2E-058 expectation, the screenshots guide, and stale zh-CN mirrors of two UX pages. Rewrite them to the shipped rule - Review opens only on explicit user action - and name the plan/goal artifact's host-chosen view (D452) in the one source comment that described who opens a work-panel view. No behavior, protocol, or decision-ID change.
vastsa
added a commit
that referenced
this pull request
Sep 19, 2026
feat(work-panel): land PR #621 plan artifacts in the file view
This branch was successfully deployed
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.
What changed
A plan or goal approval artifact used to open in the host file tab while every
other project file the conversation names already opens in the bundled
pi.file-managerview, so one file family travelled through two surfaces andthe approval opener missed the file view's preview and editing support.
preferredFileWorkPanelTab/hasPluginViewinapps/desktop/src/lib/work-panel-tabs.tsnow own that choice: the bundled fileview whenever it is launchable (deep-linked to the artifact path), the host file
tab otherwise. Both the plan/goal reveal (
openPlanArtifact) and the approvalbar's own opener use it, and the chat file-reference hook shares the same check
instead of repeating it. The reveal itself is unchanged: the artifact still
creates or activates a tab in its originating session.
Review found a startup defect on the way:
bootstrapopened each pending plan'sartifact before the renderer had read the launchable views, so a restart or
reload fell back to the host file tab and then took a second tab when
selectSessionrestored the same proposal. The view list is resolved beforethat loop now, with a test pinning the order.
Specs follow: decision D452 plus its zh-CN mirror,
04-ux/08-component-spec.md§5.4/§10A.2,
04-ux/09-interaction-patterns.md§5A, E2E-106, and a sweep of theremaining pre-D451 claims in ADRs 0019/0042/0068/0105/0108, E2E-058, the
screenshots guide, and two stale zh-CN UX mirrors (#619).
Verification
On the branch tip, Windows x64:
pnpm build:js— pass.pnpm --filter @pi-desktop/desktop typecheck— pass (exit 0).pnpm --filter @pi-desktop/docs test— 11/11, including the EN/zh mirror paritycheck (
node docs/scripts/check-locales.mjs→ verified 78 pairs).source contract, plan renderer flow, chat review entry, bundled plugins, tool
row file refs, plugin-view-host contracts) — 119/119.
failures are outside this diff and also fail without it: the macOS
notarization/DMG script checks (Windows runner), plugin websocket/net timeouts,
the agent-extensions npm runner, logger redaction, the assistant error copy,
and the plugin fs-scope case.
test:e2e/test:e2e:plan-ui(no display in this environment, sothe renderer surface is covered by the targeted suites instead of Electron E2E),
cargo test(no Rust change), andpnpm lint, which this checkout cannot runbecause an unrelated second worktree contributes a nested
biome.json.Risk
The bundled file view can edit and save the artifact, so a plan changed before
Approve now fails the host's recorded-hash check (
PLAN_ARTIFACT_HASH_MISMATCH)until the proposal is rejected and resubmitted; §10A.2 documents that in both
languages. Preventing the edit would be a separate plugin write-policy decision.
Closes #618
Closes #619
Refs #620