Skip to content

Remember the scanning panel position between sessions - #1040

Merged
enaboapps merged 3 commits into
mainfrom
claude/1039-panel-position
Oct 13, 2026
Merged

enaboapps merged 3 commits into
mainfrom
claude/1039-panel-position

Conversation

@enaboapps

@enaboapps enaboapps commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1039

What changed

  • New panel_position module stores the chosen scanning panel dock locally in panel-position.json ({"column":C,"row":R}) in the app config folder, next to point-scan.json and switch-settings.json. Writes replace the file atomically through the existing storage::replace_file helper.
  • A missing, unreadable, malformed or out-of-range file falls back to the default bottom-middle dock.
  • Workflow::with_dock starts a new scanning session at the saved dock (point_scan_runtime::new_engine). Workflow::take_dock_change reports a newly chosen dock once.
  • New Adapter::remember hook, called after each switch action in scanning_runtime, saves the dock only when the chosen dock actually changed. The temporary move away from the pointer (moved) is never saved. A failed save logs a generic message and keeps the dock for the running app.
  • resume_from also carries the chosen dock into the next scan, so the position holds within a run even if saving fails.
  • scan_panel::Dock derives serde. It is not added to the synced scanner config, portable settings or Supabase preferences, so the synced format is unchanged.

Validation

  • npm run lint: pass
  • npm test: 295/295 vitest tests (13 files) and 12/12 node tests pass
  • npm run build: pass
  • cargo fmt --check: pass
  • cargo clippy --all-targets -- -D warnings: pass
  • cargo test: 761 passed, 0 failed, 5 ignored; config tests 7 passed
  • New tests: panel_position::tests::a_saved_position_loads_back, panel_position::tests::missing_or_invalid_positions_use_the_default (temp dirs), point_workflow::tests::a_saved_panel_position_is_restored_and_only_chosen_positions_are_saved (no real input).
  • npm run prediction-model was not run. It fails on this machine with an EPERM rename in .cache/prediction-neural, a local Windows lock unrelated to this change. The gitignored src-tauri/resources/prediction-model, src-tauri/resources/prediction-neural and src-tauri/binaries were copied from the main checkout for the build and tests.
  • Not yet checked on a real device: move the panel, then restart scanning and the app.

Review

  • Independent review of 00f4113 raised two low-severity findings: a failed save was counted as saved and never retried, and the file was not flushed before the rename. Both are fixed in 0999b73: the position is marked saved only after a successful write, so the next switch action retries, and the file is sync_alled before replace_file. Rust fmt, clippy and tests passed again (761 passed).
  • A second independent review of 0999b73 reported no actionable findings.

🤖 Generated with Claude Code

The dock chosen with the position keys is saved to panel-position.json in
the app config folder and restored when the next scanning session starts.
It stays out of the synced scanner settings. A missing or invalid file
falls back to the default dock, and moving out of the pointer's way never
changes the saved position.

Closes #1039

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps enaboapps added this to the v1.0.0-rc.25 milestone Oct 13, 2026
Mark the position saved only once the write succeeds, so the next
switch action retries it, and sync the file to disk before the rename
like the scanning settings writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps
enaboapps marked this pull request as ready for review October 13, 2026 10:49
@enaboapps
enaboapps merged commit 35e3cd4 into main Oct 13, 2026
6 checks passed
@enaboapps
enaboapps deleted the claude/1039-panel-position branch October 13, 2026 12:14
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.

Remember the scanning panel position between sessions

2 participants