Repository navigation
Conversation
This branch has not been 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.
Summary
Add Open in new tab (T) to a project group's ⋯ menu, immediately after Open in Files. It opens a fresh composer for that project without switching the original browser tab or selecting an arbitrary previous conversation.
Closes #1207
Reuse and scope
Only three production files change:
components/SessionSidebar.tsxreusesSidebarMenu, the existingsidebar.openInNewTabtranslations,OpenInNewTabIcon, shortcut handling and the session menu's synchronouswindow.open(..., "_blank", "noopener,noreferrer")pattern.lib/new-session-context.tsextracts the existing group's + target rule intonewSessionTargetForProject(), shared by + and the new menu action.lib/session-links.tsadds the cwd counterpart to its session link:newSessionDeepLink(). The existing?cwd=validation, fresh-composer initialization and per-tab restore behavior are unchanged. The relative link keeps origin/path and removes stale query parameters and fragments.No new navigation framework, app-internal tabs, session state store, backend API, dependency, or setting. Browser Back/Forward, changes to New, project filtering and the broader conversation-finding discussion (#1201) are outside this PR. The separate static demo is unchanged.
Tests
node_modules/.bin/tsc --noEmit: PASS.npm run lint: PASS.npm test: PASS — 2630 tests, 2629 passed, 1 skipped, 0 failures on the full rerun.PI_OFFLINE=1 PI_WEB_SKIP_VERSION_CHECK=1 npm run test:e2e: PASS — 36 checks on the full rerun (27 existing + 9 new).git diff --check: PASS.The new browser checks are integrated into the existing
e2e/run.mjsserver lifecycle and temporary agent directory, and reuse the existing HTML file-panel fixture and sidebar helpers. They cover desktop and mobile Chromium, a real linked worktree with spaces/non-ASCII/&/#in its path, another project, an empty pinned project, click and keyboard activation, reload vs remembered sessions, source draft and file-preview preservation, the unchanged + action, and an unavailable directory. Requests and session IDs are checked to rule out session creation/copying/prompting/stopping. Unit tests also cover Windows/UNC path encoding and sub-path URL resolution.Initial-run failures, retained for transparency
lib/project-command-env.test.mjstimeout test because its descendant'ssurvivor.pidhad not been written. Running the entire unmodified suite again on its own passed.net::ERR_NETWORK_CHANGEDduring an existing session-load step, before the new checks. The entire unmodified browser suite rerun passed.No assertions were relaxed or retry logic added to address either failure. All browser runs used temporary fixture sessions; no real sessions or inference requests were used. The existing installed Pi Web service was left running untouched.
Documentation
Updated
docs/agents/sessions.md, the English/Chinese worktree guides, ande2e/README.mdto describe the new entry point, its directory rule and regression coverage.Verification limits
Verified on Linux with headless Chromium, including a mobile viewport/touch emulation. Real mobile devices, macOS, Windows, Firefox and Safari were not exercised; Windows path handling is unit-tested only. No development build was run.