Skip to content

refactor(app): separate views, viewmodels, and persistence - #32

Merged
looechao merged 4 commits into
mainfrom
codex/mvvm-session-feeds
Nov 11, 2026
Merged

looechao merged 4 commits into
mainfrom
codex/mvvm-session-feeds

Conversation

@looechao

@looechao looechao commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Ceramic's window host previously owned loading, authorization, publishing and persistence alongside native widget state. This separates those responsibilities so business flows run against a serialized dispatcher without creating a MyGo window, while columns retain identity and reading state.

Closes #26.

Changes

Three independently buildable commits follow the issue's batches:

  1. Introduce root/feature ViewModels, cancellation and dispatch boundaries; migrate session, feeds, navigation and notifications; keep list, scroll and gallery resources in View keyed by stable column identities.
  2. Move publishing, replies, mention searches, edits/deletion and interactions into ViewModels; centralize loaded-post traversal; retain generation/content-revision guards, deleted-post history and uploaded attachment reuse.
  3. Extract internal/draftstore and internal/preferences, preserving paths and JSON fields; separate raw attachments from bitmaps; add atomic preference saves, compatibility tests, architecture checks and layer documentation.

The host drops callbacks after window closure. Closing columns cancels their requests; logout cancels session tasks and keeps draft-save failure guards. Late polls cannot restore deleted posts or double-count duplicate notifications. No framework upgrade or visual redesign.

Validation

macOS CI passed, including the complete go test -race ./... suite and cross-platform vet checks.

  • git diff --check, source formatting and go vet ./... pass.
  • CERAMIC_SCREENSHOTS=1 go test -run TestNative ./... and ./scripts/build.sh pass on Windows; installer generated.
  • Window-free business tests and new draftstore/preferences tests pass.
  • Compared 243 common screenshots with unmodified 250d484: 239 byte-identical; four differ in draft timestamps or intermediate hover/blink frames. Minimum-size, light/dark and breakpoint coverage retained.
  • Full Windows go test ./... has the same four failures as unmodified 250d484: TestDraftImageRoundTripAndSaveFailure, TestImageDiskCacheBudget, TestLoginTimelineAndLogout assert Unix file modes; TestSidebarAccountAndWindowControls asserts platform-specific layout. No new failures.
  • Local -race is blocked by the missing CGo C compiler. The macOS CI run linked above passed the full race suite and cross-platform vet checks.
  • gofmt -l . additionally reports pre-existing ignored build/qa/_releasecheck/main.go; repository source is formatted.

PR only; do not merge automatically.

@looechao
looechao merged commit 665ca26 into main Nov 11, 2026
@looechao
looechao deleted the codex/mvvm-session-feeds branch November 11, 2026 05:30
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.

refactor(app): adopt MVVM to separate views, application state, and persistence

1 participant