Repository navigation
fix(view): pass the current space to actions from the command palette - #11072
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
Pressing C inside a project already opens New issue with that project preselected, because the keyboard ActionHandler passes the current space to the action (hcengineering#4917). Starting the same action from the command palette (Ctrl/Cmd+K) did not, so the dialog fell back to the last used project. ShowActions now forwards the current space to ActionsPopup, which hands it to actions of the active application the same way the keyboard handler does. The keyboard handler no longer writes the space into the model action's own props object; both paths use a small helper that copies the props. Refs hcengineering#4547 (the C shortcut itself was fixed by hcengineering#4917) Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #4547
Problem
Pressing
Cinside a project already preselects that project in New issue: the keyboardActionHandlerpasses the current space to the action (#4917), so #4547 itself appears to be fixed and can probably be closed. Starting the same action from the command palette (Ctrl/Cmd+K → New issue) did not pass the space, so the dialog fell back to the last used project.While looking at this, the keyboard handler turned out to write the space into the model action's own
actionProps.propsobject (a shallow copy), which leaves a stale space on actions that declareprops(e.g. Set due date).Changes
ShowActionsforwards the current space toActionsPopup, which passes it only to actions of the active application (global actions and other apps are unaffected).withCurrentSpace()returns a copy of the action props; both the keyboard handler and the palette use it, so the model action is no longer mutated.Tests
actionSpace.test.ts(copy semantics, no mutation).