Skip to content

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

Open
jsjgdh wants to merge 4 commits intoGraphiteEditor:masterfrom
jsjgdh:Double-space
Open

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

Conversation

@jsjgdh
Copy link
Contributor

@jsjgdh jsjgdh commented Feb 18, 2026

@gemini-code-assist
Copy link

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.

Copy link

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

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
Copy link
Member

Keavon commented Feb 18, 2026

!build (build link)

@github-actions
Copy link

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

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

Comments