feat(HappyHare): Replace right-click context menu with regular click menus and completes operations#2437
feat(HappyHare): Replace right-click context menu with regular click menus and completes operations#2437moggieuk wants to merge 9 commits intomainsail-crew:developfrom
Conversation
📝 WalkthroughWalkthroughRefactored MMU gate interaction to a click-based filament-edit workflow: dialog gains an Changes
Sequence DiagramsequenceDiagram
participant User
participant Gate as MmuUnitGate
participant Unit as MmuUnit
participant Panel as MmuPanel
participant Dialog as MmuEditGateMapDialog
User->>Gate: click gate
Gate->>Gate: handleClickGate()
Gate->>Unit: emit edit-filament(gateIndex)
Unit->>Panel: emit edit-filament(gateIndex)
Panel->>Panel: editFilament(gateIndex) / set initialEditGate
Panel->>Dialog: open dialog (initial-gate)
rect rgba(100,150,200,0.5)
User->>Dialog: perform edits
end
Dialog->>Panel: emit close
Panel->>Panel: reset initialEditGate
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/components/panels/Mmu/MmuUnitGate.vue`:
- Around line 212-215: The handleClickGate method calls
selectGate(this.gateIndex) but selectGate is defined to take no arguments (it
reads this.gateIndex itself); remove the extraneous parameter so call
selectGate() instead (or alternatively update selectGate to accept an index and
use it everywhere, but prefer the simpler fix of changing handleClickGate to
call selectGate() and ensure no other callers rely on the old signature).
🧹 Nitpick comments (2)
src/components/dialogs/MmuEditGateMapDialog.vue (1)
83-92: Minor: redundantundefinedcheck.The
initialGateprop is typed asnumber | nullwith a default ofnull, so it can never beundefined. The!== undefinedguard on line 87 is unnecessary.Suggested simplification
`@Watch`('showDialog') onShowDialogChanged(val: boolean) { if (!val) return - if (this.initialGate !== null && this.initialGate !== undefined) { + if (this.initialGate !== null) { this.selectedGate = this.initialGate } else { this.selectedGate = TOOL_GATE_UNKNOWN } }src/components/panels/Mmu/MmuUnitGate.vue (1)
8-11: No-op@select-spoolhandler used solely for CSS hover class.The
() => {}handler exists only to makehasSelectSpoolListenerreturntrueinMmuUnitGateSpool, which drives the.hasSelectSpoolhover CSS class. Since the actual click is handled by the parent div's@click="handleClickGate"via DOM bubbling, this works but is indirect. A dedicated boolean prop (e.g.,:show-hover="true") would be more explicit.That said, if this pattern was already used before the rename, keeping it consistent is reasonable.
Description
This PR removes the right-click context menu and replaces it with a regular click. This simplifies operation especially on mobile devices and was advocated by the community. The sensitivity of menu items is set based on current MMU state/capabilities and now necessarily extends to the bypass gate. This PR groups all changes the the context menu including the ability to invoke none gcode command operations like opening the filament editor dialog with the selected gate as default. The cursor type is pointer for gate selection and menu in the main panel
Note: There will be a minor merge conflict with PR #2429 in MmuUnitGate.vue since both modify the same template line. The correct resolution is (note
mb-n5,@clickhandling and cursorType class):Related Tickets & Documents
This PR replaces closed PR #2430
Mobile & Desktop Screenshots/Recordings
[optional] Are there any post-deployment tasks we need to perform?
n/a