-
Notifications
You must be signed in to change notification settings - Fork 25
fix: context actions types #856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 centralizes the MenuSection and MenuSectionDrop type definitions into a new types.ts file and updates all imports to consume them from the ContextActions index, cleaning up duplicate type declarations across components.
- Introduced
types.tswithMenuSectionandMenuSectionDrop - Exported new types via
index.tsand removed inline duplicates - Updated component and test imports to use the centralized types
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/components/ContextActions/ActionMenuDropItem.spec.ts | Updated test import for MenuSectionDrop |
| src/components/FilesList/ContextActions.vue | Switched MenuSection import to centralized module |
| src/components/ContextActions/types.ts | Added new type definitions for context actions |
| src/components/ContextActions/index.ts | Re-exported types from types.ts |
| src/components/ContextActions/ContextActionMenu.vue | Removed duplicate inline types and imported from types.ts |
| src/components/ContextActions/ActionMenuDropItem.vue | Adjusted MenuSectionDrop import to types.ts |
| src/components/AppTopBar.vue | Switched MenuSection import to centralized module |
Comments suppressed due to low confidence (1)
packages/web-pkg/src/components/ContextActions/types.ts:3
- [nitpick] Consider adding JSDoc comments above
MenuSectionDrop(andMenuSection) to describe each property and usage scenarios for future maintainability.
export type MenuSectionDrop = {
| import { AppearanceType, uniqueId } from '@opencloud-eu/design-system/helpers' | ||
| import type { ActionOptions } from '../../composables' | ||
| import type { MenuSectionDrop } from './ContextActionMenu.vue' | ||
| import { MenuSectionDrop } from './types' |
Copilot
AI
Jun 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Since MenuSectionDrop is only used as a TypeScript type, consider using import type { MenuSectionDrop } from './types' to clarify that this import will be erased at runtime.
| import { MenuSectionDrop } from './types' | |
| import type { MenuSectionDrop } from './types' |
| items?: Action[] | ||
| dropItems?: MenuSectionDrop[] | ||
| } | ||
| import { MenuSection } from './types' |
Copilot
AI
Jun 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This import brings in a TypeScript-only type; switching to import type { MenuSection } from './types' can prevent accidental value imports and clarify intent.
| import { MenuSection } from './types' | |
| import type { MenuSection } from './types' |
| export { default as ContextActionMenu } from './ContextActionMenu.vue' | ||
| export { default as ContextMenuQuickAction } from './ContextMenuQuickAction.vue' | ||
| export { default as ActionMenuDropItem } from './ActionMenuDropItem.vue' | ||
| export * from './types' |
Copilot
AI
Jun 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] To make it explicit that only types are being re-exported, you could use export type { MenuSection, MenuSectionDrop } from './types' if your TS version supports it.
| export * from './types' | |
| export type { MenuSection, MenuSectionDrop } from './types' |
kulmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Description
Related Issue
How Has This Been Tested?
Types of changes