Skip to content

Improve discard unstaged messaging and disabled state clarity#5406

Open
dhanush0x96c wants to merge 5 commits intojesseduffield:masterfrom
dhanush0x96c:fix/discard-menu-logic
Open

Improve discard unstaged messaging and disabled state clarity#5406
dhanush0x96c wants to merge 5 commits intojesseduffield:masterfrom
dhanush0x96c:fix/discard-menu-logic

Conversation

@dhanush0x96c
Copy link
Copy Markdown

@dhanush0x96c dhanush0x96c commented Mar 22, 2026

Summary

Fixes #5388

This PR improves the clarity of the "Discard unstaged changes" action by refining its tooltip and providing more precise disabled-state messages.


Problem

The previous messaging could be confusing:

  • The tooltip did not clearly communicate that the action preserves staged changes
  • The disabled reason was generic and did not explain why the option was unavailable

This made it difficult for users to understand the intent of the action and the conditions under which it is enabled.


Solution

This PR improves the wording and feedback without changing any underlying behavior:

  • Updated the tooltip to explicitly state that staged changes are preserved

  • Split the disabled reason into two context-specific messages:

    • When there are no staged changes"No staged changes to keep."
    • When there are no unstaged changes"No unstaged changes."

These changes make the UI more intuitive and reduce confusion by clearly explaining both the action and its availability.


Checklist

  • Cheatsheets are up-to-date (go generate ./...)
  • Code has been formatted
  • Text is internationalised
  • Reviewed changes for errors and inconsistencies

The "Discard unstaged changes" menu item was incorrectly disabled when
no staged changes were present, even if unstaged changes existed. This
change ensures it is only disabled when there are no unstaged changes.
@dhanush0x96c
Copy link
Copy Markdown
Author

Note: updated the English translation only; other languages are handled via Crowdin.

@dhanush0x96c dhanush0x96c changed the title Fix discard unstaged changes incorrectly requiring staged changes Improve discard unstaged messaging and disabled state clarity Mar 27, 2026
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.

Illogical message when deleting unstaged changes

1 participant