feat(angular): reshape PaperlessUI.Angular to TourPlanner-Angular layout#3
Conversation
Replaces the empty Angular 21 scaffold with the layered structure used in
TourPlanner-Angular:
src/app/
app.component.{ts,html,css,spec.ts} # root with shell
app.config.ts # HttpClient + Router + API_BASE_URL
app.routes.ts # lazy /documents route
core/
api/api-client.service.ts # base HTTP wrapper, baseUrl from token
api/generated/ # openapi-typescript output target
config/api-base-url.token.ts # InjectionToken<string>
layout/
shell/app-shell.component.{ts,html,css} # navbar + <router-outlet>
navbar/app-navbar.component.{ts,html,css} # documents / upload / search
features/
documents/pages/documents-page.component.{ts,html,css} # stub
proxy.conf.json # /api -> http://localhost:5057
Every component uses ChangeDetectionStrategy.OnPush and standalone imports
(no NgModules) — same conventions as TourPlanner-Angular.
package.json gains generate:openapi / generate:types / generate scripts so
PaperlessREST's OpenAPI doc can be flowed into src/app/core/api/generated/
once the backend side lands. pnpm stays as the package manager to keep the
existing CI job intact.
Build verified: ng build emits the lazy `documents-page-component` chunk
(683 B) confirming the lazy-loading pattern wires through. No new deps
introduced.
Follow-ups:
- Wire the actual /documents service + viewmodel against the generated API
- Repeat for /upload and /search features
- Tailwind + Leaflet adoption (TourPlanner-Angular parity)
- React equivalent (PaperlessUI.React -> qyl.dashboard layout)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (26)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR reshapes the Angular UI project into a layered core / layout / features structure (aligned with TourPlanner-Angular), introduces a basic app shell + navbar layout, and lays groundwork for consuming PaperlessREST via generated OpenAPI types.
Changes:
- Replaced the initial Angular scaffold root component with a standalone
AppComponentthat renders anAppShellComponent. - Added layout (
shell,navbar) and a first lazy-loaded feature stub (documents), plus router wiring and redirects. - Introduced a minimal
ApiClientService+API_BASE_URLtoken, dev proxy config, and scripts intended to generate OpenAPI types.
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| PaperlessUI.Angular/src/main.ts | Bootstraps AppComponent instead of the removed scaffold App. |
| PaperlessUI.Angular/src/index.html | Updates the app title to “Paperless”. |
| PaperlessUI.Angular/src/app/app.component.ts | New root component rendering the app shell. |
| PaperlessUI.Angular/src/app/app.component.html | Hosts <app-shell />. |
| PaperlessUI.Angular/src/app/app.component.css | Root host styling for full-height layout. |
| PaperlessUI.Angular/src/app/app.component.spec.ts | Replaces old scaffold tests with a shell render test. |
| PaperlessUI.Angular/src/app/layout/shell/app-shell.component.ts | Adds the app shell component that composes navbar + router outlet. |
| PaperlessUI.Angular/src/app/layout/shell/app-shell.component.html | Shell markup with navbar and <router-outlet />. |
| PaperlessUI.Angular/src/app/layout/shell/app-shell.component.css | Shell layout styling. |
| PaperlessUI.Angular/src/app/layout/navbar/app-navbar.component.ts | Adds a basic navbar component. |
| PaperlessUI.Angular/src/app/layout/navbar/app-navbar.component.html | Navbar links for Documents/Upload/Search. |
| PaperlessUI.Angular/src/app/layout/navbar/app-navbar.component.css | Navbar styling. |
| PaperlessUI.Angular/src/app/features/documents/pages/documents-page.component.ts | Adds a stub documents page component. |
| PaperlessUI.Angular/src/app/features/documents/pages/documents-page.component.html | Placeholder content for the documents page. |
| PaperlessUI.Angular/src/app/features/documents/pages/documents-page.component.css | Minimal documents page styling. |
| PaperlessUI.Angular/src/app/app.routes.ts | Adds redirect + lazy route for /documents and fallback redirect. |
| PaperlessUI.Angular/src/app/app.config.ts | Provides router + HttpClient(fetch) and API_BASE_URL. |
| PaperlessUI.Angular/src/app/core/config/api-base-url.token.ts | Introduces API_BASE_URL injection token. |
| PaperlessUI.Angular/src/app/core/api/api-client.service.ts | Adds a simple HTTP wrapper using API_BASE_URL. |
| PaperlessUI.Angular/src/app/core/api/generated/.gitkeep | Placeholder file for generated OpenAPI types output directory. |
| PaperlessUI.Angular/proxy.conf.json | Adds dev proxy routing /api to http://localhost:5057. |
| PaperlessUI.Angular/package.json | Updates serve/test scripts and adds OpenAPI generation scripts. |
| PaperlessUI.Angular/src/app/app.ts | Removes the original scaffold App component. |
| PaperlessUI.Angular/src/app/app.spec.ts | Removes the original scaffold tests. |
| PaperlessUI.Angular/src/app/app.html | Removes the original scaffold template content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "test:watch": "ng test", | ||
| "generate:openapi": "node -e \"const fs=require('node:fs');fs.rmSync('../PaperlessREST/openapi/paperless.json',{force:true})\" && dotnet build ../PaperlessREST/PaperlessREST.csproj -tlp:ErrorsOnly && node -e \"if(!require('node:fs').existsSync('../PaperlessREST/openapi/paperless.json')){console.error('paperless.json not generated');process.exit(1)}\"", | ||
| "generate:types": "openapi-typescript ../PaperlessREST/openapi/paperless.json -o src/app/core/api/generated/api-types.ts", | ||
| "generate": "pnpm run generate:openapi && pnpm run generate:types" |
| @@ -0,0 +1 @@ | |||
| openapi-typescript output target — `npm run generate:types` writes api-types.ts here once the PaperlessREST OpenAPI document is wired up. | |||
Summary
core / layout / featuresstructure used in TourPlanner-Angular. Every component usesChangeDetectionStrategy.OnPushand standalone imports.core/api/api-client.service.ts(HTTP wrapper bound toAPI_BASE_URLtoken),core/config/api-base-url.token.ts, and a placeholdercore/api/generated/folder for theopenapi-typescriptoutput.layout/shell+layout/navbarwith router-outlet wiring. Addsfeatures/documents/pages/documents-page.component.*as the first lazy-loaded feature stub.package.jsongainsgenerate:openapi/generate:types/generatescripts so PaperlessREST's OpenAPI doc can flow intosrc/app/core/api/generated/api-types.tsonce the backend side lands.proxy.conf.jsonroutes/apito the PaperlessREST dev port (http://localhost:5057).Test plan
pnpm install && pnpm run buildsucceeds locally; emits a lazydocuments-page-componentchunk (683 B)Build (PaperlessUI.Angular)job greenBuild & Test (backend)unaffected (no backend changes)Follow-ups
/documentsservice + viewmodel against the generated API/uploadand/searchfeatures (currently stubbed in the navbar but fall through**to/documents)PaperlessUI.React→ qyl.dashboard layout)