Skip to content

Conversation

@meganrm
Copy link
Contributor

@meganrm meganrm commented Nov 13, 2025

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.

  • New feature (non-breaking change which adds functionality)

Steps to Verify:

  1. bun dev
  2. can't hit the re-run button
  3. change a parameter
  4. can run

Screenshots (optional):

Screenshot 2025-11-12 at 8 54 56 PM

Uploading Screenshot 2025-11-13 at 9.25.46 AM.png…

@meganrm meganrm requested review from ascibisz, Copilot and interim17 and removed request for interim17 November 13, 2025 04:58
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

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 useIsOriginalRecipe selector 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.

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-11-14 00:34 UTC

@meganrm meganrm requested a review from rugeli November 13, 2025 16:55
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 20.1% 367 / 1825
🔵 Statements 20.1% 367 / 1825
🔵 Functions 40% 24 / 60
🔵 Branches 71.05% 81 / 114
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/components/RecipeForm/index.tsx 0% 0% 0% 0% 1-3, 9, 15-19, 21-41, 43-46, 49-54, 56-58, 60, 62-63
src/state/store.ts 0% 0% 0% 0% 1, 51, 53-59, 61-63, 65, 67-70, 72-86, 88-89, 91-92, 94-96, 99-101, 104, 107-115, 117-119, 121-123, 125-128, 130-138, 140-151, 153-164, 166-168, 170, 172-177, 179-188, 190-193, 196-205, 208-214, 216-217, 219-227, 229-246, 248-264, 267-274, 276-281, 283-288, 290-294, 296-300, 302-303, 307-309, 311-314, 316-319, 321-324, 326-329, 331-342, 344-348, 351-366
Generated in workflow #170

Base automatically changed from feature/ssot-refactor to main November 13, 2025 19:37
Comment on lines +337 to +342
export const useIsOriginalRecipe = () => {
const recipe = useCurrentRecipeData();
if (!recipe) return true;
return Object.keys(recipe.edits).length === 0;
};

Copy link
Contributor

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

@meganrm meganrm requested a review from Copilot November 13, 2025 20:12
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

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>
Copy link

Copilot AI Nov 13, 2025

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.

Suggested change
<strong>Re-run</strong>
Re-run

Copilot uses AI. Check for mistakes.
height: var(--header-height);
box-sizing: border-box;
border-bottom: 1px solid;
border-bottom: 1px solid #ddd;
Copy link

Copilot AI Nov 13, 2025

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.

Suggested change
border-bottom: 1px solid #ddd;

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@rugeli rugeli left a 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.

@meganrm
Copy link
Contributor Author

meganrm commented Nov 13, 2025

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

@meganrm meganrm merged commit 262dc71 into main Nov 14, 2025
2 checks passed
@meganrm meganrm deleted the feature/rerun-button branch November 14, 2025 00:34
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.

disable the re-run button

5 participants