Skip to content

refactor(desktop): split NotesApp into notes-only component with shared module#2037

Open
hognek wants to merge 1 commit into
jaylfc:devfrom
hognek:feat/split-notes-app
Open

refactor(desktop): split NotesApp into notes-only component with shared module#2037
hognek wants to merge 1 commit into
jaylfc:devfrom
hognek:feat/split-notes-app

Conversation

@hognek

@hognek hognek commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Split the monolithic NotesApp.tsx into a shared module + two thin app wrappers:

  1. notes-shared-base.tsx — shared DocsApp component, sub-components (EntryHistoryPanel, SharePanel, EntryRow, NoteListItem, CreateNoteForm, NoteDetailPane, MemberBadge), types, and helpers. Extracted from the original NotesApp.tsx.

  2. NotesApp.tsx — thin notes-only wrapper (33 lines). Hardcodes kind="note" config. No more kind-branching or TodoApp export.

  3. TodoApp.tsx — standalone todo component. Uses the dedicated /api/todo store. Originally created alongside PR feat(todo): add TodoStore + /api/todo routes with ordering and due dates #1944 but never committed.

  4. app-registry.ts — todo app now points to @/apps/TodoApp instead of importing TodoApp from @/apps/NotesApp.

Data migration

Existing docs with kind="note" continue to work without changes. Docs with kind="list" are handled by TodoApp via /api/todo. No database migration required.

Tests

  • All 14 Notes + Todo unit tests pass
  • All 9 app-registry tests pass
  • Test imports updated: NotesApp from NotesApp.tsx, TodoApp from TodoApp.tsx
  • Todo tests updated to mock /api/todo instead of /api/notes

Task: t_f5920047

@hognek
hognek marked this pull request as ready for review July 19, 2026 09:18
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@hognek, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b58b44e0-0adb-4de9-a5d4-f194e1d39f8f

📥 Commits

Reviewing files that changed from the base of the PR and between 514d947 and 248c28f.

📒 Files selected for processing (6)
  • desktop/src/apps/NotesApp.test.tsx
  • desktop/src/apps/NotesApp.tsx
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/apps/__tests__/NotesApp.test.tsx
  • desktop/src/apps/notes-shared-base.tsx
  • desktop/src/registry/app-registry.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@gitar-bot

gitar-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

className="flex items-center gap-1 rounded-md text-shell-text-secondary transition-colors hover:text-shell-text md:hidden">
<ChevronLeft size={16} />
</button>
<h2 className="flex-1 truncate text-sm font-semibold text-shell-text">{doc.title}</h2>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Standalone Todo loses the Share/members panel and per-entry revision history that the previous DocsApp-based list variant provided.

The old TODO_CONFIG ran through the shared DocsApp, which rendered SharePanel (with member add/remove) and EntryHistoryPanel for every entry. This new TodoApp has no Share button in the detail header and TodoItemRow has no history affordance, and TodoDetail/TodoItem types carry no members/revisions fields. For existing kind="list" docs that had collaborators, sharing is now silently unavailable after this refactor.

If /api/todo does not yet support members or entry history, that is fine, but it should be an explicit, documented decision rather than an accidental regression. Consider noting it in the PR description or tracking follow-up work.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread desktop/src/apps/TodoApp.tsx Outdated
try {
const r = await fetch(API_BASE);
if (r.ok) { const data: unknown = await r.json(); setLists(Array.isArray(data) ? (data as TodoList[]) : []); }
} catch { /* keep whatever was loaded */ } finally { setLoading(false); }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: loadLists swallows fetch failures with an empty catch and only flips loading to false. If GET /api/todo errors (network down, 500), the list pane stays on the "Loading..." spinner forever with no error surfaced to the user.

