Skip to content

Conversation

@DaxServer
Copy link
Owner

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Aug 3, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Refactor

    • Updated internal project structure by reorganizing and updating import paths for components, types, stores, and composables across the codebase. This affects both application and test files, but does not alter any user-facing features or functionality.
  • Tests

    • Adjusted test file imports to align with the new directory structure. No changes to test logic or coverage.

Walkthrough

This change updates import paths throughout the frontend codebase to align with a new directory structure. All affected files—including type declarations, component auto-imports, router configuration, feature composables, stores, and tests—now reference their dependencies under newly organized core, shared, and features directories. No logic, functionality, or entity signatures are changed.

Changes

Cohort / File(s) Change Summary
Type and Component Declarations
frontend/auto-imports.d.ts, frontend/components.d.ts
Updated all import paths for global constants, types, and Vue components to reference new locations under core, shared, and features directories. No changes to declarations or signatures.
Router and Main Entry
frontend/src/core/router/router.ts, frontend/src/main.ts
Changed import paths for route components and plugins to the new directory structure. No changes to route definitions or logic.
Data Processing Feature Composables & Store
frontend/src/features/data-processing/composables/*, frontend/src/features/data-processing/stores/drag-drop.store.ts
Updated import paths for all type and composable dependencies to reflect new locations in shared/types and feature-specific folders. No changes to logic or exports.
Wikibase Schema Feature Composables & Stores
frontend/src/features/wikibase-schema/composables/*, frontend/src/features/wikibase-schema/stores/*
Adjusted all import paths for types, stores, and composables to new feature and shared directories. No logic or declaration changes.
Shared Composables and Types
frontend/src/shared/composables/*, frontend/src/shared/types/drag-drop.ts
Updated import paths for stores, types, and composables to align with the reorganized directory structure. No changes to implementation.
Test Files (Composables & Stores)
frontend/src/shared/composables/__tests__/*, frontend/src/shared/stores/__tests__/*
Modified import paths for all referenced modules and types to match new locations. No changes to test logic or test structure.

Sequence Diagram(s)

No sequence diagram is generated, as the changes are limited to import path updates and do not affect control flow or feature logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • DaxServer/dataforge#105: Adds new global auto-imports and components such as useDropZoneStyling and useValidationCore, which are among the imports updated in this PR.
  • DaxServer/dataforge#79: Introduces the ColumnPalette component and related auto-imports; this PR updates the import paths for those declarations.
  • DaxServer/dataforge#107: Renames parameters in drag-drop related types and functions; this PR updates import paths for the same modules, showing overlap in affected code areas.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch frontend-structure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (8)
frontend/src/shared/composables/__tests__/useColumnConversion.test.ts (1)

3-3: Consider relocating ProjectColumn to a shared types module.

Importing a type from inside another composable (useColumnGeneration) couples the test (and any other consumer) to that implementation file.
If ProjectColumn is reused across features, exposing it under @frontend/shared/types would avoid potential circular-dependency issues when the composable itself evolves.

frontend/src/shared/stores/__tests__/validation-rules.store.test.ts (1)

4-4: Decouple ValidationRuleConfig from the store implementation.

Similar to the previous note, importing the type from the store file forces any consumer to depend on store internals.
Moving ValidationRuleConfig to @frontend/shared/types/wikibase-schema (or a dedicated models barrel) would make the public API cleaner.

frontend/src/features/wikibase-schema/composables/useSchemaCompletenessValidation.ts (1)

2-3: Alias paths look good – ensure tsconfig paths is in sync

The new feature-scoped aliases compile only if tsconfig.json (and vite.config.ts/bunfig.toml if applicable) maps @frontend/features/* correctly.
Please double-check; otherwise Vue TS Server will fall back to relative resolution and break IntelliSense/builds.

frontend/src/main.ts (1)

11-18: Path changes fine, but consider a barrel export to shorten deep imports

@frontend/core/router/router and @frontend/core/plugins/api are verbose.
Adding index.ts re-exports (barrels) would let consumers do:

import router from '@frontend/core/router'
import { ApiPlugin } from '@frontend/core/plugins'

This keeps call-sites clean and avoids churn if filenames move again.

frontend/src/features/data-processing/stores/drag-drop.store.ts (1)

3-6: Alias switch is fine; opportunistic nit – drop non-feature import comment

Since the file now lives under features/data-processing, consider dropping the internal comment “Use the shared compatibility mapping” (Line 39) – it predates the move and is slightly redundant.

No functional issues with the change itself.

frontend/src/features/wikibase-schema/composables/useStatementValidationDisplay.ts (1)

1-2: Consider local relative import for same-feature composable

useStatementDataTypeValidation lives in the same folder. A relative import ('./useStatementDataTypeValidation') avoids an unnecessary alias hop and reduces risk of circular-alias resolution issues.

-import { useStatementDataTypeValidation } from '@frontend/features/wikibase-schema/composables/useStatementDataTypeValidation'
+import { useStatementDataTypeValidation } from './useStatementDataTypeValidation'
frontend/src/features/wikibase-schema/composables/useStatementEditor.ts (1)

8-9: New cross-feature dependency – confirm intended layering

wikibase-schema now depends on features/data-processing.
If you aim for feature isolation, consider moving useDataTypeCompatibility to shared instead.

frontend/src/core/router/router.ts (1)

7-33: Consider adding chunk-names for improved bundle introspection.
The dynamic imports work, but you can make debugging and bundle analysis easier by naming the chunks:

- component: () => import('@frontend/core/layouts/DefaultLayout.vue'),
+ component: () =>
+   import(
+     /* webpackChunkName: "layout-default" */
+     '@frontend/core/layouts/DefaultLayout.vue'
+   ),

