mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Trim development UI guidance
This commit is contained in:
parent
432735c3eb
commit
eb5885f7cd
1 changed files with 2 additions and 4 deletions
|
|
@ -31,11 +31,9 @@ The source tree is organized by responsibility rather than by the original singl
|
|||
|
||||
Keep new code near the state or API it owns. Feature-to-feature imports are allowed when the imported feature owns a concrete capability or integration point, such as thread export, thread title generation, or an Obsidian view. Do not use another feature as a generic utility bucket; move truly feature-neutral behavior to `src/shared/`, `src/domain/`, or `src/app-server/`. Lower-level modules in `src/app-server/`, `src/domain/`, and `src/shared/` must remain independent from `src/features/`; ESLint enforces that dependency direction.
|
||||
|
||||
Codex Panel's runtime UI is Preact-owned through the direct Preact APIs. Keep chat panel UI, the Threads view, and the selection rewrite popover in Preact components. The chat panel shell is a single Preact tree; toolbar, goal, message stream, and composer content should be composed as Preact nodes rather than mounted through HTMLElement region renderers. Use `preact/hooks` for hooks, `preact` for component types and fragments, and the shared root adapter for mounting and unmounting Preact subtrees. Imperative DOM writes are limited to explicit bridge modules or Obsidian-owned API boundaries such as `MarkdownRenderer`, TanStack Virtual measurement/lifecycle glue, diff rendering, icon rendering, `SuggestModal`, and the Obsidian `Setting`-based settings tab. ESLint enforces this boundary with allowlisted bridge files; add a new allowlist entry only when the code is genuinely bridging an external DOM API.
|
||||
Codex Panel's runtime UI is Preact-owned through direct Preact APIs. Keep chat panel UI, the Threads view, and the selection rewrite popover in Preact components; use imperative DOM writes only for explicit bridge modules or Obsidian-owned API boundaries such as `MarkdownRenderer`, virtualizer measurement glue, diff rendering, icon rendering, `SuggestModal`, and the Obsidian `Setting`-based settings tab.
|
||||
|
||||
Chat panel state has one owner: `ChatStateStore`. Panel-visible interaction state, including toolbar confirmations, inline rename drafts, generation progress, active-thread metadata, message stream state, and composer state, belongs in the chat reducer as named actions. Signals are allowed only in `src/features/chat/ui/shell-state.tsx`, where they adapt reducer snapshots into Preact updates for the single chat shell. Do not add controller-owned signals, ad hoc Preact state mirrors, or generic state patch actions. Normal chat state changes should dispatch to the store and flow through the shell-state adapter; `mountOrRepairShell` is reserved for initial mount, root repair, and settings-driven shell prop refresh.
|
||||
|
||||
The bundled UI runtime should stay on direct Preact APIs. This avoids browser runtime code that creates `<script>` elements and can be flagged by Obsidian Community plugin review automation, while preserving the current component model without a compatibility adapter layer. Do not add a non-Preact UI runtime or adapter layer unless the review tradeoff is explicitly revisited.
|
||||
Chat panel state belongs in `ChatStateStore`. Panel-visible state changes should dispatch named reducer actions and flow through the shell-state adapter; do not add controller-owned signals, ad hoc Preact state mirrors, generic state patch actions, or a non-Preact UI runtime without revisiting the project design notes.
|
||||
|
||||
## App-Server Bindings
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue