Skip to content

terminal: settings lists scroll with the mouse; a change applies even when it cannot be saved - #60

Merged
ymote merged 1 commit into
mainfrom
fix/terminal-settings-scroll-and-live-apply
Sep 30, 2026
Merged

ymote merged 1 commit into
mainfrom
fix/terminal-settings-scroll-and-live-apply

Conversation

@ymote

@ymote ymote commented Sep 30, 2026

Copy link
Copy Markdown

Found while running the OctoSense desktop on macOS (Terminal hosted as a sandboxed process), and reproduced and verified with the remote instrument (--remote, hidden window).

1. Mouse-wheel scrolling in the settings panel. The settings list and every chooser (Theme, Font, CJK font, …) could only be scrolled with the arrow keys. panel_scroll moved scroll, but each draw then scrolled back to keep the (unchanged) selection visible.

  • Fix: the draw brings a selection into view only when it changed (shown_selected on Panel and Chooser); a wheel scroll stays where it was put. Arrow keys behave as before.
  • Verified: three wheel steps (/m?k=scroll&dy=120) move the Theme list from Desktop to its end (Dracula). The old build (a5a3cf5) stays at the top.

2. A change applies even when it cannot be saved. settings::update returned early when writing settings.conf failed, before updating the live copy and the generation. In a read-only or sandboxed home (OctoSense's G6 closed the old MAKEPAD_HOME to process apps), theme, cursor and every other change silently did nothing; only font previews worked.

  • Fix: the change is applied and the generation bumped first, then the save error is returned for the caller to log.
  • Verified with a read-only MAKEPAD_HOME: the theme (Desktop → Catppuccin Latte) and the cursor (Block → Bar) change live, and the save error is logged once.

Checks:

  • cargo test --release -p makepad-terminal: 372 passed. 2 failed, session::tests::{a_session_reports_its_foreground_job_and_cwd, dropping_an_idle_session_does_not_block}, and they fail the same way on unmodified main here (pty environment).
  • rustfmt --check is clean on both files.
  • clippy -D warnings reports existing disallowed_types (Instant, recv_timeout) across the crate; none are on changed lines.

The OctoSense side (the Terminal's MAKEPAD_HOME is now its jail) is OctoSense-org/OctoSense#178.

🤖 Generated with Claude Code

… when it cannot be saved

Found on the OctoSense desktop (process-hosted Terminal) and reproduced
with the remote instrument:

- The settings list and every chooser (Theme, Font, ...) ignored the
  mouse wheel: the wheel moved `scroll`, but each draw scrolled back to
  keep the selection visible, so only the arrow keys moved the list. The
  draw now brings a selection into view only when it CHANGED (tracked as
  `shown_selected`); a wheel scroll stays where it was put. Verified:
  three wheel steps move the Theme list to its end (the old build stays
  at the top).
- settings::update returned before updating the live copy when writing
  the file failed (read-only or sandboxed home), so theme, cursor and
  every other change silently did nothing. It now applies the change
  and bumps the generation first, then returns the save error for the
  caller to report. Verified with a read-only MAKEPAD_HOME: the theme and
  the cursor shape change live, the save error is logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymote
ymote merged commit eca9c5d into main Sep 30, 2026
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