Skip to content

feat: simplify mobile new chat and project selection - #491

Draft
natsustan wants to merge 12 commits into
LodyAI:mainfrom
natsustan:worktree/clear-forest-95da
Draft

feat: simplify mobile new chat and project selection#491
natsustan wants to merge 12 commits into
LodyAI:mainfrom
natsustan:worktree/clear-forest-95da

Conversation

@natsustan

@natsustan natsustan commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #490

Problem / pressure

On narrow screens, New Chat spreads project targeting and execution settings across multiple rows, leaving less room for writing. A separate Work/Chat switch adds a redundant step when the intended context is already a project or no project.

Summary

  • Put Chat and Local/GitHub projects in one native header picker; preserve the draft and run configuration when changing context.
  • Expand the writing sheet and move model, machine, branch, and Worktree controls into a bottom scrolling rail, with attachment and send actions outside that rail.
  • Keep Role-bound machines fixed and show the reason on unavailable machine options.
  • Include the branch's preceding shared mobile project-entry, native-selector, recent-project default, and active-composer focus improvements, plus component stories and regression coverage.

Before / after

Before After
Separate Work/Chat toggle and project row Header picker chooses Chat or a project directly
Compact composer surrounded by configuration rows Full-height writing area with configuration along the bottom
Long target/settings labels compete for width Scrollable control rail with fixed attachment/send actions

Test plan

Passed with Node 22.23.1 and the pinned pnpm:

  • mise exec node@22.23.1 -- corepack pnpm check (typecheck, lint, CI tests, i18n and boundary checks).
  • mise exec node@22.23.1 -- corepack pnpm format; conflict-resolution files were formatted after merging main.
  • mise exec node@22.23.1 -- corepack pnpm start:local built and launched the local desktop app; the merged branch also passed pnpm --dir apps/electron build:app.
  • Manually exercised the Electron narrow viewport: project → Chat → project retained a synthetic draft and run settings; project-only controls followed the selection. Cleared the draft without sending it.
  • Stories cover long model/branch labels, long prompt content, and a simulated keyboard height. Real iOS/Android keyboard behavior and a live Role mismatch remain device/integration validation gaps.

Try it locally

@Leeeon233 — please try the narrow-screen flow using the steps below. This stays a draft for evaluation. The current contribution policy requires maintainer assignment for external changes over 1,000 lines; please assign #490 to natsustan if you would like this branch to proceed through review.

  1. Check out this PR (gh pr checkout 491 --repo LodyAI/Lody), initialize the public submodules, and install dependencies with the pinned pnpm.
  2. Run mise exec node@22.23.1 -- corepack pnpm start:local.
  3. Dock DevTools on the right and narrow the renderer viewport below 768px, then open New Chat. The regular wide desktop layout does not display this sheet.
  4. Use the header to switch between Chat and a project; type a draft, switch contexts, and scroll the bottom configuration rail.
  5. For isolated states, run mise exec node@22.23.1 -- corepack pnpm storybook and open Mobile/MobileNewChatSheet.

Context handoff

Instructions for reviewing agents

  • Review focus: Inspect chat-landing context selection, the MobileNewChatSheet render slot, and ChatComposer fillSheet sizing for draft continuity and reachable footer actions.
  • Decisions to challenge: Assess native header selection and horizontal configuration scrolling, including discoverability of Chat and Role-bound execution settings.
  • Plausible failures / evidence gaps: Real native keyboard resizing, attachment-heavy drafts, and live Role mismatch transitions need integration coverage beyond the desktop preview.

Authoring context

  • User goal / directives: Improve the shared narrow-screen New Chat layout using a spacious editor and bottom controls, simplify Chat/project selection, and publish the branch for maintainer evaluation.
  • Constraints / non-goals: Keep the public local-only composition and existing dispatch contracts; private application sources and backend changes are outside this contribution.
  • Risk-bearing decisions: The full-height composer is opt-in; legacy ReactNode sheet composition remains supported, and Role machine changes are blocked instead of silently retargeting execution.
  • Destructive or irreversible behavior: No migrations, data cleanup, or automatic message submission are introduced; changing context uses existing selection handlers.
  • Deliberately not done or tested: No private native app deployment or real-device keyboard validation was performed; stories simulate keyboard height and the local Electron preview covers context switching.
  • Unknowns / confidence: Static checks, automated tests, build, and local interaction checks pass; native keyboard geometry and downstream host render-slot integration still need maintainer device testing.

natsustan and others added 11 commits September 2, 2026 09:33
Model: gpt-5.4
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a05fe5-c1cd-7323-a0cc-afdb1c9c6c89
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T02:01:55.761993Z e3c0585 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added scope: components status:needs-pr-attention External PR needs contributor attention before review labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@natsustan, this pull request needs updates before review.

It is marked status:needs-pr-attention. Address the findings below by 2026-09-15 01:54:50 UTC. The label and this comment are removed automatically after the PR passes validation.

If the PR remains invalid for 7 days, it will be closed and marked status:pr-policy-expired. Continue afterward by opening a new pull request with the current template.

Policy findings
PR does not meet Lody contribution requirements:

- Missing required heading: ## Visual explanation
- ## Visual explanation must include a structural view because this PR changes 2443 lines, above the 200-line complexity floor.
- Context handoff must include ### Original user prompt.
- PR changes 2443 lines; community PRs over 1000 lines require a maintainer assignment on the linked Issue before review.

See `CONTRIBUTING.md` and `.github/PULL_REQUEST_TEMPLATE.md`.

@natsustan
natsustan marked this pull request as draft September 8, 2026 01:56

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3c0585b9a

ℹ️ 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".

Comment on lines +5304 to +5308
const entry = visibleLocalProjectMap.get(project.projectKey);
if (!entry) return;
handleSelectedLocalProjectChange({
machineId: entry.machineId,
localProjectId: entry.project.id,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep project shortcuts on the active Role's machine

When a retained draft has an active Role bound to machine A, closing the sheet and tapping the new-chat action for a local project on machine B reaches this handler without the guard used by the header and machine selectors. handleSelectedLocalProjectChange switches machines, and the agent-sync effect then replaces the Role-bound agent, silently dropping the selected Role and its run configuration. Reject or disable this shortcut while its project is on another machine.

AGENTS.md reference: packages/components/src/components/chat/AGENTS.md:L31-L35

Useful? React with 👍 / 👎.

Comment on lines +1504 to +1511
trailing={
selectedTab === 'chat' && chatFilterPills && chatFilterPills.length > 0 ? (
<ChatListFilterToggle
open={chatFiltersOpen}
hasActiveFilters={hasActiveChatFilters}
ariaLabel={labels.filterBarToggleLabel ?? '过滤器'}
onToggle={() => setChatFiltersOpen((open) => !open)}
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the filter toggle outside the fading search slot

On the inspected mobile home screen, this toggle now inherits the search slot's pointer-events-none and aria-hidden state whenever pull-to-refresh or ambient offline/reconnect/refresh status hides search. Existing filters continue affecting the conversation list, but users cannot reopen the filter controls until the status clears; retain the toggle on the first group heading as specified.

AGENTS.md reference: packages/components/src/components/mobile/AGENTS.md:L91-L94

Useful? React with 👍 / 👎.

Resolve the composer focus conflict and retain upstream documentation structure with the new mobile composition invariants.

Model: gpt-6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: components status:needs-pr-attention External PR needs contributor attention before review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Simplify the shared narrow-screen New Chat flow

1 participant