Skip to content

feat: Add inline chat renaming functionality to Dashboard and All Chats#279

Draft
Mohammad-Hassan027 wants to merge 1 commit into
avishek0769:mainfrom
Mohammad-Hassan027:feat/chat-rename
Draft

feat: Add inline chat renaming functionality to Dashboard and All Chats#279
Mohammad-Hassan027 wants to merge 1 commit into
avishek0769:mainfrom
Mohammad-Hassan027:feat/chat-rename

Conversation

@Mohammad-Hassan027

Copy link
Copy Markdown
Contributor

Description

Replaced the modal-based "Rename Chat" workflow with an inline editing experience for a smoother user interaction.

Modified src/pages/Dashboard.tsx and src/pages/AllChats.tsx to:

  • Add a pencil edit button directly next to the chat titles in the Dashboard chat cards and the AllChats list rows.
  • Replace the title with an inline text input pre-filled with the current name when the edit button is clicked.
  • Add keyboard and focus event handlers to the input:
    • Enter: Saves changes by blurring the input, which triggers the API call.
    • Escape: Reverts changes and exits edit mode immediately.
    • Blur: Automatically triggers the PATCH request if the name is valid and changed.
  • Remove the old separate rename modal layouts and the separate edit button from the action lists.

Fixes #275

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (structural code cleanups with no behavior changes)
  • Performance improvement (indexing speed, search latency, UI responsiveness)
  • Documentation update (non-executable reference upgrades)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or console errors
  • I have run tests locally (pnpm run test or vitest run under backend/) and they pass
  • Any dependent changes have been merged and published in downstream modules

Verification Details

Please describe the tests or manual steps that you ran to verify your changes. Provide instructions so we can reproduce.

  1. Test case / steps:
    • Go to the Dashboard or All Chats page.
    • Click the pencil icon next to any chat title.
    • Change the text in the input field.
    • Press Enter or click outside the input field (triggering blur).
    • Also, try editing but pressing Escape instead.
  2. Expected result:
    • On Enter/blur: The input turns back into a text label, the chat name updates, and the change is persisted (a toast notification may appear if configured).
    • On Escape: The input reverts back to the original title without saving.

Visual Documentation

Replaced the modal-based "Rename Chat" workflow with an inline editing experience
for a smoother user interaction.

- Added a pencil edit button directly next to the chat titles in both the
  Dashboard chat cards and the AllChats list rows.
- Clicking the edit button replaces the title with an inline text input
  pre-filled with the current name.
- Added keyboard event handlers to the input:
  - `Enter`: Saves changes by blurring the input, which triggers the API call.
  - `Escape`: Reverts changes and exits edit mode immediately.
  - `Blur`: Automatically triggers the PATCH request if the name is valid and changed.
- Removed the old separate rename modal layout and the separate edit button
  from the action lists.
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.

[FEATURE] Add "Rename Chat" functionality to the Dashboard and All Chats pages

1 participant