Skip to content

double-tapping space to open/close the node graph instead of Ctrl+Space#3786

Open
jsjgdh wants to merge 12 commits into
GraphiteEditor:masterfrom
jsjgdh:Double-space
Open

double-tapping space to open/close the node graph instead of Ctrl+Space#3786
jsjgdh wants to merge 12 commits into
GraphiteEditor:masterfrom
jsjgdh:Double-space

Conversation

@jsjgdh

@jsjgdh jsjgdh commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jsjgdh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new DoubleTap input event for keyboard keys, enhancing the application's input handling capabilities. The primary motivation is to improve user experience by reassigning the node graph overlay toggle from a Ctrl+Space combination to a more intuitive double-tap of the spacebar. This change required extending the input message system, updating how input mappings are defined and processed, and adding robust detection logic within the input preprocessor, complete with new unit tests.

Highlights

  • New Input Event: Introduced a new DoubleTap input event type for keyboard keys, allowing for more flexible input interactions.
  • Node Graph Hotkey Change: The hotkey for toggling the node graph overlay has been changed from Ctrl+Space to a DoubleTap(Space) for improved ergonomics.
  • Double-Tap Detection Logic: Implemented logic within the input preprocessor to detect double-taps on keys based on a configurable time threshold.
  • Input System Integration: The input mapping system has been updated across multiple files to recognize, process, and route DoubleTap events correctly.
Changelog
  • editor/src/messages/input_mapper/input_mapper_message.rs
    • Added DoubleTap(Key) variant to the InputMapperMessage enum.
  • editor/src/messages/input_mapper/input_mapper_message_handler.rs
    • Chained the new double_tap mappings into the iteration of all mapping entries.
    • Included InputMapperMessage::DoubleTap(key) in the pattern matching for extracting keys from input messages.
  • editor/src/messages/input_mapper/input_mappings.rs
    • Modified the DocumentMessage::GraphViewOverlayToggle action to trigger on DoubleTap(Space) instead of KeyDown(Space) with Control modifier.
    • Updated the tuple destructuring for mappings to include double_tap.
    • Added a loop to sort the double_tap sublists.
    • Included double_tap in the returned Mapping struct.
  • editor/src/messages/input_mapper/utility_types/macros.rs
    • Initialized a mutable double_tap KeyMappingEntries array within the mapping! macro.
    • Added a match arm to handle InputMapperMessage::DoubleTap(key) for assigning mapping entries.
    • Included double_tap in the final tuple returned by the mapping! macro.
  • editor/src/messages/input_mapper/utility_types/misc.rs
    • Added a pub double_tap: [KeyMappingEntries; NUMBER_OF_KEYS] field to the Mapping struct.
    • Implemented a match arm in get_mapping_entries to return the appropriate double_tap entry.
  • editor/src/messages/input_preprocessor/input_preprocessor_message_handler.rs
    • Imported DOUBLE_CLICK_MILLISECONDS constant.
    • Added last_key_down: Option<(Key, u64)> to track the last key press for double-tap detection.
    • Modified the KeyDown message handling to check for a double-tap within DOUBLE_CLICK_MILLISECONDS and emit InputMapperMessage::DoubleTap if detected.
    • Added new test functions key_down, process_double_tap_within_threshold, and process_double_tap_outside_threshold to validate double-tap detection.
Activity
  • A discussion regarding this change was held on Discord with @Keavon.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a DoubleTap input event and maps it to toggling the node graph overlay, replacing the old Ctrl+Space shortcut. The implementation correctly adds the new event type throughout the input mapping system.

However, I've identified a functional issue in the double-tap detection logic within input_preprocessor_message_handler.rs. The current implementation causes both taps of a double tap to also be processed as single taps, leading to unintended side effects. I've provided a suggestion to correct this behavior for the second tap. I've also noted that a more complete fix to prevent the first tap from firing immediately would require a more significant change, which could be addressed in a follow-up.

Additionally, I've made a minor suggestion to improve code clarity regarding a constant name.

@Keavon

Keavon commented Feb 18, 2026

Copy link
Copy Markdown
Member

!build (build link)

@github-actions

Copy link
Copy Markdown
📦 Build Complete for 99ec5da
https://0904a071.graphite.pages.dev

@Keavon

Keavon commented Feb 21, 2026

Copy link
Copy Markdown
Member

!build (Run ID 22263581839)

