Skip to content

fix(view): pass the current space to actions from the command palette - #11072

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/new-issue-shortcut-project
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/new-issue-shortcut-project

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Refs #4547

Problem

Pressing C inside a project already preselects that project in New issue: the keyboard ActionHandler passes 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.props object (a shallow copy), which leaves a stale space on actions that declare props (e.g. Set due date).

Changes

  • ShowActions forwards the current space to ActionsPopup, which passes it only to actions of the active application (global actions and other apps are unaffected).
  • New helper 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

  • New actionSpace.test.ts (copy semantics, no mutation).
  • Manual: in a project's issue list, Ctrl/Cmd+K → New issue preselects the project; in My issues the last used project is used as before; sub-issue creation still uses the parent's project.

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

No deployments
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.

1 participant