The shared DocsApp.loadNotes has the same pattern, so this is consistent, but since this is new code it would be good to add an error state (like TodoDetailPane already does) so failures are visible rather than an infinite spinner.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@@ -23,7 +23,8 @@ vi.mock("@/components/ui", () => ({
),
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Todo tests now exist in two places: this file (__tests__/NotesApp.test.tsx) and the top-level desktop/src/apps/NotesApp.test.tsx, both of which import { TodoApp } from "../TodoApp" (or ./TodoApp) and define a describe("TodoApp") block.

Having two parallel test suites for the same component is confusing and risks drift. Consider consolidating the Todo tests into a single file (e.g. a dedicated TodoApp.test.tsx) and removing the duplicate describe("TodoApp") from one of them.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
desktop/src/apps/TodoApp.tsx 247 Item-operation failures (add/edit/delete/toggle) set the shared error state, and the `if (error
desktop/src/apps/TodoApp.tsx 309 create() only resets creating in catch; on success the Create button stays disabled showing "Creating..." and title is never cleared. The shared CreateNoteForm in notes-shared-base.tsx has the identical defect.
Files Reviewed (6 files)
  • desktop/src/apps/NotesApp.test.tsx - 0 new issues (prior duplicate-test SUGGESTION resolved: describe("TodoApp") removed)
  • desktop/src/apps/NotesApp.tsx - 0 issues (thin wrapper after extraction)
  • desktop/src/apps/TodoApp.tsx - 2 issues (new file)
  • desktop/src/apps/__tests__/NotesApp.test.tsx - 0 issues (Todo tests consolidated; empty-state test added)
  • desktop/src/apps/notes-shared-base.tsx - 0 new inline issues (carries same create() defect as TodoApp, noted above)
  • desktop/src/registry/app-registry.ts - 0 issues (todo now imports @/apps/TodoApp)

Prior findings (from previous review, verified at HEAD 248c28f9)

  • WARNING Share/members panel regression (TodoApp.tsx): now documented as an explicit, tracked decision via a code comment — acknowledged, no code change required.
  • SUGGESTION loadLists error state (TodoApp.tsx): resolved — loadError state + Retry button added.
  • SUGGESTION duplicate Todo test suites: resolved — describe("TodoApp") removed from NotesApp.test.tsx, consolidated into __tests__/NotesApp.test.tsx.

Fix these issues in Kilo Cloud

Previous Review Summaries (3 snapshots, latest commit f4ed777)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit f4ed777)

Status: No Issues Found | Recommendation: Merge

All 3 prior findings from commit 9e7d225 have been resolved in incremental commit f4ed777:

  • WARNING (Share/members panel regression) — Now documented as an explicit, tracked decision via a code comment in TodoApp.tsx (lines 338-341) rather than an accidental regression. Resolved.
  • SUGGESTION (loadLists error state) — Added loadError state with an inline error UI and a Retry button (TodoApp.tsx lines 345, 374-379). Fetch failures no longer spin forever. Resolved.
  • SUGGESTION (duplicate Todo test suites) — Removed the parallel describe("TodoApp") from desktop/src/apps/NotesApp.test.tsx; Todo tests now live solely in desktop/src/apps/__tests__/NotesApp.test.tsx (new empty-state test added, lines 283-293). Resolved.

No new issues introduced in the changed lines. AlertCircle is imported and EMPTY_DOCS = "No lists yet." matches the new test regex.

Files Reviewed (incremental, 3 files)
  • desktop/src/apps/TodoApp.tsx - 0 issues (3 prior resolved)
  • desktop/src/apps/NotesApp.test.tsx - 0 issues (prior resolved)
  • desktop/src/apps/__tests__/NotesApp.test.tsx - 0 issues (prior resolved)

Previous review (commit 9e7d225)

Status: No Issues Found | Recommendation: Merge

All 3 findings from the previous review (commit f63e2a7) have been resolved in incremental commit 9e7d225:

  • WARNING (Share/members panel regression) — Now documented as an explicit, tracked decision via a code comment in TodoApp.tsx rather than an accidental regression. Resolved.
  • SUGGESTION (loadLists error state) — Added loadError state with a retry UI; failures no longer spin forever. Resolved.
  • SUGGESTION (duplicate Todo test suites) — Removed the parallel describe("TodoApp") from desktop/src/apps/NotesApp.test.tsx; tests consolidated into desktop/src/apps/__tests__/NotesApp.test.tsx. Resolved.

Incremental changes reviewed: desktop/src/apps/TodoApp.tsx, desktop/src/apps/NotesApp.test.tsx, desktop/src/apps/__tests__/NotesApp.test.tsx. No new issues introduced in the changed lines (AlertCircle is imported, EMPTY_DOCS = "No lists yet." matches the new test regex).

Files Reviewed (3 files, incremental)
  • desktop/src/apps/TodoApp.tsx - 0 issues (3 prior resolved)
  • desktop/src/apps/NotesApp.test.tsx - 0 issues (prior resolved)
  • desktop/src/apps/__tests__/NotesApp.test.tsx - 0 issues (prior resolved)

Previous review (commit f63e2a7)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
desktop/src/apps/TodoApp.tsx 257 Standalone Todo drops the Share/members panel and per-entry revision history that the prior DocsApp list variant had — possible silent regression for shared lists

SUGGESTION

File Line Issue
desktop/src/apps/TodoApp.tsx 348 loadLists has no error state; on fetch failure the list pane shows an infinite "Loading..." spinner
desktop/src/apps/__tests__/NotesApp.test.tsx 24 Todo tests are duplicated across two files (__tests__/NotesApp.test.tsx and NotesApp.test.tsx) — consolidate to avoid drift
Files Reviewed (6 files)
  • desktop/src/apps/NotesApp.test.tsx
  • desktop/src/apps/NotesApp.tsx
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/apps/__tests__/NotesApp.test.tsx
  • desktop/src/apps/notes-shared-base.tsx
  • desktop/src/registry/app-registry.ts

Fix these issues in Kilo Cloud


Reviewed by hy3:free · Input: 94.7K · Output: 12.3K · Cached: 1.2M

@jaylfc

jaylfc commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Fold list before merge:

  1. TodoApp.tsx:257 (functional regression) - the standalone Todo loses the Share/members panel and per-entry revision history that the old DocsApp-based list variant provided. Either carry those over or, if intentionally dropped for slice 1, call it out explicitly in the PR + a follow-up issue so we do not silently lose sharing on todos.
  2. TodoApp.tsx:348 - loadLists swallows fetch failures in an empty catch and only flips loading to false, so a 500/network error shows an empty list with no error state. Surface the error (toast or inline) rather than failing silently.
  3. NotesApp.test.tsx:24 - Todo tests now live in two files (tests/NotesApp.test.tsx and the top-level NotesApp.test.tsx) both importing the same thing. Consolidate to one to avoid drift.

Once folded and CI green I will merge. Big refactor so I will diff the extracted components for behavior parity.

hognek added a commit to hognek/tinyagentos that referenced this pull request Jul 19, 2026
…load error state, duplicate test suites

- Add comment acknowledging Share/members panel not yet supported by /api/todo (WARNING)
- Add loadError state to loadLists with retry UI instead of swallowing failures (SUGGESTION)
- Consolidate duplicate TodoApp test suites into __tests__/NotesApp.test.tsx (SUGGESTION)

PR jaylfc#2037
hognek added a commit to hognek/tinyagentos that referenced this pull request Jul 19, 2026
…load error state, duplicate test suites

- Add comment acknowledging Share/members panel not yet supported by /api/todo (WARNING)
- Add loadError state to loadLists with retry UI instead of swallowing failures (SUGGESTION)
- Consolidate duplicate TodoApp test suites into __tests__/NotesApp.test.tsx (SUGGESTION)

PR jaylfc#2037

Docs-Reviewed: README already lists both Notes and Todo under platform apps; standalone TodoApp.tsx extraction just makes the component boundary match the docs
@hognek
hognek force-pushed the feat/split-notes-app branch from 9e7d225 to f4ed777 Compare July 19, 2026 10:09
…load error state, duplicate test suites

- WARNING: Added explicit comment documenting that standalone TodoApp does not yet carry Share/members panel or per-entry revision history from the old DocsApp list variant — tracked as follow-up work
- SUGGESTION: Added loadError state + retry button in loadLists — fetch failures now show an error alert instead of infinite spinner
- SUGGESTION: Consolidated Todo tests into __tests__/NotesApp.test.tsx, removed duplicate describe("TodoApp") from NotesApp.test.tsx

Docs-Reviewed: README already lists both Notes and Todo under platform apps; standalone TodoApp.tsx extraction just makes the component boundary match the docs
@hognek
hognek force-pushed the feat/split-notes-app branch from f4ed777 to 248c28f Compare July 19, 2026 15:17
}

if (loading) return <div className="flex h-full items-center justify-center"><p className="text-sm text-shell-text-tertiary">Loading...</p></div>;
if (error || !doc) return <div className="flex h-full items-center justify-center"><p className="text-sm text-red-400" role="alert">{error ?? "List not found."}</p></div>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Item-operation failures blank the entire detail pane

The shared error state is set by addItem, deleteItem, editItem, and toggleDone on failure, but the early return if (error || !doc) then replaces the whole pane (task list + add form) with only the error message. There is no retry or dismiss control, and loadDoc does not clear error, so the pane is stuck on the error until the list is remounted. A transient failure on any single item operation hides all tasks with no recovery path.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

const inputRef = useRef<HTMLInputElement>(null);
useEffect(() => { inputRef.current?.focus(); }, []);

async function create() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: create() never resets creating or clears title on success

On the success path setCreating(false) only runs in catch, and title is never reset. After a successful create the Create button stays disabled showing "Creating..." and the input keeps the old title. The shared CreateNoteForm in notes-shared-base.tsx carries the identical defect, so a fix here should be mirrored there.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

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