Skip to content

Refactor: Complete Type FE refactoring#145

Merged
Cemonix merged 1 commit intomainfrom
ref/fe/types_project_structure
Aug 29, 2025
Merged

Refactor: Complete Type FE refactoring#145
Cemonix merged 1 commit intomainfrom
ref/fe/types_project_structure

Conversation

@Cemonix
Copy link
Copy Markdown
Owner

@Cemonix Cemonix commented Aug 29, 2025

…s modules

  • Deleted Point, Table, PageLoader, and other type definitions that are no longer in use.
  • Cleaned up data source types and requests, including DataSourceType and DataSourceStatus.
  • Removed label-related types and requests, including Label, LabelScheme, and their associated interfaces.
  • Eliminated logging types and project-related types, including Project, ProjectInvitationDto, and ProjectMember.
  • Updated imports in views to reflect the new structure and removed references to deleted types.
  • Refactored services and components to align with the new type definitions and imports.

…s modules

- Deleted Point, Table, PageLoader, and other type definitions that are no longer in use.
- Cleaned up data source types and requests, including DataSourceType and DataSourceStatus.
- Removed label-related types and requests, including Label, LabelScheme, and their associated interfaces.
- Eliminated logging types and project-related types, including Project, ProjectInvitationDto, and ProjectMember.
- Updated imports in views to reflect the new structure and removed references to deleted types.
- Refactored services and components to align with the new type definitions and imports.
@Cemonix Cemonix requested a review from Copilot August 29, 2025 15:01
@Cemonix Cemonix changed the title Refactor: Remove unused type definitions and interfaces across variou… Refactor: Complete Type FE refactoring Aug 29, 2025
@Cemonix Cemonix merged commit b637658 into main Aug 29, 2025
3 checks passed
@Cemonix Cemonix deleted the ref/fe/types_project_structure branch August 29, 2025 15:02
Copy link
Copy Markdown

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 refactors the frontend codebase by removing unused type definitions and restructuring imports to align with a new organized module structure. The refactoring consolidates types into their respective service modules and updates all import paths throughout the application.

