Skip to content

refactor: create RTE with presets#1558

Open
kevinkim-ogp wants to merge 3 commits intopair-action/design-improvements-2from
pair-action/design-improvements-3
Open

refactor: create RTE with presets#1558
kevinkim-ogp wants to merge 3 commits intopair-action/design-improvements-2from
pair-action/design-improvements-3

Conversation

@kevinkim-ogp
Copy link
Copy Markdown
Contributor

@kevinkim-ogp kevinkim-ogp commented Apr 20, 2026

TL;DR

  • Removes the "What would you like to do?" dropdown
  • Creates a new RTE component that shows the "presets" on the right of the RTE

What changed?

  • Removed the promptType dropdown field from the Pair send-prompt action. Preset selection is now handled directly within the rich-text editor UI.
  • Introduced a PROMPT_PRESETS constant that defines the available presets (Summarise, Analyse, Categorise, Write) with labels and descriptions.
  • Refactored DEFAULT_PROMPT_VALUES HTML templates from dedent template literals to arrays of HTML fragments joined with '', preventing the editor from introducing unintended extra line breaks via \n-to-<br> normalisation.
  • Added a new RichTextEditorWithPresets component that renders a split-panel layout: the rich-text editor on the left and a clickable preset list on the right. The preset panel is only shown when the editor is empty. Selecting a preset populates both the prompt and responseFields fields simultaneously via IPreset assignments.
  • Added a containerClassName prop to RichTextEditor and an editor--borderless CSS variant to allow the editor to render without its own border when embedded inside the preset panel's shared border container.
  • Exposed presets on the ActionSubstepArgument GraphQL type and IFieldRichText TypeScript interface, with new IPreset and IPresetAssignment types.
  • InputCreator now renders RichTextEditorWithPresets instead of RichTextEditor when a field has presets defined.
  • The hiddenIf condition for responseFields now watches the prompt field instead of the removed promptType field.

How to test?

New RTE with presets

  • Presets are displayed by default when the new action is created
  • Typing in the RTE removes the presets
  • Selecting the preset automatically populates the RTE and clears the presets
  • Clearing the RTE shows the presets again
  • Presets are rendered properly i.e., with proper spacing and formatting

Sanity check

  • Other actions using rich-text are rendered correctly and function correctly i.e., Postman
    • Can format text
    • Can add tables
    • Can add images
    • Can render saved parameters properly

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kevinkim-ogp kevinkim-ogp changed the title refactor: create rte with presets refactor: create RTE with presets Apr 20, 2026
@kevinkim-ogp kevinkim-ogp marked this pull request as ready for review April 20, 2026 10:38
@kevinkim-ogp kevinkim-ogp requested a review from a team as a code owner April 20, 2026 10:38
@kevinkim-ogp kevinkim-ogp force-pushed the pair-action/design-improvements-3 branch from e6f5233 to a18e473 Compare April 20, 2026 13:13
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.

1 participant