Skip to content

feat(widgets): right-click context menu#60

Merged
rubenvdlinde merged 1 commit intodevelopmentfrom
feature/impl-widget-context-menu
Apr 30, 2026
Merged

feat(widgets): right-click context menu#60
rubenvdlinde merged 1 commit intodevelopmentfrom
feature/impl-widget-context-menu

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Implements widget context menu (REQ-WDG-015..017) per spec on development.

Features:

  • Right-click in edit mode opens popover with Edit/Remove/Cancel
  • View mode shows native browser menu
  • Auto-closes on outside click, switches on different widget
  • Position clamped to viewport edges

Files:

  • WidgetContextMenu.vue (new): Vue 2 SFC, Pencil/Delete icons
  • DashboardGrid.vue: @contextmenu.prevent, document listener
  • Translations: Added "Remove" key
  • Tests: 18 Vitest units

Quality: ESLint pass, Stylelint pass, 71 tests pass

@rubenvdlinde rubenvdlinde added the ready-for-code-review Build complete — awaiting code reviewer label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/mydash @ 1bfdde3

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 103/103
npm ✅ 342/342
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-04-30 19:12 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde rubenvdlinde force-pushed the feature/impl-widget-context-menu branch from 594d94b to df5acf2 Compare April 30, 2026 19:12
…WDG-015..017

Implements widget context menu with the following:

REQ-WDG-015 (Right-click context menu in edit mode):
- New WidgetContextMenu.vue component with Edit, Remove, Cancel buttons
- @contextmenu.prevent handler on grid items opens menu only in edit mode
- View mode allows native browser context menu
- Menu closes after any action

REQ-WDG-016 (Auto-close on outside interaction):
- Document-level click listener closes menu when clicking outside
- Right-clicking different widget switches menu to new position
- Only one menu visible at a time

REQ-WDG-017 (Position constraints):
- Menu positioned at cursor with min-width: 150px and z-index: 10000
- Clamped to viewport edges to stay fully visible
- Uses computed properties for dynamic positioning

Implementation details:
- WidgetContextMenu.vue: Vue 2 SFC with Pencil/Delete icons
- DashboardGrid.vue: Wired @contextmenu.prevent and document click handler
- onWidgetRightClick(): Captures event, validates edit mode
- onContextEdit/Remove(): Emits to parent for handling
- i18n: Added 'Remove' translation (Edit/Cancel already present)

Test coverage:
- 18 unit tests via Vitest covering all REQs
- Tests: view mode rejection, edit mode opening, button events
- Outside-click and multi-widget switching scenarios
- Position clamping behavior
- Listener cleanup on unmount

Quality gates:
- ESLint: Pass (0 errors, 9 pre-existing warnings in widgetBridge.js)
- Stylelint: Pass
- Vitest: 71 tests pass (CSS import pre-existing issue)
@rubenvdlinde rubenvdlinde force-pushed the feature/impl-widget-context-menu branch from df5acf2 to dab99b9 Compare April 30, 2026 19:12
@rubenvdlinde rubenvdlinde merged commit 07fe224 into development Apr 30, 2026
32 of 33 checks passed
@rubenvdlinde rubenvdlinde deleted the feature/impl-widget-context-menu branch April 30, 2026 19:13
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/mydash @ 65ed07a

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ⏭️
npm ⏭️
PHPUnit
Newman
Playwright

