Files

4.6 KiB

Home and recent models — implementation, 2026-09-06

The DATA continuation baseline did not contain Home/start or recent-model code. This slice adds oa-desktop/src/home.rs, its storage tests, mod home, and the Home view/navigation in views.rs. The lead has added App lifecycle and recovery integration; integrated tests and native acceptance remain pending below.

Behavior and interface

Page::Home presents New, Open, the rescue example, the engineering guide, Continue editing, recent local model files and available recovery snapshots. Home hides the modeling sidebar/inspector. Horizontal navigation remains reachable at the existing minimum window width. Recovery rows use the lead's recovery::State entries and warning, and emit Event::Recover(Id).

The module emits typed home::Event values. New/Open/Example/OpenRecent/Recover must pass through the existing App Pending/save/discard guards; Guide/Resume use existing Page navigation. Home does not modify or read model contents. Refresh checks file availability. Remove only forgets recent-file metadata. Missing or unavailable files remain visible with a Locate action using the normal Open picker.

home::State::default() is memory-only for deterministic tests and constructors. load_default() loads metadata without creating directories. remember(&Path, &str) is called only after successful accepted local Open/Save; forget(&Path) and refresh() handle the corresponding Home actions. Preserve the Home state across App reset; do not reload it on each document replacement. JSON export, failed writes, rejected/stale save receipts and canceled opens are not recents.

home::data_directory() returns LOCALAPPDATA/ArcadiaStudio on Windows, otherwise XDG_DATA_HOME/arcadia-studio or HOME/.local/share/arcadia-studio. There is no current-directory fallback. Recent metadata is recent-models.json under it. Recovery may reuse this helper with a separate subdirectory.

Storage guarantees

At most 12 canonical local file paths and bounded display names, most recent first; no model content, source text or credentials. Writes use a same-directory temporary file, sync and atomic replacement; Unix also syncs the parent directory. The existing tempfile dependency moved from dev-only to runtime.

The reader bounds input to 256 KiB, rejects unknown fields/versions and invalid entries, and keeps malformed/unsupported metadata unchanged. Failures are visible and leave session history usable. Missing model files never disappear from history merely because a drive is disconnected. Metadata removal does not remove files.

Verification status

Eight focused storage tests cover side-effect-free first load, bounded order/deduplication and durable replacement, missing/forgotten files, restored availability, malformed/ future/oversized history preservation, failure/retry, malformed entries and absence of model content from the store. They are written but not yet executed while the lead bootstraps the new local Windows gnullvm toolchain. git diff --check passed. Three App integration regressions additionally cover newer unsaved work surviving a successful older Save receipt, checkpoint completion while a context menu is open, and deferred discard/close cleanup of a late write before closing. Four context-menu tests now explicitly use the demo fixture instead of startup. README and the in-app Files/Recovery guide describe Home, recents, ten-second private checkpoints, raw buffers, detached Save As and the missing undo history. Owned Rust files were formatted successfully using the already installed GNU toolchain's rustfmt executable (gnullvm initially lacked that component).

Still required: compile/tests after lead App/recovery wiring; App lifecycle tests for dirty model/drafts and stale file/save completions; actual default/minimum window Home/recent/missing-path/recovery operation. No native input was issued.

Independent integration review

Read-only review identified exact accepted-source comparison, unsupported property buffer paths, source-path admission, completion events blocked by context menus, stale-save checkpoint retirement, in-flight discard retirement and JSON-import recent-history gaps. Findings were sent to the lead; several corrections are already present but have not been exercised. Missing include paths legitimately exist in Workspace.reachable without a loaded buffer, as source_files inserts them before I/O. Recovery must preserve these repair states rather than require reachable to be a subset of files. App::new test fixtures that require the example must explicitly use with_project(Project::demo()), avoiding user-local state.