Skip to content

feat(react): reshape PaperlessUI.React to qyl.dashboard layout#4

Merged
ANcpLua merged 1 commit into
mainfrom
feat/react-qyl-dashboard-layout
May 12, 2026
Merged

feat(react): reshape PaperlessUI.React to qyl.dashboard layout#4
ANcpLua merged 1 commit into
mainfrom
feat/react-qyl-dashboard-layout

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 12, 2026

Summary

  • Replaces the empty Vite + React 19 scaffold with qyl.dashboard's components / hooks / lib / pages / types / __tests__ layout.
  • App.tsx wires BrowserRouter + Suspense + QueryClientProvider. Each page is lazy-imported (DocumentsPage, UploadPage, SearchPage); AppShell (navbar + <Outlet />) is the layout route.
  • hooks/use-documents.ts shows the TanStack Query + fetchJson pattern against /api/documents for follow-up wiring.
  • vite.config.ts: @/* alias to src/, /api proxy to PaperlessREST (http://localhost:5057), manualChunks splits react-vendor + tanstack.
  • vitest.config.ts separated from vite (jsdom env, globals, setup from src/__tests__/setup.ts).
  • tsconfig.json flattened to a single file with the @/* path alias and "noEmit": true; the old tsconfig.{app,node}.json are removed in favor of tsc --noEmit && vite build.
  • New deps: @tanstack/react-query, react-router-dom, jsdom, openapi-typescript, @testing-library/jest-dom, @vitest/coverage-v8, vitest. pnpm stays as the package manager to keep the current CI job intact.

Test plan

  • pnpm install && pnpm run build succeeds locally; lazy page chunks emitted; react-vendor (230.89 kB) and tanstack (33.27 kB) split as configured
  • CI Build (PaperlessUI.React) job green
  • CI backend job unaffected

Follow-ups

  • generate:openapi script + flow PaperlessREST OpenAPI → src/types/api.ts
  • Tailwind 4 + Base UI for component primitives (qyl-style)
  • Playwright e2e + Dockerfile / nginx.conf.template parity with qyl.dashboard
  • ESLint flat config restricting Radix imports

Replaces the empty Vite + React 19 scaffold with the qyl.dashboard structure:

  src/
    App.tsx                   # Router + Suspense + QueryClientProvider
    main.tsx                  # unchanged
    index.css                 # unchanged (placeholder)
    vite-env.d.ts             # vite/client types (added)
    components/
      layout/AppShell.tsx     # navbar + <Outlet>
      layout/AppNavbar.tsx    # documents / upload / search nav
      layout/index.ts
    hooks/
      use-documents.ts        # TanStack Query example against /api/documents
    lib/
      api.ts                  # fetchJson / postJson wrapper
    pages/
      DocumentsPage.tsx
      UploadPage.tsx
      SearchPage.tsx
    types/                    # openapi-typescript output target
    __tests__/
      setup.ts                # @testing-library/jest-dom

Configuration:
  - vite.config.ts: @/* alias to src, /api proxy to PaperlessREST (5057),
    manualChunks splits react-vendor + tanstack
  - vitest.config.ts: jsdom env, globals, setup from __tests__/setup.ts
  - tsconfig.json: single flat config with @/* path alias, "noEmit": true
    (replaces tsconfig.{app,node}.json — `tsc --noEmit && vite build` in scripts)
  - package.json adds @tanstack/react-query, react-router-dom, jsdom,
    openapi-typescript, @testing-library/jest-dom; gains generate:types script

Deleted: src/App.css, src/assets/{hero.png,react.svg,vite.svg} (boilerplate).

Build verified: vite build emits lazy chunks for each page plus react-vendor
(230.89 kB) and tanstack (33.27 kB) split bundles.

Follow-ups:
  - Wire generate:openapi to flow PaperlessREST OpenAPI → src/types/api.ts
  - Tailwind 4 + Base UI for component primitives (qyl-style)
  - Playwright e2e + Dockerfile/nginx.conf.template parity with qyl.dashboard
  - ESLint flat config restricting Radix imports

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 12, 2026 10:24
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (24)
  • PaperlessUI.React/index.html is excluded by none and included by none
  • PaperlessUI.React/package.json is excluded by none and included by none
  • PaperlessUI.React/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/pnpm-lock.yaml and included by none
  • PaperlessUI.React/src/App.css is excluded by none and included by none
  • PaperlessUI.React/src/App.tsx is excluded by none and included by none
  • PaperlessUI.React/src/__tests__/setup.ts is excluded by none and included by none
  • PaperlessUI.React/src/assets/hero.png is excluded by !**/*.png and included by none
  • PaperlessUI.React/src/assets/react.svg is excluded by !**/*.svg and included by none
  • PaperlessUI.React/src/assets/vite.svg is excluded by !**/*.svg and included by none
  • PaperlessUI.React/src/components/layout/AppNavbar.tsx is excluded by none and included by none
  • PaperlessUI.React/src/components/layout/AppShell.tsx is excluded by none and included by none
  • PaperlessUI.React/src/components/layout/index.ts is excluded by none and included by none
  • PaperlessUI.React/src/hooks/use-documents.ts is excluded by none and included by none
  • PaperlessUI.React/src/lib/api.ts is excluded by none and included by none
  • PaperlessUI.React/src/pages/DocumentsPage.tsx is excluded by none and included by none
  • PaperlessUI.React/src/pages/SearchPage.tsx is excluded by none and included by none
  • PaperlessUI.React/src/pages/UploadPage.tsx is excluded by none and included by none
  • PaperlessUI.React/src/types/.gitkeep is excluded by none and included by none
  • PaperlessUI.React/src/vite-env.d.ts is excluded by none and included by none
  • PaperlessUI.React/tsconfig.app.json is excluded by none and included by none
  • PaperlessUI.React/tsconfig.json is excluded by none and included by none
  • PaperlessUI.React/tsconfig.node.json is excluded by none and included by none
  • PaperlessUI.React/vite.config.ts is excluded by none and included by none
  • PaperlessUI.React/vitest.config.ts is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7feee9f1-b1c4-4b46-bc1c-b9f65537031c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@ANcpLua ANcpLua merged commit 052ea27 into main May 12, 2026