@github-actions

Copy link
Copy Markdown
📦 Build Complete for f2af3e5
https://922f8852.graphite.pages.dev

@Keavon

Keavon commented Feb 21, 2026

Copy link
Copy Markdown
Member

This needs to trigger upon the second tap's release, not upon its depress.

@Keavon

Keavon commented Feb 22, 2026

Copy link
Copy Markdown
Member

!build (Run ID 22272302375)

@github-actions

Copy link
Copy Markdown
📦 Build Complete for cfca751
https://009ddbc4.graphite.pages.dev

@Keavon

Keavon commented Feb 22, 2026

Copy link
Copy Markdown
Member

!build (Run ID 22273785584)

@github-actions

Copy link
Copy Markdown
📦 Build Complete for e4a6b46
https://1fcbbe30.graphite.pages.dev

@jsjgdh jsjgdh marked this pull request as draft February 22, 2026 11:10
@jsjgdh jsjgdh marked this pull request as ready for review February 22, 2026 16:50
@Keavon

Keavon commented Feb 23, 2026

Copy link
Copy Markdown
Member

!build (Run ID 22296196398)

@github-actions

Copy link
Copy Markdown
📦 Build Complete for ec89dfd
https://c8278268.graphite.pages.dev

@Keavon

Keavon commented Feb 23, 2026

Copy link
Copy Markdown
Member

!build (Run ID 22324976474)

@github-actions

Copy link
Copy Markdown
📦 Build Complete for ae2c82d
https://544fb67e.graphite.pages.dev

@Keavon

Keavon commented Feb 24, 2026

Copy link
Copy Markdown
Member

!build (Run ID 22353351358)

@github-actions

Copy link
Copy Markdown
📦 Build Complete for fc1598c
https://e5615a70.graphite.pages.dev

@Keavon Keavon force-pushed the master branch 6 times, most recently from d6228da to e58c1de Compare March 16, 2026 23:03
@Keavon Keavon force-pushed the master branch 3 times, most recently from 05c5187 to fcc53f5 Compare March 19, 2026 09:26
@Keavon Keavon force-pushed the master branch 2 times, most recently from 9b97ab7 to 2e842cb Compare March 19, 2026 11:00
@cubic-dev-ai

cubic-dev-ai Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

@cubic

@jsjgdh I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@Keavon Keavon force-pushed the master branch 2 times, most recently from f07c79b to 76938eb Compare April 29, 2026 12:16
@Keavon Keavon force-pushed the master branch 2 times, most recently from 4b7a823 to 847b8e9 Compare May 17, 2026 14:37
@timon-schelling timon-schelling force-pushed the master branch 2 times, most recently from 15fcaac to d5f0140 Compare May 17, 2026 15:37
@jsjgdh

jsjgdh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@cubic-dev

@cubic-dev-ai

cubic-dev-ai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev

@jsjgdh I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 8 files

Confidence score: 4/5

  • This PR appears safe to merge: the only flagged item is a PR title formatting/policy issue, not a functional defect in runtime behavior.
  • The reported issue has moderate stated severity but is process-oriented (sentence case/imperative mood enforcement), so user-facing regression risk is low.
  • Pay close attention to editor/src/messages/input_preprocessor/input_preprocessor_message_handler.rs - verify the title-enforcement check aligns with repository contribution rules and won’t cause unnecessary workflow friction.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/input_preprocessor/input_preprocessor_message_handler.rs">

<violation number="1" location="editor/src/messages/input_preprocessor/input_preprocessor_message_handler.rs:2">
P2: Custom agent: **PR title enforcement**

PR title violates sentence case and imperative mood requirements</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@@ -1,4 +1,5 @@
use crate::application::Editor;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Custom agent: PR title enforcement

PR title violates sentence case and imperative mood requirements

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At editor/src/messages/input_preprocessor/input_preprocessor_message_handler.rs, line 2:

<comment>PR title violates sentence case and imperative mood requirements</comment>

<file context>
@@ -1,4 +1,5 @@
 use crate::application::Editor;
+use crate::consts::DOUBLE_CLICK_MILLISECONDS;
 use crate::messages::input_mapper::utility_types::input_keyboard::{Key, KeyStates, ModifierKeys};
 use crate::messages::input_mapper::utility_types::input_mouse::{MouseButton, MouseKeys, MouseState};
</file context>

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.

2 participants