Magic Wand: OCaml toolbar dblclick -> panel summon#2
Open
jyh wants to merge 1 commit into
Open
Conversation
Wire the arrow-slot double-click path in toolbar.ml to open the Magic Wand panel (and fall back to the tool-options dialog for tools that use one), closing the parity gap left when Magic Wand was merged in e60064b. - toolbar.ml/mli: add tool_options_panel_id (reads tool_options_panel from workspace.json) and panel_id_to_kind ("magic_wand" → Workspace_layout.Magic_wand), mirroring toolbar_grid.rs commit 3292de1 - toolbar class + create: accept optional ?workspace_layout and ?refresh_dock, matching the existing menubar.ml pattern - direct_btn TWO_BUTTON_PRESS: prefer panel → dialog dispatch, calls Workspace_layout.show_panel + refresh_dock on a panel hit - canvas.ml/mli: return workspace_layout and refresh_dock closure from create_main_window so main.ml can thread them into Toolbar.create - main.ml: destructure new return tuple; pass ~workspace_layout and ~refresh_dock to Toolbar.create - canvas_test.ml: update pattern match for the extended tuple https://claude.ai/code/session_01VG3Rqk2he5zQReMFz7Rdfi
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.
Summary
tool_options_panel_id+panel_id_to_kindhelpers added totoolbar.ml/.mli: reads thetool_options_panelfield from workspace.json (parallel to existingtool_options_dialog_id), and maps"magic_wand"→Workspace_layout.Magic_wand. Mirrors Rust commit 3292de1 (toolbar_grid.rs).Toolbar.createrefactored to accept?workspace_layout:Workspace_layout.workspace_layoutand?refresh_dock:(unit -> unit), matching the pattern already used byMenubar.create(menubar.ml).direct_btnTWO_BUTTON_PRESS wired: on double-click the arrow slot now checkstool_options_panel_idfirst → callsWorkspace_layout.show_panel+refresh_dock; falls back totool_options_dialog_idfor tools that use a modal dialog. A tool yaml uses one or the other, never both — so this is mutually exclusive dispatch, matching the Rust reference.canvas.ml/.mli:create_main_windowreturn type extended from a 4-tuple to a 6-tuple addingworkspace_layoutand a(fun () -> !dock_refresh ())closure, somain.mlcan thread them intoToolbar.createwithout restructuring ownership.main.mldestructures the new tuple and passes~workspace_layout ~refresh_dock;canvas_test.mlupdated to match.Test plan
dune buildclean (no new warnings or errors)dune runtest— pre-existing failures inalign_fixture_testandcanvas_testare unrelated; all other suites passReference
toolbar_grid.rspanel_id_to_kind+ dblclickContentViewonOpenToolOptionsjas_app._open_tool_options_dialoghttps://claude.ai/code/session_01VG3Rqk2he5zQReMFz7Rdfi
Generated by Claude Code