7 checks passed
@ANcpLua ANcpLua deleted the feat/react-qyl-dashboard-layout branch May 12, 2026 10:27
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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 replaces the default Vite/React scaffold in PaperlessUI.React with a more structured “dashboard-style” React app layout (components/hooks/lib/pages/types/tests), wiring in React Router and TanStack Query as the foundation for future PaperlessREST integration.

Changes:

  • Introduces routing + layout shell (AppShell + navbar) and lazy-loaded pages (Documents, Upload, Search).
  • Adds a basic API layer (fetchJson/postJson) and a TanStack Query example hook (useDocuments).
  • Updates tooling/config: Vite proxy + chunk splitting, new Vitest config, flattened tsconfig, and new dependencies/scripts.

Reviewed changes

Copilot reviewed 19 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
PaperlessUI.React/vitest.config.ts Adds Vitest config with jsdom, setup file, and @ alias.
PaperlessUI.React/vite.config.ts Adds @ alias, /api proxy, and Rollup chunk splitting.
PaperlessUI.React/tsconfig.node.json Removes node-specific tsconfig.
PaperlessUI.React/tsconfig.app.json Removes app-specific tsconfig.
PaperlessUI.React/tsconfig.json Replaces project references with a single strict TS config and @/* paths.
PaperlessUI.React/src/vite-env.d.ts Restores Vite client type references.
PaperlessUI.React/src/types/.gitkeep Adds placeholder file for future generated OpenAPI types output.
PaperlessUI.React/src/pages/UploadPage.tsx Adds placeholder Upload page.
PaperlessUI.React/src/pages/SearchPage.tsx Adds placeholder Search page.
PaperlessUI.React/src/pages/DocumentsPage.tsx Adds initial Documents page consuming useDocuments.
PaperlessUI.React/src/lib/api.ts Adds JSON fetch helpers.
PaperlessUI.React/src/hooks/use-documents.ts Adds example TanStack Query hook for documents.
PaperlessUI.React/src/components/layout/index.ts Adds layout barrel exports.
PaperlessUI.React/src/components/layout/AppShell.tsx Adds layout route wrapper with <Outlet />.
PaperlessUI.React/src/components/layout/AppNavbar.tsx Adds navbar with route links.
PaperlessUI.React/src/assets/vite.svg Removes default Vite asset.
PaperlessUI.React/src/assets/react.svg Removes default React asset.
PaperlessUI.React/src/App.tsx Replaces starter app with Router + Suspense + QueryClientProvider wiring.
PaperlessUI.React/src/App.css Removes scaffold CSS.
PaperlessUI.React/src/tests/setup.ts Adds test setup importing jest-dom matchers.
PaperlessUI.React/pnpm-lock.yaml Updates lockfile for new dependencies (router/query/vitest/jsdom/openapi-typescript).
PaperlessUI.React/package.json Adds deps, test/type scripts, and OpenAPI types generation script; updates build command.
PaperlessUI.React/index.html Updates page title to “Paperless”.
Files not reviewed (1)
  • PaperlessUI.React/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +7 to +11
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
Comment on lines +14 to +18
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
export async function fetchJson<T>(url: string, init?: RequestInit): Promise<T> {
const res = await fetch(url, init);
if (!res.ok) throw new Error(`HTTP ${res.status}: ${res.statusText}`);
return res.json() as Promise<T>;
"test": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit",
"generate:types": "openapi-typescript ../PaperlessREST/openapi/paperless.json -o src/types/api.ts"
Comment on lines +10 to +13
export function useDocuments() {
return useQuery({
queryKey: ['documents'],
queryFn: () => fetchJson<DocumentSummary[]>('/api/documents'),
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