8000 feat(ConversationHistory): added ability to edit convo history names by thatblindgeye · Pull Request #624 · patternfly/chatbot · GitHub
[go: up one dir, main page]

Skip to content

feat(ConversationHistory): added ability to edit convo history names#624

Merged
rebeccaalpert merged 14 commits intopatternfly:mainfrom
thatblindgeye:iss473_editHistory
Aug 4, 2025
Merged

feat(ConversationHistory): added ability to edit convo history names#624
rebeccaalpert merged 14 commits intopatternfly:mainfrom
thatblindgeye:iss473_editHistory

Conversation

@thatblindgeye
Copy link
Collaborator

Closes #473

Keeping with the design spec, this pivots the ChatbotConversationHistoryNav component away from the PatternFly Menu components and replacing that with other PF components. I tried to keep the visual aspect as close to what we currently have and also minimizing API changes. Just to note a couple of the API changes:

  • additionalProps still gets passed to a button element, but is no longer a MenuItemProps type and instead a ButtonProps type (so still from PatternFly)
  • menuProps is deprecated and will basically just do nothing anymore, since there's no applicable place to spread them anymore with that name.

Let me know if any classes should be updated further - I had to update or remove some classes between the component and scss files.

@patternfly-build
Copy link
patternfly-build commented Jul 25, 2025

@rebeccaalpert rebeccaalpert requested a review from edonehoo July 28, 2025 20:27
Copy link
Member
@rebeccaalpert rebeccaalpert left a comment

Choose a reason for hiding this comment

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

Overall this looks great! I am so happy that you pointed out the menu aria issue and were able to get this working. I noticed a visual regression, an axe issue on the dropdown toggle, and a couple of much smaller nitpick-y things. (Noted below.) Let me know if you need any help with the button thing - I think I have overridden those elsewhere in here before.

@thatblindgeye thatblindgeye force-pushed the iss473_editHistory branch 2 times, most recently from cdd6428 to d80dc5f Compare July 29, 2025 13:38
Copy link
Member
@rebeccaalpert rebeccaalpert left a comment

Choose a reason for hiding this comment

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

Looking great! Thank you so much. 🚀

Copy link
@kaylachumley kaylachumley left a comment

Choose a reason for hiding this comment

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

🫵🪨

Copy link
Contributor
@edonehoo edonehoo left a comment

Choose a reason for hiding this comment

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

Small formatting tweaks and wdyt about changing the example title?

Comment on lines +376 to +384
- Each text input has a unique accessible name - this is handled automatically, but can be customized via the `inputAriaLabel` property on the conversation item.
- The `onBlur` and `onKeyDown` callback handlers are passed in, typically to "exit" editing mode on blur and to handle the Enter or Escape keys on key down - in this example, `onBlur` and the Enter key via `onKeyDown` save the text input content, while Escape via `onKeyDown` cancels the edit and reverts to the original text.
- The `onChange` callback handler is passed in to handle updating the text input value and any conversation state.
- Focus is handled correctly when enabling and disabled editing mode - when `isEditing` becomes true, focus should be moved to the text input, and when the Enter or Escape keys are pressed and `isEditing` becomes false focus should be moved to the conversation actions dropdown toggle.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Each text input has a unique accessible name - this is handled automatically, but can be customized via the `inputAriaLabel` property on the conversation item.
- The `onBlur` and `onKeyDown` callback handlers are passed in, typically to "exit" editing mode on blur and to handle the Enter or Escape keys on key down - in this example, `onBlur` and the Enter key via `onKeyDown` save the text input content, while Escape via `onKeyDown` cancels the edit and reverts to the original text.
- The `onChange` callback handler is passed in to handle updating the text input value and any conversation state.
- Focus is handled correctly when enabling and disabled editing mode - when `isEditing` becomes true, focus should be moved to the text input, and when the Enter or Escape keys are pressed and `isEditing` becomes false focus should be moved to the conversation actions dropdown toggle.
- Each text input has a unique accessible name. This is handled automatically, but can be customized via the `inputAriaLabel` property on the conversation item.
- The `onBlur` and `onKeyDown` callback handlers are passed in, typically being used to exit editing mode on blur and to handle the **Enter** or **Escape** keys on key down.
- In this example, `onBlur` and the **Enter** key via `onKeyDown` save the text input content, while **Escape** via `onKeyDown` cancels the edit and reverts to the original text.
- The `onChange` callback handler is passed in to handle updating the text input value and any conversation state.
- Focus is handled correctly when enabling and disabled editing mode.
- When `isEditing` becomes `true`, focus should be moved to the text input.
- When the **Enter** or **Escape** keys are pressed and `isEditing` becomes `false`, focus should be moved to the conversation actions dropdown toggle.


