#9628: fix: resolve tsconfig rootDir errors by separating UI config (AI-assisted)
app: web-ui
stale
Cluster:
UI Improvements and Fixes
## What & Why
This PR fixes the IDE errors ("File is not under 'rootDir'") caused by the `ui` folder being included in the root [tsconfig.json](cci:7://file:///Users/leon/code/forks/openclaw/tsconfig.json:0:0-0:0) while `rootDir` is set to `src`.
Since the UI project sits outside `src` and has different environment needs (DOM, Vite), I have:
1. Removed `ui/**/*` from the root [tsconfig.json](cci:7://file:///Users/leon/code/forks/openclaw/tsconfig.json:0:0-0:0) include.
2. Created a dedicated [ui/tsconfig.json](cci:7://file:///Users/leon/code/forks/openclaw/ui/tsconfig.json:0:0-0:0) configured for Lit + Vite.
## Verification
- [x] `pnpm check` (root build/lint): Passed.
- [x] `pnpm ui:build` (UI build): Passed.
- [x] Manual: Verified red squiggles are gone in VS Code.
## Configuration Details
- **Decorators**: The new [ui/tsconfig.json](cci:7://file:///Users/leon/code/forks/openclaw/ui/tsconfig.json:0:0-0:0) explicitly sets `"experimentalDecorators": true` and `"useDefineForClassFields": false` to match the project's requirement for legacy Lit decorators.
## AI Info
- **Mark as AI-assisted**: Yes (Gemini / Antigravity)
- **Degree of testing**: Fully tested locally (builds pass).
- **Understanding**: I fully understand that this splits the TS configuration to correctly reflect the project structure (monorepo-style split between node backend and DOM frontend).
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR removes `ui/**/*` from the root `tsconfig.json` `include` (keeping `rootDir: "src"` intact) and adds a dedicated `ui/tsconfig.json` tuned for the browser/Vite/Lit environment (DOM libs, `moduleResolution: "bundler"`, decorators enabled). This resolves the IDE/tsc “file is not under rootDir” errors by ensuring the backend (`src/`) and frontend (`ui/src/`) are typechecked under separate TS projects.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge and addresses a real TS configuration mismatch.
- The change set is small and localized (tsconfig adjustments) and should resolve the reported IDE `rootDir` error. Main remaining concern is whether enabling `emitDecoratorMetadata` in the UI tsconfig is intended for the browser bundle; if not, it should be removed to avoid unwanted runtime metadata emission.
- ui/tsconfig.json
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#11979: fix: Change rootDir to project root to allow UI compilation
by fastroc · 2026-02-08
85.1%
#7824: fix(ui): remove --prod install flag that causes vite not found error
by adityarao3 · 2026-02-03
79.3%
#8678: fix(control-ui): restore useDefineForClassFields for Lit reactivity
by chainyoda · 2026-02-04
78.9%
#13838: UI: fix config panel CI failures and modularize rendering
by fresed05 · 2026-02-11
78.8%
#15215: fix(UI): Prevent config layout panel from overlapping description text
by Chityalaakhil · 2026-02-13
77.1%
#21089: fix(ui): externalize all Node builtins in Vite build
by lemoz · 2026-02-19
77.0%
#8342: Fix debug interface CSS layout issues
by Klopib · 2026-02-03
76.8%
#22808: test(ui): split baseline browser-test fixes from webchat feature
by opnsec · 2026-02-21
76.7%
#11048: fix: address repository issues (env, author, CI comments, security ...
by cavula · 2026-02-07
76.6%
#13960: fix(ui): preserve structured config validation error details
by constansino · 2026-02-11
76.4%