Skip to content

docs: add button refactor docs#1385

Open
maxelkins wants to merge 2 commits intomainfrom
button-discovery
Open

docs: add button refactor docs#1385
maxelkins wants to merge 2 commits intomainfrom
button-discovery

Conversation

@maxelkins
Copy link
Contributor

@maxelkins maxelkins commented Mar 16, 2026

Summary

Adds detailed documentation around current button tech debt and discusses potential approach to tackling this debt.

Notes

If this is the wrong place for this, I can move this into an issue (worried it'll just go stale and get closed) or make an ADR in the dp docs.

Copilot AI review requested due to automatic review settings March 16, 2026 10:53
@maxelkins maxelkins temporarily deployed to previews/1385/merge March 16, 2026 10:53 — with GitHub Actions Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new documentation plan describing current button tech debt in the editor UI and proposing a phased migration to the RPF Design System Button, with emphasis on theming and icon strategy.

Changes:

  • Introduces docs/ButtonRefactor.md outlining current button usage across the codebase and a proposed migration plan.
  • Documents proposed prop mappings, icon approach, and a theming strategy using CSS custom properties.
  • Captures verification steps and success metrics for the migration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +232 to +251
:root {
// Editor-specific theming using existing RPF Button custom properties

// Note ideally one of these should be a default,
// meaning only overriding some variables for the other theme.

.--light {
// Light mode: different custom property values
--rpf-button-background-color: var(--rpf-teal-800);
--rpf-button-background-color-hover: var(--rpf-teal-400);
--rpf-button-text-color: var(--rpf-white);
}

.--dark {
// Dark mode: just override custom property values
--rpf-button-background-color: var(--rpf-grey-700);
--rpf-button-background-color-hover: var(--rpf-grey-600);
--rpf-button-text-color: var(--rpf-white);
// Icons inherit text color automatically
}
Comment on lines +57 to +72
| SaveButton | [src/components/SaveButton/SaveButton.jsx](src/components/SaveButton/SaveButton.jsx) | Save project functionality |
| DownloadButton | [src/components/DownloadButton/DownloadButton.jsx](src/components/DownloadButton/DownloadButton.jsx) | Download project functionality |
| ProjectName | [src/components/ProjectName/ProjectName.jsx](src/components/ProjectName/ProjectName.jsx) | Edit/save project name |
| ProjectBar | [src/components/ProjectBar/ProjectBar.jsx](src/components/ProjectBar/ProjectBar.jsx) | Scratch save button |
| FilePanel | [src/components/Menus/Sidebar/FilePanel/FilePanel.jsx](src/components/Menus/Sidebar/FilePanel/FilePanel.jsx) | File management actions |
| ProjectsPanel | [src/components/Menus/Sidebar/ProjectsPanel/ProjectsPanel.jsx](src/components/Menus/Sidebar/ProjectsPanel/ProjectsPanel.jsx) | Project listing actions |
| DownloadPanel | [src/components/Menus/Sidebar/DownloadPanel/DownloadPanel.jsx](src/components/Menus/Sidebar/DownloadPanel/DownloadPanel.jsx) | Download panel buttons |
| InstructionsPanel | [src/components/Menus/Sidebar/InstructionsPanel/InstructionsPanel.jsx](src/components/Menus/Sidebar/InstructionsPanel/InstructionsPanel.jsx) | Instruction navigation |

### **Button (custom) usages (15 components)**

| Component | File Path | Usage Context |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| RunButton | [src/components/RunButton/RunButton.jsx](src/components/RunButton/RunButton.jsx) | Run code execution |
| StopButton | [src/components/RunButton/StopButton.jsx](src/components/RunButton/StopButton.jsx) | Stop code execution |
| GeneralModal | [src/components/Modals/GeneralModal.jsx](src/components/Modals/GeneralModal.jsx) | Modal action buttons |
Comment on lines +75 to +84
| RenameFileModal | [src/components/Modals/RenameFileModal.jsx](src/components/Modals/RenameFileModal.jsx) | Rename modal buttons |
| Dropdown | [src/components/Menus/Dropdown/Dropdown.jsx](src/components/Menus/Dropdown/Dropdown.jsx) | Dropdown toggle button |
| SidebarBarOption | [src/components/Menus/Sidebar/SidebarBarOption.jsx](src/components/Menus/Sidebar/SidebarBarOption.jsx) | Sidebar navigation |
| SidebarBar | [src/components/Menus/Sidebar/SidebarBar.jsx](src/components/Menus/Sidebar/SidebarBar.jsx) | Sidebar container |
| ProgressBar | [src/components/Menus/Sidebar/InstructionsPanel/ProgressBar/ProgressBar.jsx](src/components/Menus/Sidebar/InstructionsPanel/ProgressBar/ProgressBar.jsx) | Step navigation |
| OutputViewToggle | [src/components/Editor/Runners/PythonRunner/OutputViewToggle.jsx](src/components/Editor/Runners/PythonRunner/OutputViewToggle.jsx) | Split/tabbed view toggle |
| NewInputPanelButton | [src/components/Editor/NewInputPanelButton/NewInputPanelButton.jsx](src/components/Editor/NewInputPanelButton/NewInputPanelButton.jsx) | Add editor panel |
| EditorInput | [src/components/Editor/EditorInput/EditorInput.jsx](src/components/Editor/EditorInput/EditorInput.jsx) | Tab close buttons |
| ToastCloseButton | [src/utils/ToastCloseButton.jsx](src/utils/ToastCloseButton.jsx) | Toast notification close |
| Notifications | [src/utils/Notifications.js](src/utils/Notifications.js) | Custom notification close |

**Example of usage**:

- [Dropdown.jsx](src/components/Menus/Dropdown/Dropdown.jsx) currently uses `buttonImage` prop, and multiple components use `ButtonIcon` React elements.
--rpf-button-border-width
--rpf-button-lg-height
--rpf-button-sm-height
--rpf-button-min-target-size

## Success metrics

- All tests passing
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be beneficial to bolster test coverage first in select areas, at the very least some visual regression tests, which would give us more confidence in the most impacted areas that there are no side effects

Copy link
Contributor

Choose a reason for hiding this comment

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

Some of these issues are also affecting editor-standalone, so it would be good to make that clearer if possible

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@zetter-rpf
Copy link
Contributor

We can add it to the project if it would be useful for others, but I think things like this are easier to edit and keep up to date as issue- otherwise any minor change to this file will need approval to do.

Also worth noting that no issues are being automatically deleted, they just are marked as closed and can be re-opened if needed.

@maxelkins
Copy link
Contributor Author

We can add it to the project if it would be useful for others, but I think things like this are easier to edit and keep up to date as issue- otherwise any minor change to this file will need approval to do.

Also worth noting that no issues are being automatically deleted, they just are marked as closed and can be re-opened if needed.

Happy to make it an issue - yeah closing is what I meant 😅

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.

4 participants