Skip to content

Fix storage, desktop, and responsive reliability gaps - #32

Merged
zeidalidiez merged 1 commit into
mainfrom
codex/fix-audit-reliability-gaps
Jul 9, 2026
Merged

Fix storage, desktop, and responsive reliability gaps#32
zeidalidiez merged 1 commit into
mainfrom
codex/fix-audit-reliability-gaps

Conversation

@zeidalidiez

@zeidalidiez zeidalidiez commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

  • make browser/folder storage an explicit per-project destination, replace revision counters with cross-runtime content fingerprints, serialize autosaves, and reject stale or deleted-file writes
  • implement key-scoped Tauri file watching for edits, deletes, and renames; restrict project commands to .pm-suite/*.pms.json; add a strict CSP and correct the Tauri 2 package/config layout
  • complete import ID/reference remapping and validation, add a realistic non-persistent demo project, and wire “Add view” to the Views settings section
  • fix tablet/mobile shell overflow and accessible compact actions, and let the PWA plugin own base-aware service-worker registration
  • align the README/spec ledger with shipped behavior and expand CI across both frontends, Playwright, and Rust

Why

The audit found several gaps where implementation and documentation diverged:

  • stale-write protection trusted browser-local counters instead of the current stored content
  • an active folder could silently redirect another project’s save destination
  • the desktop watch bridge and native package checks were described but not complete
  • the manually registered service worker hard-coded the site root and broke GitHub Pages scope
  • prefixed imports left nested IDs and project ownership references behind
  • fixed header/layout assumptions caused clipping on narrower viewports
  • the demo and status documentation overstated what the current implementation actually demonstrated

Impact

This prevents silent project relocation and accidental overwrite of externally changed or deleted data, gives desktop users actionable external-change handling, restores correct hosted PWA behavior, preserves import integrity, and keeps core project actions usable on tablet/mobile layouts.

Validation

  • npm test — 224 tests passed
  • npm run typecheck — all workspaces passed
  • npm run build — core, UI, desktop, and web builds passed
  • VITE_GITHUB_PAGES=true npm run build:web — Pages-scoped manifest and service-worker registration verified
  • npm run test:e2e — 12 Playwright flows passed, including tablet action bounds and mobile overflow
  • cargo check --manifest-path apps/desktop/src-tauri/Cargo.toml — passed
  • cargo test --manifest-path apps/desktop/src-tauri/Cargo.toml --lib — 2 native tests passed
  • npm audit --omit=dev — 0 production vulnerabilities
  • visual pass at 1280×720 and 390×844

Follow-up

The full npm audit still reports six development-tool advisories in the Vite/Vitest/esbuild/PWA chain. Resolving those requires coordinated major-version upgrades and should be handled separately from these non-breaking fixes. The production builds also retain the existing >500 kB chunk warning, so route-level code splitting remains a useful follow-up.

Greptile Summary

This PR improves storage reliability, desktop watching, responsive shell behavior, and validation coverage. The main changes are:

  • Explicit browser or folder save targets per project.
  • Content-fingerprint stale-write checks across web, desktop, and in-memory storage.
  • Serialized autosaves and conflict handling for changed or deleted stored files.
  • Key-scoped Tauri file watching for external edits, deletes, and renames.
  • Completed import ID/reference remapping and dangling-reference warnings.
  • Responsive header/action fixes, hosted PWA registration cleanup, demo updates, docs, and broader CI.

Confidence Score: 5/5

Safe to merge with low risk.

No blocking or non-blocking code issues were found in the reviewed storage, watcher, import, shell, launcher, and test changes. The changed paths include focused coverage for stale-write rejection, storage target isolation, responsive behavior, and runtime checks.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex started the responsive capture run and verified the app started at the internal URL and the responsive test passed.
  • T-Rex reviewed the responsive-capture-observations.log to confirm desktop viewport bounds (1280x720) and mobile viewport bounds (390x844) and that bounds stay within the viewport.
  • T-Rex noted a blocker in hybrid-parity testing due to a Chromium executable mismatch while reviewing hybrid-parity-responsive-run.log.
  • T-Rex linked and reviewed the provided artifact set (screenshots and logs) to support reviewer verification.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
apps/web/src/platform/storage/web-storage.ts Adds explicit browser/folder persistence, recovery-base tracking, and content-fingerprint conflict checks.
apps/desktop/src/platform/storage/desktop-storage.ts Implements explicit desktop browser/folder targets, fingerprint stale-write checks, and watch metadata updates.
apps/desktop/src-tauri/src/lib.rs Adds validated .pm-suite file commands and a fingerprint-based external-change watcher.
packages/ui/src/AppShell.tsx Adds compact project actions, external-change handling, guarded close, and manual save behavior.
packages/ui/src/views/projects/ProjectsListView.tsx Updates launcher create/open/delete flows for explicit storage targets and folder reconnects.
packages/core/src/import/import-project.ts Completes ID/reference remapping and validates remaining dangling references after prefixed imports.
packages/core/src/storage/store.ts Changes storage metadata to deterministic content fingerprints and explicit persisted trust targets.
tests/e2e/hybrid-parity.spec.ts Adds end-to-end coverage for responsive bounds and hybrid behavior.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant UI as AppShell / Launcher
participant Store as Zustand Project Store
participant Adapter as Web/Desktop Storage Adapter
participant Disk as Browser Storage or .pm-suite File
participant Watch as Desktop Watcher

UI->>Store: edit project / mark dirty
Store->>Adapter: save(key, json, externalRevision, targetTrust)
Adapter->>Disk: read current JSON for fingerprint
Disk-->>Adapter: current content or missing
alt fingerprint matches expected revision
    Adapter->>Disk: write project JSON
    Adapter-->>Store: metadata with new contentRevision
    Store-->>UI: saved status + storage trust
else stale or deleted content
    Adapter-->>Store: reject external-change save
    Store-->>UI: save failed / conflict banner
end
Watch->>UI: externalChange / deleted / renamed
UI->>Adapter: reload from storage or keep local changes
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant UI as AppShell / Launcher
participant Store as Zustand Project Store
participant Adapter as Web/Desktop Storage Adapter
participant Disk as Browser Storage or .pm-suite File
participant Watch as Desktop Watcher

UI->>Store: edit project / mark dirty
Store->>Adapter: save(key, json, externalRevision, targetTrust)
Adapter->>Disk: read current JSON for fingerprint
Disk-->>Adapter: current content or missing
alt fingerprint matches expected revision
    Adapter->>Disk: write project JSON
    Adapter-->>Store: metadata with new contentRevision
    Store-->>UI: saved status + storage trust
else stale or deleted content
    Adapter-->>Store: reject external-change save
    Store-->>UI: save failed / conflict banner
end
Watch->>UI: externalChange / deleted / renamed
UI->>Adapter: reload from storage or keep local changes
Loading

Reviews (1): Last reviewed commit: "Fix storage and desktop reliability gaps" | Re-trigger Greptile

Signed-off-by: Zeid Diez <69106534+zeidalidiez@users.noreply.github.com>
@zeidalidiez
zeidalidiez marked this pull request as ready for review July 9, 2026 19:50
@zeidalidiez
zeidalidiez merged commit 69656a5 into main Jul 9, 2026
3 checks passed
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.

1 participant