-
Notifications
You must be signed in to change notification settings - Fork 0
disable button if no parameters have been changed #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…hub.com/mesoscope/cellpack-client into feature/ssot-refactor
…nto feature/ssot-refactor
…nto feature/ssot-refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds functionality to disable the "Re-run" button when no parameters have been changed from their defaults. The button is enabled only when users have edited at least one parameter.
- Adds a new
useIsOriginalRecipeselector that checks if any edits exist - Disables the Re-run button when no edits have been made
- Adds a tooltip to guide users when the button is disabled
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/state/store.ts | Adds useIsOriginalRecipe selector to check for recipe edits; includes formatting improvements |
| src/components/RecipeForm/index.tsx | Updates Re-run button to be disabled when recipe is unmodified and adds tooltip with guidance |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
…nto feature/rerun-button
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
| export const useIsOriginalRecipe = () => { | ||
| const recipe = useCurrentRecipeData(); | ||
| if (!recipe) return true; | ||
| return Object.keys(recipe.edits).length === 0; | ||
| }; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I reintroduced useIsModified in essentially the same way as this in #154
Assuming this merges first I'll bring these changes over and use this selector
…nto feature/rerun-button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| disabled={isPacking || isOriginalRecipe} | ||
| style={{ width: "100%" }} | ||
| > | ||
| <strong>Re-run</strong> |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button text change from 'Re-run' to 'Re-run' is unrelated to the PR's purpose of disabling the button when parameters haven't changed. This styling change should be removed or submitted in a separate PR focused on UI improvements.
| <strong>Re-run</strong> | |
| Re-run |
| height: var(--header-height); | ||
| box-sizing: border-box; | ||
| border-bottom: 1px solid; | ||
| border-bottom: 1px solid #ddd; |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CSS color change is unrelated to the PR's purpose of disabling the button based on parameter changes. This change should be removed or submitted in a separate PR.
| border-bottom: 1px solid #ddd; |
rugeli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything in the steps worked well! just noticed one behavior that I'm unsure about: after I change a parameter and hit Re-run, should the button become disabled again until another parameter change happens?
Right now it stays enabled so I was able to keep pressing Re-run without updating anything.
That's a good question, the designs seem to just be this single case and for now, I think it is doing the job of letting the user know they can change parameters |
Problem
closes #138
Solution
disable the button if there are no edits
I also bolded the text to match the styling and added a border color for the header
Type of change
Please delete options that are not relevant.
Steps to Verify:
Screenshots (optional):