Skip to content

feat: add session rename functionality to TUI modal#1821

Merged
thdxr merged 6 commits intoanomalyco:devfrom
spoons-and-mirrors:feat/session-rename
Aug 12, 2025
Merged

feat: add session rename functionality to TUI modal#1821
thdxr merged 6 commits intoanomalyco:devfrom
spoons-and-mirrors:feat/session-rename

Conversation

@spoons-and-mirrors
Copy link
Contributor

Summary

Add session rename functionality to the TUI session modal, allowing users to rename sessions by
pressing the 'r' key.

  • New API endpoint: PATCH /session/:id for updating session properties
  • Enhanced session modal: Press 'r' to rename selected session with inline text input
  • Full SDK support: Added session update methods to both Go and JS/TS SDKs
  • Seamless UX: Enter to confirm, Esc to cancel, with success/error toast notifications
image image

spoons-and-mirrors and others added 3 commits August 11, 2025 17:35
Enable users to rename sessions directly from the session modal by pressing 'r' key.

- Add PATCH /session/:id API endpoint for updating session title
- Extend Go SDK with UpdateSession method and SessionUpdateParams type
- Add UpdateSession method to TUI app for API integration
- Implement rename mode in session modal with textinput component
- Update modal help text to show 'r rename' option
- Handle Enter/Esc for confirm/cancel rename operations

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
Change the session modal title from "Switch Session" to "Rename Session" when user enters rename mode, providing clearer context for the current operation.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
…g modal

When in session rename mode, pressing ESC now exits rename mode and returns to the session list view instead of closing the modal entirely. This provides a more intuitive user experience.

- Add ReopenSessionModalMsg to handle rename mode ESC behavior
- Modify sessionDialog.Close() to detect rename mode and reopen modal
- Add TUI handler for ReopenSessionModalMsg to recreate session modal
- Remove explicit ESC handling from rename mode (now handled by Close method)

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This violates the AGENTS.md guideline: "AVOID else statements". Consider: Remove the else block and restructure the logic to avoid using else.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Line 332-340: This violates the AGENTS.md guideline: "DO NOT do unnecessary destructuring of variables". The const updates = c.req.valid("json") could be used directly in the Session.update call. Also violates "AVOID else statements" - the if statement could be restructured to avoid conditional logic.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Lines 159-164: This violates the AGENTS.md guideline: "AVOID else statements". Consider restructuring to use early returns instead of else blocks.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Lines around 149, 161: This violates the AGENTS.md guideline: "PREFER single word variable names where possible". Consider shortening sessionToDelete to session and deleteConfirmation to confirmation or similar.

@thdxr thdxr merged commit 47c3276 into anomalyco:dev Aug 12, 2025
1 check passed
yokowasis pushed a commit to yokowasis/opencode-sst that referenced this pull request Aug 14, 2025
Co-authored-by: opencode <noreply@opencode.ai>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: Dax <mail@thdxr.com>
@spoons-and-mirrors spoons-and-mirrors deleted the feat/session-rename branch August 14, 2025 19:04
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.

2 participants

Comments