Skip to content

Graph Editor : UX Updates Towards "Keyboardless" Workflow - #3043

Open
kwokcb wants to merge 12 commits into
AcademySoftwareFoundation:mainfrom
kwokcb:keyboardless_graph_editor
Open

Graph Editor : UX Updates Towards "Keyboardless" Workflow#3043
kwokcb wants to merge 12 commits into
AcademySoftwareFoundation:mainfrom
kwokcb:keyboardless_graph_editor

Conversation

@kwokcb

@kwokcb kwokcb commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Updates

Update #3037.
Fixes #3032.

  • Add "Add node" : RMB on background

  • Add "hamburger" control : RMB brings up context senstive menu.

    • Adds in rename (1) and delete node.
    • Others can easily add more items for menu equivalents or new functionality.
  • Changes pan to MMB to avoid mouse conflicts and maps properly for 2-button mice / pen / touch.

    • LMB usage for select / placement / connection workflow is unchanged. (2)
  • Fix so that focus (F) does not occur when using CTRL-F (search)

Notes:

(1) Rename is in-menu to avoid constant renaming causing "flashing" in UI and slow re-render on every keystroke.
(2) the remapping of pan should make it more consistent with DCCs / Web based editors and can handle 2-button mice / touch interfaces.

Implementation

Some refactoring for code reuse as much as possible for shared actions between keyboard vs mouse actions.

Results

  1. New "hamburger" control
image
  1. Rename node in context
image image
  1. Add node (via RMB)
image

kwokcb added 9 commits August 16, 2026 20:44
- RMB add node
- RMB on hamburger in node -> popup menu. Add only delete for now
Fix: CTRL-F search without also trigger focus (F).
Add "rename" to menu.
- Bypass imgui node editor F key invocation which is always triggered regardless of modifiers. This is the main source of the bug.
- Disable hamburger on read-only nodes and disallow rename / delete on any read-only graphs.
- Extract out node width computation utility for us bye hamburger as well as previous pin placement.
Disable RMB add popup on readonly graphs
const float BASE_UI_FONT_SIZE = 18.0f;
const float BASE_PIN_ICON_SIZE = 18.0f;
const float MIN_PIN_ICON_SIZE = 18.0f;
const float HDR_TEXT_INDENT = 4.0f;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Global header indent

_layoutPending(false),
_needsNavigation(false),
_delete(false),
_nodeMenuToOpen(-1),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Track node menu popup and deletion info if delete chosen


void Graph::drawNodeMenu(UiNodePtr node)
{
const float buttonSize = computeHamburgerSize();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Node menu icon : "hamburger"


float Graph::computeNodeContentWidth(UiNodePtr node)
{
// Compute the node's content width (widest of the title row, shown

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Utilitly to compute max text width for node

ImColor(ImColor(85, 85, 85, 255)), 0.f);
ImGui::Indent(hdrTextIndent);
ImGui::Text("%s", node->getName().c_str());
ImGui::TextUnformatted(node->getName().c_str());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Extend title with node menu icon.

addPinPopup();
readOnlyPopup();
ImGui::PopStyleVar();
_nodeMenuRects.clear();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fully clear state.

_popup = true;
}
}
deleteNodeById(id);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Uses common delete node logic.

// this frame and restore them immediately after.
if ((io2.KeyCtrl || io2.KeySuper) && ImGui::IsKeyPressed(ImGuiKey_F))
{
ed::EnableShortcuts(false);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was very tricky to fix since you need to superscede the imgui node editor logic which always assumes F key (regardless of modifier) is pressed. Reulsint in CMD/CTRL-F always kicking off "focus on node" logic.


// Options
bool _saveNodePositions;
std::vector<ImVec4> _nodeMenuRects;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Used to track node menu location (hamburger) for hover hilighting

// Create editor config and context.
ed::Config config;
config.SettingsFile = nullptr;
config.DragButtonIndex = 0;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Set mapping of mouse buttons.

@kwokcb

kwokcb commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

@lfl-eholthouser, @jstone-lucasfilm : if you have some time could you take a look at this PR. It addresses a few issues but naturally not all but maybe useful to allow building on further for upcoming dev days. Thanks.

@jstone-lucasfilm

Copy link
Copy Markdown
Member

Thanks for this proposal, @kwokcb! The rename consolidation and the Ctrl+F fix both look like clear improvements, and I'd be glad to see them merged soon. The new renameNode corrects the downstream update logic for node renames, committing on Enter rather than every keystroke is the right call, and disabling editor shortcuts around ed::End matches the pattern in the ImGui Node Editor widgets example.

On the mouse remap, I'd suggest we reconsider before merging. The PR moves panning to the middle button to avoid a conflict with a right-click menu, but ImGui Node Editor already resolves that conflict for us: its ContextMenuAction distinguishes a right-click from a right-drag, which is why the default config places both navigate and context menu on button 1. The blueprints example demonstrates the intended pattern with ed::ShowBackgroundContextMenu and ed::ShowNodeContextMenu. Building on that API rather than polling IsMouseReleased(1) would keep right-drag as pan, open the node menu on a right-click anywhere on the node, and remove the need for _nodeMenuRects and its hover tracking. It would also address a few potential issues in your current proposal:

  • Right-clicking a node body, pin, or link opens the Add Node popup, since only the hamburger rectangle is excluded.
  • A right-drag that ends on the background opens the Add Node popup as well.
  • Panning becomes unavailable on trackpads and two-button mice, which works against the goal of a keyboardless workflow.

If the hamburger feature is included in the current PR, I'd expect it to respond to a left click, matching the convention for that control.

The MacOS scaling change in Main.cpp seems separable from this work, and I'd suggest we take it up in its own PR with before-and-after screenshots. With our current ImGui version, skipping the content scale means fonts are rasterized at 1x and upscaled by the framebuffer scale, so this trades doubled text for blurred text on Retina displays. The usual approach for ImGui 1.88 is to rasterize at the scaled size and set FontGlobalScale to the inverse.

A few smaller notes:

  • documents/DeveloperGuide/GraphEditor.md still lists right-click as pan, and should follow whatever binding we settle on.
  • Moving addNodePopup after node creation leaves the search, add-pin, and read-only popups without the window padding style they previously shared.
  • The pin offset fix for the pins-on-border option is a good improvement, and worth a mention in the PR description.

Given the above, one option would be to split the rename and Ctrl+F work into a PR we can merge right away, with the context menu work following on the editor's native API.

Does that approach sound good to you?

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.

Ctrl+F triggers framing of the node graph in MaterialX Graph Editor

2 participants