Skip to content

feat(app): support direct-start sessions - #1173

Merged
Astro-Han merged 7 commits into
devfrom
codex/direct-start-sessions
Jun 5, 2026
Merged

feat(app): support direct-start sessions#1173
Astro-Han merged 7 commits into
devfrom
codex/direct-start-sessions

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Support direct-start sessions by falling back to the backend default directory when no project root is active.
  • Show sessions from the default directory as Direct start / 直接开始 in the sidebar instead of exposing the backing folder.
  • Update the home workspace chip and menu so direct start is the first explicit start mode, while opening a project remains available.

No linked issue; this follows the product design discussion for starting without choosing a workspace.

Why

Users should be able to start a useful chat or task before choosing a project. This keeps PawWork usable out of the box while still using the existing backend default directory as the execution and persistence root.

Related Issue

None.

Human Review Status

Pending

Review Focus

  • Confirm the direct-start root detection stays limited to globalSync.data.path.directory.
  • Confirm the sidebar and home composer copy/icon treatment feels coherent.
  • Confirm project-backed sessions still keep their existing workspace grouping and project actions.

Risk Notes

Behavior risk: new-session shell actions now fall back to the backend default directory when no project is active. That directory remains the actual filesystem backing store.

Platform impact considered: this reuses the existing global default directory and does not add OS-specific path construction, shell behavior, permissions, packaging, or updater changes.

No dependency, generated file, docs, release note, credential, deletion, or migration surface was changed.

How To Verify

Targeted app tests: passed, 38 pass / 0 fail / 84 expect() calls
Command: cd packages/app && bun test --preload ./happydom.ts ./src/pages/layout/shell-navigation.test.ts ./src/pages/layout/pawwork-sidebar-session-rows.test.ts ./src/pages/layout/pawwork-sidebar-project-group-header.test.ts ./src/components/prompt-input/workspace-chip.test.ts ./src/i18n/parity.test.ts ./src/components/model-picker-hotfix.test.ts

App typecheck: passed
Command: cd packages/app && bun run typecheck

Home E2E regression check: passed, 2 tests
Command: cd packages/app && bun run test:e2e:local -- e2e/app/home.spec.ts --grep "@smoke home renders hero composer|@smoke home composer shows unified"

Perf probe regression check: passed, 1 test
Command: cd packages/app && bun run test:e2e:local -- e2e/perf/perf-probe.spec.ts --grep "homepage-cold"

Workspace chip a11y E2E: passed, 3 tests
Command: cd packages/app && bun run test:e2e:local -- e2e/app/a11y-chip.spec.ts

Visual snapshot: passed
Command: bun run snap prompt-placeholder
Result: reviewed the generated prompt-placeholder grid locally for the home composer surface.

Focused visual check: passed
Result: temporary Playwright visual check verified the direct-start chip, menu title, and selected direct-start menu item; screenshot reviewed locally.

Final diff review: scoped to app/i18n/test/E2E files, with no dependency or generated-file changes.
Command: git diff --stat origin/dev...HEAD && git diff --check

Screenshots or Recordings

Local visual checks were completed for the changed home composer surface and direct-start picker state. No externally hosted recording is attached.

Checklist

How to use this checklist:

  • Tick a box by replacing [ ] with [x]. Do not edit, add, or remove items.
  • The bot-applied label items can only be honestly ticked AFTER the PR is opened and the labeler / priority-triage bots have run — return to the PR description and tick them then.
  • Most items are required. The few that are conditional are explicitly marked (conditional); for those, leave unticked if they truly do not apply and explain why in Risk Notes. All other items must be ticked before requesting human review.
  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • I reviewed the final diff for unrelated changes and suspicious dependency changes.
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English.

Summary by CodeRabbit

  • New Features

    • Added "Direct start" workspace mode and a dedicated start-from choice in the UI.
  • Improvements

    • Workspace selector shows a direct-start choice, label and icon; active-state and ordering behavior refined.
    • UI wording updated (e.g. "Choose workspace"/"Choose start location", "Open project").
    • Sidebar and translations updated to surface "Direct start" (English & Chinese).
  • Tests

    • Expanded unit, integration and E2E tests to cover direct-start behavior and UI changes.

@Astro-Han Astro-Han added enhancement New feature or request P2 Medium priority app Application behavior and product flows ui Design system and user interface labels Jun 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested priority: P2 (includes user-path files (packages/app/src/components/prompt-input/workspace-chip-helpers.ts, packages/app/src/components/prompt-input/workspace-chip.test.ts, packages/app/src/components/prompt-input/workspace-chip.tsx, packages/app/src/i18n/en.ts, packages/app/src/i18n/zh.ts, packages/app/src/pages/layout.tsx, packages/app/src/pages/layout/pawwork-session-controller.ts, packages/app/src/pages/layout/pawwork-session-source.ts, packages/app/src/pages/layout/pawwork-sidebar-project-group-header-presentation.ts, packages/app/src/pages/layout/pawwork-sidebar-project-group-header.test.ts, packages/app/src/pages/layout/pawwork-sidebar-project-group-header.tsx, packages/app/src/pages/layout/pawwork-sidebar-session-rows.test.ts, packages/app/src/pages/layout/pawwork-sidebar.tsx, packages/app/src/pages/layout/shell-navigation.test.ts, packages/app/src/pages/layout/shell-navigation.ts)).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 10 minutes and 14 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d9981b1-001b-492c-b482-b01e25e5b5e4

