Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

Description

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Copilot AI review requested due to automatic review settings June 24, 2025 19:31
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 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.ts with MenuSection and MenuSectionDrop
  • Exported new types via index.ts and 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 (and MenuSection) 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'
Copy link

Copilot AI Jun 24, 2025

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.

Suggested change
import { MenuSectionDrop } from './types'
import type { MenuSectionDrop } from './types'

Copilot uses AI. Check for mistakes.
items?: Action[]
dropItems?: MenuSectionDrop[]
}
import { MenuSection } from './types'
Copy link

Copilot AI Jun 24, 2025

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.

Suggested change
import { MenuSection } from './types'
import type { MenuSection } from './types'

Copilot uses AI. Check for mistakes.
export { default as ContextActionMenu } from './ContextActionMenu.vue'
export { default as ContextMenuQuickAction } from './ContextMenuQuickAction.vue'
export { default as ActionMenuDropItem } from './ActionMenuDropItem.vue'
export * from './types'
Copy link

Copilot AI Jun 24, 2025

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.

Suggested change
export * from './types'
export type { MenuSection, MenuSectionDrop } from './types'

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

🥳

@kulmann kulmann merged commit c8df3ca into main Jun 25, 2025
19 checks passed
@kulmann kulmann deleted the context-actions-fix-types branch June 25, 2025 05:55
@openclouders openclouders mentioned this pull request Jun 25, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants