Skip to content

fix(HistoryList): implement context menu close with EventBus#2378

Merged
meteyou merged 2 commits intomainsail-crew:developfrom
meteyou:fix/history-list-context-menu
Jan 8, 2026
Merged

fix(HistoryList): implement context menu close with EventBus#2378
meteyou merged 2 commits intomainsail-crew:developfrom
meteyou:fix/history-list-context-menu

Conversation

@meteyou
Copy link
Member

@meteyou meteyou commented Jan 6, 2026

Description

This PR fix the ContextMenu in the History Page list. When you open another context menu, it will close all open context menu before.

Related Tickets & Documents

none

Mobile & Desktop Screenshots/Recordings

before:
grafik

after:
grafik

[optional] Are there any post-deployment tasks we need to perform?

none

…entBus

Signed-off-by: Stefan Dej <meteyou@gmail.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the context menu behavior in the History page list by implementing the EventBus pattern to ensure that only one context menu can be open at a time. When a new context menu is opened, all previously open context menus are closed automatically.

  • Integrates the existing CLOSE_CONTEXT_MENU EventBus event into History list components
  • Removes redundant $nextTick logic and early return checks in showContextMenu methods
  • Adds proper lifecycle hooks for event listener registration and cleanup

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/panels/History/HistoryListEntryMaintenance.vue Implements EventBus context menu close pattern with proper event listener registration in mounted/beforeDestroy hooks
src/components/panels/History/HistoryListEntryJob.vue Implements EventBus context menu close pattern with proper event listener registration in mounted/beforeDestroy hooks

The implementation is solid and follows the established pattern already used throughout the codebase in similar components (GcodefilesPanel, Status panels, etc.). The changes properly:

  • Emit the CLOSE_CONTEXT_MENU event when opening a context menu
  • Listen for the event and close the local context menu accordingly
  • Clean up event listeners in the beforeDestroy lifecycle hook to prevent memory leaks

No issues were identified in this code review.

@meteyou meteyou added this to the v2.17.0 milestone Jan 7, 2026
mryel00
mryel00 previously approved these changes Jan 8, 2026
@meteyou meteyou merged commit 4e75318 into mainsail-crew:develop Jan 8, 2026
5 checks passed
@meteyou meteyou deleted the fix/history-list-context-menu branch January 8, 2026 20:14
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.

3 participants