Skip to content

feat(#49): better project picker — recents + server projects in New Session modal#52

Open
dzianisv wants to merge 1 commit into
mainfrom
feat/issue-49-project-picker
Open

feat(#49): better project picker — recents + server projects in New Session modal#52
dzianisv wants to merge 1 commit into
mainfrom
feat/issue-49-project-picker

Conversation

@dzianisv

Copy link
Copy Markdown
Owner

Summary

Closes #49

Problem

The "New Session" modal (triggered by long-pressing the FAB) only showed a blank text input for entering a project path. Users had no visibility into previously used or server-known projects, forcing them to type paths from memory.

Solution

The modal body is now a scrollable list with four sections:

  1. Current Project — tappable row to create a session immediately in the active project
  2. Recent Projects — list of previously used directories (from existing recentDirectories store, max 10). Tapping any row creates the session in that directory immediately.
  3. Server Projects — fetched from GET /project when the modal opens; shows other projects the server knows about
  4. Enter Path Manually — the existing text input, now clearly labeled as a fallback

All selection paths continue to call addRecentDirectory so the recents list stays up to date.

Files Changed

  • app/(tabs)/index.tsx — added ScrollView, useEffect, Project import; serverProjects state; replaced modalBody with scrollable section layout; added project row styles

TypeScript

Clean (pre-existing VariantPicker.tsx error unrelated to this PR)

- New Session modal now shows:
  - Current project as tappable row (tap to create session immediately)
  - Recent Projects section: list of previously used dirs as tappable rows
  - Server Projects section: projects known to opencode server (from /project API)
  - Manual path input as fallback (unchanged behavior)
- Modal body is now scrollable to handle long lists
- All selection paths call addRecentDirectory to keep recents up to date
- TypeScript clean (pre-existing VariantPicker.tsx error unrelated)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choose project UIX

1 participant