Skip to content

feat(Message): Add ability to edit user prompt#505

Merged
rebeccaalpert merged 2 commits intopatternfly:mainfrom
rebeccaalpert:edit-message
Apr 15, 2025
Merged

feat(Message): Add ability to edit user prompt#505
rebeccaalpert merged 2 commits intopatternfly:mainfrom
rebeccaalpert:edit-message

Conversation

@rebeccaalpert
Copy link
Copy Markdown
Member

@rebeccaalpert rebeccaalpert commented Apr 2, 2025

Add prop to trigger edit mode and display form when edit mode is on. Add examples/tests.

Docs: https://chatbot-pr-chatbot-505.surge.sh/patternfly-ai/chatbot/messages#user-messages

@rebeccaalpert rebeccaalpert linked an issue Apr 2, 2025 that may be closed by this pull request
@patternfly-build
Copy link
Copy Markdown

patternfly-build commented Apr 2, 2025

@rebeccaalpert rebeccaalpert force-pushed the edit-message branch 2 times, most recently from 9094f1b to 2e25ca6 Compare April 2, 2025 17:03
@edonehoo
Copy link
Copy Markdown
Contributor

edonehoo commented Apr 2, 2025

I noticed that when I actually updated a message, it seems to take precedence over the other content type options--just me?

Screen.Recording.2025-04-02.at.4.50.52.PM.mov

@edonehoo
Copy link
Copy Markdown
Contributor

edonehoo commented Apr 2, 2025

Oops actually update: actually it's just a "sticky" behavior for the radio button, not always the editable one. For ex it just remained stuck on the code default selection here -

Screen.Recording.2025-04-02.at.4.54.38.PM.mov

@rebeccaalpert
Copy link
Copy Markdown
Member Author

Good catch; thank you!

@rebeccaalpert rebeccaalpert force-pushed the edit-message branch 2 times, most recently from beced76 to 952ca91 Compare April 2, 2025 21:35
@rebeccaalpert rebeccaalpert changed the title feat(Message): Add ability to edit user prompt Draft: feat(Message): Add ability to edit user prompt Apr 4, 2025
@rebeccaalpert rebeccaalpert force-pushed the edit-message branch 2 times, most recently from d743511 to 08c4576 Compare April 7, 2025 17:02
@rebeccaalpert rebeccaalpert changed the title Draft: feat(Message): Add ability to edit user prompt feat(Message): Add ability to edit user prompt Apr 7, 2025
@edonehoo
Copy link
Copy Markdown
Contributor

edonehoo commented Apr 8, 2025

Some remaining questions, but nothing to hold this back

  • Do we plan to offer the trigger for editing? As a message action, or something like that? Or are we not wiring that up for users
  • I think in practice the placeholder text should be the text content for the original message that is being edited, but unless we put up a multi-step demo for the entire edit sequence (including triggering it on a message), I think what we have is fine for the example

@rebeccaalpert
Copy link
Copy Markdown
Member Author

rebeccaalpert commented Apr 8, 2025

Do we plan to offer the trigger for editing? As a message action, or something like that? Or are we not wiring that up for users

Kayla will work on a design for the trigger and we'll get it in at that point.

I think in practice the placeholder text should be the text content for the original message that is being edited, but unless we put up a multi-step demo for the entire edit sequence (including triggering it on a message), I think what we have is fine for the example

We can definitely add this once we have a trigger. The placeholder only shows if there's no message text, which is uncommon.

Copy link
Copy Markdown

@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.

Hey! to erins comment: I did make an issue to explore the trigger for the edit user prompt.
I noticed that when you drag the resizable text area, it drags over the vertical tabs. is it meant to do that?

Screen.Recording.2025-04-09.at.12.29.16.PM.mov

@rebeccaalpert
Copy link
Copy Markdown
Member Author

Yup, that's what PatternFly does @kaylachumley!

@kaylachumley kaylachumley self-requested a review April 9, 2025 18:54
tableProps={
variant === 'table' ? { 'aria-label': 'App information and user roles for user messages' } : undefined
}
isEditable={variant === 'editable' ? isEditable : false}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to toggle isEditable based on something inside the message when it's in the editable variant? It was a little odd to me using the example when I edited + saved and then couldn't get back to the edit interface without swapping to another variant and back.

I don't think this is a blocker since it's only example code quirks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The trigger is something design is still working out! We'll make it a little more straightforward once they've made decisions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

its in my to do list! here is the issue for it patternfly/patternfly-design-kit#801

@rebeccaalpert
Copy link
Copy Markdown
Member Author

Just rebasing since another PR caused a merge conflict here.

Add prop to trigger edit mode and display form when edit mode is on. Add examples/tests.
@rebeccaalpert rebeccaalpert merged commit 90b4479 into patternfly:main Apr 15, 2025
5 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.2.0-prerelease.46 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Create: Edit User Prompt component

5 participants