Key Changes:

  • Removed numerous unused type definition files and interfaces across various modules (Point, Table, PageLoader, DataSourceType, Label-related types, Project types, etc.)
  • Restructured imports to use new service-based organization (e.g., @/services/project/*, @/core/*)
  • Updated workspace store to use new core managers (AssetManager, TaskManager, TaskNavigationManager) for better separation of concerns

Reviewed Changes

Copilot reviewed 209 out of 230 changed files in this pull request and generated 26 comments.

Show a summary per file
File Description
frontend/src/views/project/*.vue Updated import paths for types and services to new structure
frontend/src/views/auth/*.vue Updated logger and service imports to new core modules
frontend/src/stores/*.ts Migrated to new type imports and core service organization
frontend/src/services/project/* Restructured project services with consolidated type definitions
frontend/src/core/workspace/* New core workspace managers with updated type references
frontend/src/types/* Removed numerous unused type definition files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}),
getActiveToolDetails(): Tool | undefined {
return this.availableTools.find(tool => tool.id === this.activeTool);
return this.availableTools.find((tool: Tool) => tool.id === this.activeTool);
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit type annotation (tool: Tool) in the find callback is redundant since TypeScript can infer the type from the array. Consider removing it for cleaner code.

Suggested change
return this.availableTools.find((tool: Tool) => tool.id === this.activeTool);
return this.availableTools.find(tool => tool.id === this.activeTool);

Copilot uses AI. Check for mistakes.
return undefined;
}
return state.currentLabelScheme.labels.find(label => label.labelId === labelId);
return state.currentLabelScheme.labels.find((label: Label) => label.labelId === labelId);
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit type annotation (label: Label) in the find callback is redundant since TypeScript can infer the type from the array. Consider removing it for cleaner code.

Suggested change
return state.currentLabelScheme.labels.find((label: Label) => label.labelId === labelId);
return state.currentLabelScheme.labels.find(label => label.labelId === labelId);

Copilot uses AI. Check for mistakes.
return -1;
}
return state.availableTasks.findIndex(task => task.id === state.currentTaskData?.id);
return state.availableTasks.findIndex((task: Task) => task.id === state.currentTaskData?.id);
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit type annotation (task: Task) in the findIndex callback is redundant since TypeScript can infer the type from the array. Consider removing it for cleaner code.

Suggested change
return state.availableTasks.findIndex((task: Task) => task.id === state.currentTaskData?.id);
return state.availableTasks.findIndex(task => task.id === state.currentTaskData?.id);

Copilot uses AI. Check for mistakes.
// Filter out tasks that cannot be opened for navigation
// Note: Deferred tasks permission checking is handled in the navigation buttons themselves
const accessibleTasks = state.availableTasks.filter(task => {
const accessibleTasks = state.availableTasks.filter((task: Task) => {
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit type annotation (task: Task) in the filter callback is redundant since TypeScript can infer the type from the array. Consider removing it for cleaner code.

Suggested change
const accessibleTasks = state.availableTasks.filter((task: Task) => {
const accessibleTasks = state.availableTasks.filter(task => {

Copilot uses AI. Check for mistakes.
? accessibleTasks.findIndex(task => task.id === state.currentTaskData?.id)

const currentIndex = state.currentTaskData && accessibleTasks.length > 0
? accessibleTasks.findIndex((task: Task) => task.id === state.currentTaskData?.id)
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit type annotation (task: Task) in the findIndex callback is redundant since TypeScript can infer the type from the array. Consider removing it for cleaner code.

Suggested change
? accessibleTasks.findIndex((task: Task) => task.id === state.currentTaskData?.id)
? accessibleTasks.findIndex(task => task.id === state.currentTaskData?.id)

Copilot uses AI. Check for mistakes.
expect(workspaceStore.availableTools).toHaveLength(6);
expect(
workspaceStore.availableTools.map((tool) => tool.id)
workspaceStore.availableTools.map((tool: Tool) => tool.id)
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit type annotation (tool: Tool) in the map callback is redundant since TypeScript can infer the type from the array. Consider removing it for cleaner code.

Suggested change
workspaceStore.availableTools.map((tool: Tool) => tool.id)
workspaceStore.availableTools.map(tool => tool.id)

Copilot uses AI. Check for mistakes.

// Mock task service
const { taskService } = await import("@/services/api/projects");
const { taskService } = await import("@/services/project");
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using a static import instead of dynamic import for test dependencies to improve test performance and avoid potential import timing issues.

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
import { taskService } from './api/projects';
import { taskService } from './taskService';
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

The import path './taskService' is incorrect. Based on the file structure, it should be './taskService' or the taskService needs to be exported from the current directory's index file.

Suggested change
import { taskService } from './taskService';
import { taskService } from './index';

Copilot uses AI. Check for mistakes.
} from './taskSelection.types';
import { AppLogger } from '@/core/logger/logger';

// TODO: This is not a service. Move to core
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

This TODO comment indicates architectural debt. The TaskBulkOperationsService should be moved to the core module as it contains business logic rather than API service calls.

Copilot uses AI. Check for mistakes.
class ConfigurationService extends BaseService {
protected readonly baseUrl = '/configuration';
class PermissionService extends BaseService {
protected readonly baseUrl = '/configuration'; // TODO: Check BE and change endpoint to permission
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

This TODO comment suggests the API endpoint should be updated to better reflect its purpose. Consider coordinating with backend team to update from '/configuration' to '/permissions' or similar.

Suggested change
protected readonly baseUrl = '/configuration'; // TODO: Check BE and change endpoint to permission
protected readonly baseUrl = '/permissions';

Copilot uses AI. Check for mistakes.
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.

2 participants