```

### Drawer with editable conversations
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Drawer with editable conversations
### Renaming conversations in history drawer

@thatblindgeye
Copy link
Collaborator Author

Just FYI adding the "do not merge" label on for now pending discussion in this weeks chatbot sync

Copy link
Member
@rebeccaalpert rebeccaalpert left a comment

Choose a reason for hiding this comment

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

Looking good - just a comment/concern about the modal.

Copy link
Contributor
@edonehoo edonehoo left a comment

Choose a reason for hiding this comment

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

just little edits!


### Drawer with editable conversations

You can allow conversation items in the history drawer editable by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can allow conversation items in the history drawer editable by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:
You can allow users to edit conversation names in the history drawer by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:


- When the modal opens, place focus at the end of the text input.
- When the modal closes, focus goes back to the action toggle that was previously opened.
- Changes can be canceled via the Escape key or clicking a "cancel" button.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Changes can be canceled via the Escape key or clicking a "cancel" button.
- Changes can be canceled via the **Escape** key or by clicking a "Cancel" button.

- When the modal opens, place focus at the end of the text input.
- When the modal closes, focus goes back to the action toggle that was previously opened.
- Changes can be canceled via the Escape key or clicking a "cancel" button.
- Changes can be saved via the Enter key or clicking a "save" button.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Changes can be saved via the Enter key or clicking a "save" button.
- Changes can be saved via the **Enter** key or by clicking a "Save" button.


You can allow conversation items in the history drawer editable by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:

- When the modal opens, place focus at the end of the text input.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- When the modal opens, place focus at the end of the text input.
- When the modal opens, focus is placed at the end of the text input.

Copy link
Contributor
@edonehoo edonehoo left a comment

Choose a reason for hiding this comment

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

🥳

@kaylachumley kaylachumley self-requested a review August 1, 2025 18:58
Copy link
@kaylachumley kaylachumley left a comment

Choose a reason for hiding this comment

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

Hi! Can you please adjust the padding between the header and the box-body to be 8px (pf-t--global--spacer--sm)? everything else is looking good!

@kaylachumley kaylachumley self-requested a review August 4, 2025 15:41
Copy link
@kaylachumley kaylachumley left a comment

Choose a reason for hiding this comment

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

spacing looks good now! the modal does seem wide but when resizing to a smaller screen size it makes sense

@rebeccaalpert rebeccaalpert merged commit 900c0d0 into patternfly:main Aug 4, 2025
7 checks passed
@github-actions
Copy link
github-actions bot commented Aug 4, 2025

🎉 This PR is included in version 6.4.0-prerelease.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

rebeccaalpert pushed a commit to rebeccaalpert/virtual-assistant that referenced this pull request Oct 24, 2025
…edit convo history names (patternfly#624)

Refactored ChatBotConversationHistoryNav from a PatternFly Menu to a PatternFly List so we can make it more flexible moving forward. Accordingly, menuProps has been deprecated and titleProps and listProps have been added. Also added demo for editing history names, triggered via dropdown. Dropdown launches edit modal.

Co-authored-by: Eric Olkowski <git.eric@thatblindgeye.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add edit history item

5 participants

0