Same for the three feature pages below.

ReferenceSchemaMapping,
} from '@frontend/types/wikibase-schema'
} from '@frontend/shared/types/wikibase-schema'
import type { UUID } from 'crypto'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

import type { UUID } from 'crypto' is invalid and will break builds

Node/Bun’s crypto module exports the randomUUID() function but does not export a UUID type alias.
TypeScript will raise “Module … has no exported member ‘UUID’”.

Proposed quick fix:

-import type { UUID } from 'crypto'
+// Define a simple UUID alias locally (or import from a dedicated util)
+type UUID = string

All UUID usages below then remain valid.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { UUID } from 'crypto'
// Define a simple UUID alias locally (or import from a dedicated util)
type UUID = string
🤖 Prompt for AI Agents
In frontend/src/features/wikibase-schema/composables/useSchemaBuilder.ts at line
14, the import statement `import type { UUID } from 'crypto'` is invalid because
the 'crypto' module does not export a `UUID` type. Remove this import entirely
and instead define the `UUID` type locally as a string alias or use an
appropriate existing type alias for UUIDs. This will keep all `UUID` usages
valid without causing build errors.

Comment on lines +2 to +7
import { useDragDropStore } from '@frontend/features/data-processing/stores/drag-drop.store'
import { useSchemaStore } from '@frontend/features/wikibase-schema/stores/schema.store'
import type { ColumnInfo } from '@frontend/shared/types/wikibase-schema'
import { useDragDropHandlers } from '@frontend/shared/composables/useDragDropHandlers'
import { useValidationCore } from '@frontend/features/wikibase-schema/composables/useValidationCore'
import { useDropZoneStyling } from '@frontend/shared/composables/useDropZoneStyling'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

WikibaseDataType is referenced but not imported – compilation will fail

acceptedTypes is typed as WikibaseDataType[], however the symbol is never imported.
Add it alongside ColumnInfo:

-import type { ColumnInfo } from '@frontend/shared/types/wikibase-schema'
+import type { ColumnInfo, WikibaseDataType } from '@frontend/shared/types/wikibase-schema'

Also applies to: 26-27

🤖 Prompt for AI Agents
In frontend/src/features/wikibase-schema/composables/useSchemaDropZone.ts around
lines 2 to 7 and also lines 26 to 27, the type WikibaseDataType is used but not
imported, causing compilation errors. Fix this by importing WikibaseDataType
from the appropriate module alongside ColumnInfo at the top of the file. Ensure
the import statement correctly references the source of WikibaseDataType to
resolve the missing symbol issue.

@DaxServer DaxServer merged commit 2d07d92 into main Aug 3, 2025
6 checks passed
@DaxServer DaxServer deleted the frontend-structure branch August 3, 2025 12:08
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.

1 participant