Quality workflow — 2026-04-30 19:13 UTC

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/mydash @ 6776cae

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 103/103
npm ✅ 342/342
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-04-30 19:15 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde added a commit that referenced this pull request Apr 30, 2026
…it gate per REQ-SHELL-001..007 (#68)

- REQ-SHELL-001: Update templates/index.php to render #app-workspace > #workspace-vue mount point; mount Vue on #workspace-vue in main.js
- REQ-SHELL-002: Add canEdit computed (isAdmin || dashboardSource === 'user') via inject; replaces old permissionLevel check; toolbar hidden via v-if (not v-show) when canEdit is false
- REQ-SHELL-003: 4-region layout with header strip (hamburger + label + toolbar); toolbar shows Customize/Close + Add Widget + Save Layout buttons; saveLayout() PUTs to group or user endpoint based on dashboardSource; disabled while saving; showSuccess/showError toasts
- REQ-SHELL-004: Hamburger toggles sidebarOpen; active-dashboard label displayed next to hamburger
- REQ-SHELL-005: Empty state via NcEmptyContent when activeDashboard is null; Create button shown only when allowUserDashboards=true
- REQ-SHELL-006: SidebarBackdrop and DashboardSwitcherSidebar integrated; backdrop click closes sidebar
- REQ-SHELL-007: document.click lifecycle delegated to DashboardGrid (already registered in mounted/beforeDestroy per #60)
- Vitest: 13 tests covering all 7 REQs (canEdit gate, hamburger, empty state, save layout endpoints, lifecycle)
rubenvdlinde added a commit that referenced this pull request Apr 30, 2026
…/nextcloud-vue (ADR-004) (#71)

Two stragglers added by widget-add-edit-modal (#65/#68 runtime-shell) and
widget-context-menu (#60) before ADR-004 landed via #34. Swap is mechanical:
NcButton + NcEmptyContent are already exported by @conduction/nextcloud-vue
and used elsewhere in the codebase (TileCard, WidgetRenderer, AdminSettings).
rubenvdlinde added a commit that referenced this pull request May 3, 2026
…WDG-015..017 (#60)

Implements widget context menu with the following:

REQ-WDG-015 (Right-click context menu in edit mode):
- New WidgetContextMenu.vue component with Edit, Remove, Cancel buttons
- @contextmenu.prevent handler on grid items opens menu only in edit mode
- View mode allows native browser context menu
- Menu closes after any action

REQ-WDG-016 (Auto-close on outside interaction):
- Document-level click listener closes menu when clicking outside
- Right-clicking different widget switches menu to new position
- Only one menu visible at a time

REQ-WDG-017 (Position constraints):
- Menu positioned at cursor with min-width: 150px and z-index: 10000
- Clamped to viewport edges to stay fully visible
- Uses computed properties for dynamic positioning

Implementation details:
- WidgetContextMenu.vue: Vue 2 SFC with Pencil/Delete icons
- DashboardGrid.vue: Wired @contextmenu.prevent and document click handler
- onWidgetRightClick(): Captures event, validates edit mode
- onContextEdit/Remove(): Emits to parent for handling
- i18n: Added 'Remove' translation (Edit/Cancel already present)

Test coverage:
- 18 unit tests via Vitest covering all REQs
- Tests: view mode rejection, edit mode opening, button events
- Outside-click and multi-widget switching scenarios
- Position clamping behavior
- Listener cleanup on unmount

Quality gates:
- ESLint: Pass (0 errors, 9 pre-existing warnings in widgetBridge.js)
- Stylelint: Pass
- Vitest: 71 tests pass (CSS import pre-existing issue)
rubenvdlinde added a commit that referenced this pull request May 3, 2026
…it gate per REQ-SHELL-001..007 (#68)

- REQ-SHELL-001: Update templates/index.php to render #app-workspace > #workspace-vue mount point; mount Vue on #workspace-vue in main.js
- REQ-SHELL-002: Add canEdit computed (isAdmin || dashboardSource === 'user') via inject; replaces old permissionLevel check; toolbar hidden via v-if (not v-show) when canEdit is false
- REQ-SHELL-003: 4-region layout with header strip (hamburger + label + toolbar); toolbar shows Customize/Close + Add Widget + Save Layout buttons; saveLayout() PUTs to group or user endpoint based on dashboardSource; disabled while saving; showSuccess/showError toasts
- REQ-SHELL-004: Hamburger toggles sidebarOpen; active-dashboard label displayed next to hamburger
- REQ-SHELL-005: Empty state via NcEmptyContent when activeDashboard is null; Create button shown only when allowUserDashboards=true
- REQ-SHELL-006: SidebarBackdrop and DashboardSwitcherSidebar integrated; backdrop click closes sidebar
- REQ-SHELL-007: document.click lifecycle delegated to DashboardGrid (already registered in mounted/beforeDestroy per #60)
- Vitest: 13 tests covering all 7 REQs (canEdit gate, hamburger, empty state, save layout endpoints, lifecycle)
rubenvdlinde added a commit that referenced this pull request May 3, 2026
…/nextcloud-vue (ADR-004) (#71)

Two stragglers added by widget-add-edit-modal (#65/#68 runtime-shell) and
widget-context-menu (#60) before ADR-004 landed via #34. Swap is mechanical:
NcButton + NcEmptyContent are already exported by @conduction/nextcloud-vue
and used elsewhere in the codebase (TileCard, WidgetRenderer, AdminSettings).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-code-review Build complete — awaiting code reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant