Skip to content

Conversation

@sky-ocean-spirits
Copy link
Collaborator

@sky-ocean-spirits sky-ocean-spirits commented Dec 9, 2025

What Is This Change?

Issue:
Start work page didn't remember last 'Push the new branch to remote' checkbox state and was always enabled by default.
After the changes, it remembers the last state of the checkbox

How Has This Been Tested?

Basic checks:

  • npm run lint
  • npm run test

Advanced checks:

  • If Atlassian employee & Bitbucket changes: did you test with DC in mind? See Instructions

Recommendations:

  • Update the CHANGELOG if making a user facing change

const errorController = useContext(ErrorControllerContext);

const [pushBranchEnabled, setPushBranchEnabled] = useState(true);
const [pushBranchEnabled, setPushBranchEnabled] = useState(state.pushBranchPreference ?? true);
Copy link
Contributor

Choose a reason for hiding this comment

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

🔎 Code Design - State Management

The initialization could cause UI flicker since state.pushBranchPreference is undefined on first render, showing the fallback value true briefly before the stored preference loads.

await Container.context.globalState.update('startWorkWithRovoDev', enabled);
}

async getPushBranchPreference(): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

🔎 Code Readability - Code Duplication

Consider extracting the storage key 'startWorkPushBranchToRemote' to a constant to avoid duplication and potential typos.

@bhorai-atl bhorai-atl force-pushed the AXON-1648-remember-last-push-new-branch-to-remote-checkbox-state branch from 95a6fdd to 533cac5 Compare December 10, 2025 15:43
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.

3 participants