📥 Commits

Reviewing files that changed from the base of the PR and between 8b880a3 and aa7badd.

📒 Files selected for processing (6)
  • packages/app/src/components/prompt-input/workspace-chip-helpers.ts
  • packages/app/src/components/prompt-input/workspace-chip.test.ts
  • packages/app/src/components/prompt-input/workspace-chip.tsx
  • packages/app/src/pages/layout/pawwork-session-controller.ts
  • packages/app/src/pages/layout/pawwork-session-source.ts
  • packages/app/src/pages/layout/pawwork-sidebar-session-rows.test.ts
📝 Walkthrough

Walkthrough

This PR introduces "direct start" as a first-class workspace mode. It adds types and helpers, integrates direct-start into workspace chip UI and session/project resolution, updates sidebar presentation and shell navigation fallback, and updates tests and i18n strings.

Changes

Direct-start workspace mode

Layer / File(s) Summary
Internationalization updates
packages/app/src/i18n/en.ts, packages/app/src/i18n/zh.ts
Adds sidebar.pawwork.directStart and updates workspace chip UI strings (aria label, popover title, direct-start label, empty label, add/open label).
Workspace chip helpers
packages/app/src/components/prompt-input/workspace-chip-helpers.ts, packages/app/src/components/prompt-input/workspace-chip.test.ts
Introduces WorkspaceChoiceKind and kind on WorkspaceChoice; workspaceChipChoices accepts directStartDirectory and emits {path, kind} including direct-start; adds isDirectStartWorkspacePath, workspaceChipLabel, and updates workspaceChipIconName. Tests cover ordering, normalization, labels, and icons.
Workspace chip component integration
packages/app/src/components/prompt-input/workspace-chip.tsx
Wires global directStartDirectory into WorkspaceChip, uses workspaceChipChoices/workspaceChipLabel, conditionally shows bubble icon for direct-start state, and renders direct-start menu items with bubble icon and translated label.
Session-to-project key and label resolution
packages/app/src/pages/layout/pawwork-session-source.ts, packages/app/src/pages/layout/pawwork-session-controller.ts, packages/app/src/pages/layout/pawwork-sidebar-session-rows.test.ts
Adds PAWWORK_DIRECT_START_PROJECT_KEY, isPawworkDirectStartProjectKey, resolvePawworkSessionProjectKey to return the direct-start key when session directory matches; extends resolvePawworkSessionProjectLabel to early-return direct-start label and prevents renaming of the direct-start key. Wires directStartDirectory through session controller.
Sidebar project group header presentation model
packages/app/src/pages/layout/pawwork-sidebar-project-group-header-presentation.ts, packages/app/src/pages/layout/pawwork-sidebar-project-group-header.test.ts, packages/app/src/pages/layout/pawwork-sidebar-project-group-header.tsx, packages/app/src/pages/layout/pawwork-sidebar.tsx
Adds ProjectGroupHeaderKind and projectGroupHeaderPresentation to map kind+collapsed → {icon, canManage}; updates ProjectGroupHeader to use presentation and gates management controls; sidebar passes kind based on direct-start detection.
Shell navigation with direct-start root fallback
packages/app/src/pages/layout/shell-navigation.ts, packages/app/src/pages/layout/shell-navigation.test.ts
Adds optional directStartRoot callback to createShellNavigation; resolveNewSessionRoot now falls back to directStartRoot() when no current project root is available. Tests added/updated for direct-start new session behavior.
Layout controller wiring
packages/app/src/pages/layout.tsx
Passes globalSync.data.path.directory as directStartDirectory to the session controller and as directStartRoot to shell navigation.
E2E / perf test updates
packages/app/e2e/*, packages/app/e2e/perf/*
Updates Playwright/Perf locators and flows to use the "Choose workspace / 选择工作目录" control and adjusted menu selection locators.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Astro-Han/pawwork#810: Both PRs modify packages/app/src/pages/layout/pawwork-session-source.ts around session→project key/label resolution that this PR extends for direct-start.
  • Astro-Han/pawwork#424: Modifies createShellNavigation/openNewSession root-resolution behavior related to the navigation fallback logic adjusted here.
  • Astro-Han/pawwork#540: Updates home/workspace E2E expectations similar to the locator/string changes in this PR.

Poem

🐰 I hop to the direct-start door,
Bubble icon leading me to explore,
From global path to project row,
A tiny hop, and off I go,
Happy code and tidy lore.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 'feat(app): support direct-start sessions' clearly and specifically describes the main feature addition, directly matching the PR's primary objective.
Description check ✅ Passed The PR description is comprehensive, covering summary, motivation, review focus, risks, verification steps, and all required checklist items are ticked.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/direct-start-sessions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a 'Direct Start' feature to the workspace and session management, allowing users to start sessions directly from a fallback directory when no active project workspace is selected. Key changes include adding helper functions to identify and label direct-start paths, updating the workspace chip and sidebar components to display direct-start options with a distinct chat bubble icon, disabling management actions (rename/remove) for direct-start groups, and configuring shell navigation to fall back to the direct-start root. Unit tests and internationalization keys have also been added to support this feature. There are no review comments, and the implementation looks solid with no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/app/src/pages/layout/pawwork-sidebar-project-group-header.test.ts (1)

16-21: ⚡ Quick win

Consider testing that collapsed is ignored for direct-start.

The test verifies collapsed: false, but the implementation (line 9–10 in the presentation module) always returns bubble-5 for direct-start regardless of collapsed. Adding a second assertion with collapsed: true would confirm the collapsed state is intentionally ignored for this kind.

📋 Proposed test enhancement
   test("renders direct-start groups as chat-shaped and not project-manageable", () => {
     expect(projectGroupHeaderPresentation({ kind: "direct-start", collapsed: false })).toEqual({
       icon: "bubble-5",
       canManage: false,
     })
+    expect(projectGroupHeaderPresentation({ kind: "direct-start", collapsed: true })).toEqual({
+      icon: "bubble-5",
+      canManage: false,
+    })
   })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/app/src/pages/layout/pawwork-sidebar-project-group-header.test.ts`
around lines 16 - 21, Update the test for projectGroupHeaderPresentation to
assert that the collapsed flag is ignored for kind "direct-start": add another
expect call invoking projectGroupHeaderPresentation({ kind: "direct-start",
collapsed: true }) and assert it equals the same object { icon: "bubble-5",
canManage: false }, so both collapsed: false and collapsed: true produce
identical results.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/app/src/components/prompt-input/workspace-chip.tsx`:
- Around line 64-66: The Icon currently shows "bubble-5" whenever current() is
falsy even if no direct-start directory exists; update the Icon name logic so
"bubble-5" is used only when a direct-start directory actually exists or
directStartActive() is true. Locate the Icon in workspace-chip.tsx and change
the name expression to check directStartDirectory() (and/or directStartActive())
alongside current(), e.g. only return "bubble-5" when directStartDirectory() ||
directStartActive() is truthy, otherwise fall back to "folder".

---

Nitpick comments:
In `@packages/app/src/pages/layout/pawwork-sidebar-project-group-header.test.ts`:
- Around line 16-21: Update the test for projectGroupHeaderPresentation to
assert that the collapsed flag is ignored for kind "direct-start": add another
expect call invoking projectGroupHeaderPresentation({ kind: "direct-start",
collapsed: true }) and assert it equals the same object { icon: "bubble-5",
canManage: false }, so both collapsed: false and collapsed: true produce
identical results.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: afe86a5e-f983-4562-bb88-3ad7f6058186

📥 Commits

Reviewing files that changed from the base of the PR and between 19fe0c2 and 875d9d0.

📒 Files selected for processing (15)
  • packages/app/src/components/prompt-input/workspace-chip-helpers.ts
  • packages/app/src/components/prompt-input/workspace-chip.test.ts
  • packages/app/src/components/prompt-input/workspace-chip.tsx
  • packages/app/src/i18n/en.ts
  • packages/app/src/i18n/zh.ts
  • packages/app/src/pages/layout.tsx
  • packages/app/src/pages/layout/pawwork-session-controller.ts
  • packages/app/src/pages/layout/pawwork-session-source.ts
  • packages/app/src/pages/layout/pawwork-sidebar-project-group-header-presentation.ts
  • packages/app/src/pages/layout/pawwork-sidebar-project-group-header.test.ts
  • packages/app/src/pages/layout/pawwork-sidebar-project-group-header.tsx
  • packages/app/src/pages/layout/pawwork-sidebar-session-rows.test.ts
  • packages/app/src/pages/layout/pawwork-sidebar.tsx
  • packages/app/src/pages/layout/shell-navigation.test.ts
  • packages/app/src/pages/layout/shell-navigation.ts

Comment thread packages/app/src/components/prompt-input/workspace-chip.tsx
@Astro-Han
Astro-Han merged commit 6fc2c9a into dev Jun 5, 2026
34 checks passed
@Astro-Han
Astro-Han deleted the codex/direct-start-sessions branch June 5, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows enhancement New feature or request P2 Medium priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant