-
-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: a tiny bit of everything #420
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
base: main
Are you sure you want to change the base?
Conversation
- Updated `turbo` from `2.7.1` to `2.7.2`. - Updated `msw` from `2.12.4` to `2.12.7`. - Updated `@eslint-react/eslint-plugin` from `2.3.13` to `2.4.0`. - Updated `@ai-sdk/openai` from `3.0.0` to `3.0.1` and `ai` from `6.0.1` to `6.0.3`. - Updated `@clack/prompts` from `1.0.0-alpha.8` to `1.0.0-alpha.9`. - Updated `tsdown` from `0.18.2` to `0.18.3`. - Updated `rolldown` from `1.0.0-beta.56` to `1.0.0-beta.57`. - Updated `hono` from `4.11.1` to `4.11.3` and `@cloudflare/workers-types` from `4.20251223.0` to `4.20251228.0`. - Updated `@tanstack/*` packages to latest versions. - Updated `fumadocs-*` packages to latest versions. - Updated `packageManager` to `[email protected]` in multiple `package.json` files.
- Replaced `useQuery` with `useSuspenseQuery` in `AppSidebar`. - Removed unused imports and cleaned up code in various UI components. - Updated CSS variables for better color management. - Refactored `Sidebar` to use `SidebarIcon` from `@phosphor-icons/react`. - Enhanced `NavItem` to include button variants for better styling. - Adjusted `DropdownMenu` components for consistent class names. - Updated `tsconfig.json` to extend from `@ucdjs-tooling/tsconfig/base`.
- Introduced new routes for file exploration under `/file-explorer`. - Implemented `DirectoryExplorerPage` and `FileViewerPage` components for displaying directory contents and file details. - Added support for file filtering and view modes in the file explorer. - Integrated breadcrumb navigation for better user experience. - Updated route handling to include not found components for better error management.
Added support for filtering and sorting directory listings via query parameters: `query`, `type`, `sort`, and `order`. This allows users to perform prefix-based searches, filter by entry type, and sort results by name or last modified date in ascending or descending order. Removed the deprecated `search` endpoint and updated tests to reflect these changes.
- Implemented a new search input and filter dropdowns in the `ExplorerToolbar`. - Updated `EntryList` to utilize search parameters for file retrieval. - Refactored file fetching logic to accommodate new search schema. - Improved navigation and state management for view modes and sorting.
…options - Added `TypeFilter`, `SortControl`, and `ActiveFilters` components to the `ExplorerToolbar`. - Introduced `FileViewerSkeleton` for loading states in the `FileViewer`. - Updated `files.ts` and related routes to support new search query parameters. - Refactored existing components for better structure and maintainability.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThis PR is a comprehensive refactor that updates the pnpm package manager across the monorepo, restructures API routes with enhanced file listing query support, removes the search endpoint, completely refactors the web app with TanStack Start integration, adds new API endpoints for Unicode blocks/characters/properties, introduces new schemas, and implements version comparison functionality in the UCD Store. Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant FileExplorerRoute as File Explorer<br/>Route
participant EntryList as EntryList<br/>Component
participant Query as React Query
participant Server as Server<br/>Function
participant API as API<br/>Endpoint
Client->>FileExplorerRoute: Navigate to /file-explorer/$path
FileExplorerRoute->>FileExplorerRoute: validateSearch, beforeLoad,<br/>resolve path metadata
FileExplorerRoute->>Server: getFileHeadInfo(path)
Server->>API: HEAD /api/v1/files/$path
API-->>Server: headers: type, size, counts
Server-->>FileExplorerRoute: statType, size, counts
alt Directory
FileExplorerRoute->>EntryList: Render with currentPath
EntryList->>Query: useSuspenseQuery(filesQueryOptions)
Query->>Server: fetchFiles(path, query, sort, order, type)
Server->>API: GET /api/v1/files/$path?query=...&sort=...
API-->>Server: JSON array of FileEntry[]
Server-->>Query: FilesResponse {type: "directory", files}
Query-->>EntryList: files data
EntryList->>Client: Render file list with filters/sort
else File
FileExplorerRoute->>FileExplorerRoute: Check size & renderability
alt Too Large (>1MB)
FileExplorerRoute->>Client: Render LargeFileWarning
else Non-Renderable
FileExplorerRoute->>Client: Render NonRenderableFile
else Renderable
FileExplorerRoute->>Query: useSuspenseQuery(filesQueryOptions)
Query->>Server: fetchFiles(path)
Server->>API: GET /api/v1/files/$path
API-->>Server: FilesResponse {type: "file", content}
Server-->>Query: file content
Query->>Client: Render FileViewer with content
end
end
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
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. Comment |
🌏 Preview Deployments
Built from commit: 🤖 This comment will be updated automatically when you push new commits to this PR. |
📋 OpenAPI Schema AnalysisSummaryAPI Endpoints
Schema Components
Overall Status
Detailed Changes🟢 Added Endpoints (4)
🔴 Removed Endpoints (1)
|
| Path | Methods | Description |
|---|---|---|
/api/v1/files/search |
GET |
No description |
📋 Schema Components Changes
Added Schemas (6):
UnicodeFileTreeNodeUnicodeFileTreeUnicodeCharacterUnicodePropertyResponseUnicodeBlockUnicodeBlockList
Removed Schemas (2):
UnicodeTreeNodeUnicodeTree
Modified Schemas (2):
UnicodeVersionDetailsFileEntryList
Important
This PR contains breaking changes that require maintainer approval.
Maintainers: Add the approve-breaking-openapi label to approve these changes.
🤖 This comment is automatically updated when you push new commits.
Updated the schema references from `UnicodeTreeNode` to `UnicodeFileTreeNode` across various test files, utility functions, and mock store types to reflect the new naming convention. This change enhances clarity in the codebase regarding file and directory structures.
This should hopefully issues with colinhacks/zod#4145
This will allow us to easily create projects, that doesn't exist in the repository.
- Introduced `toBeApiError`, `toBeHeadError`, `toHaveResponseHeaders`, `toBeJsonResponse`, and `toMatchResponse` matchers. - Enhanced type definitions in `types.d.ts` to include new matcher options. - Updated `vitest-setup.ts` to extend `expect` with the new matchers for improved API response testing.
- Updated `omitChildrenAndContent` function to use a utility from `utils.ts`. - Enhanced response validation in `schemas.test.ts` to use `toMatchResponse`. - Refactored `file-tree.ts` to omit content recursively for cleaner JSON responses.
🔗 Linked issue
resolves #152
resolves #149
resolves #151
resolves #150
resolves #340
resolves #331
resolves #427
resolves #428
resolves #429
resolves #430
resolves #432
resolves #335
closes #419
closes #401
closes #380
📚 Description
This PR implements a "tiny" bit of everything.
The main features is the comparison, file-explorer and much much more website related.
TODO:
Note
There is probably a lot more, that should be implemented! But let's see where this ends.
Compare Structure Response
{ from: "15.1.0", to: "16.0.0", added: ["NewFile.txt"], removed: ["OldFile.txt"], modified: ["UnicodeData.txt"], unchanged: 95, changes: [ { file: "UnicodeData.txt", from: { size: 1258291, modified: "2023-09-15" }, to: { size: 1364982, modified: "2024-09-13" } } ] }Summary by CodeRabbit
New Features
Improvements
Chores
✏️ Tip: You can customize this high-level summary in your review settings.