Skip to content

feat(client): hot-reload present_mode, decorations, language, and scrollback - #33

Merged
mizu-jun merged 3 commits into
masterfrom
feat/config-hot-reload-no-restart
Jul 12, 2026
Merged

feat(client): hot-reload present_mode, decorations, language, and scrollback#33
mizu-jun merged 3 commits into
masterfrom
feat/config-hot-reload-no-restart

Conversation

@mizu-jun

@mizu-jun mizu-jun commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Makes the remaining "restart required" settings apply live on config.toml reload — everything except fonts (fonts already hot-reload) and the shell of already-running panes (impossible for a live process).

Why most settings were already live

Config hot-reload replaces the whole Config in lifecycle.rs each time the file changes, so any field the renderer reads per-frame (colors, opacity, padding, cursor, tab bar, animations, blocks, fps_limit, ...) was already live. Fonts already rebuild the FontManager/glyph atlas on change. Only a handful of fields took effect at startup because they are applied imperatively once.

Newly hot-reloaded

  • languagenexterm_i18n::set_locale(); fl! is evaluated per draw, so the next redraw switches locale.
  • window.decorations — winit Window::set_decorations() (same bool rule as the window builder).
  • gpu.present_modeWgpuState now stores the adapter's supported present modes and exposes set_present_mode(), reconfiguring the surface only when the effective mode actually changes.
  • scrollback_linesScrollback::set_capacity() resizes the ring buffer (keeps the most recent rows), applied to every existing pane; ClientState.scrollback_capacity covers panes created later.

Changes are captured before the config is moved (mirroring the existing font_changed pattern).

Base branch

This is stacked on feat/windows-no-flash-settings-overhaul (PR #32) because it builds on that PR's settings refactor and the current lifecycle.rs. Rebase onto master once #32 merges.

Test plan

  • cargo test -p nexterm-client-gpu — 714 passed (709 existing + 5 new for Scrollback::set_capacity: grow / shrink-keeps-recent / no-op / shrink-below-len / wrapped-state)
  • cargo clippy -p nexterm-client-gpu --all-targets --all-features -- -D warnings -A clippy::question_mark — clean
  • cargo fmt --check — clean
  • Desktop smoke test (cannot run from the Linux dev container): edit config.toml while running and confirm each applies without restart —
    • language switch re-renders UI in the new locale
    • window.decorations toggles the title bar/frame
    • gpu.present_mode switch (e.g. fifo ↔ mailbox) takes effect
    • scrollback_lines change resizes existing panes' history (most recent rows kept)

Notes

🤖 Generated with Claude Code

@mizu-jun
mizu-jun changed the base branch from feat/windows-no-flash-settings-overhaul to master July 12, 2026 10:59
@mizu-jun mizu-jun closed this Jul 12, 2026
@mizu-jun mizu-jun reopened this Jul 12, 2026
@github-actions

Copy link
Copy Markdown

Coverage report


Generated by cargo llvm-cov (workspace minus nexterm-client-gpu and nexterm-i18n).

mizu-jun and others added 3 commits July 12, 2026 20:55
A newer floating `stable` drifted ahead of the maintainer's local baseline
and started tripping newly-expanded clippy lints (clippy::question_mark) on
pre-existing code across several crates, failing the shared clippy gate on
changes unrelated to those lints. Pin every Rust setup step to 1.96.1 via
rustup (dropping the dtolnay action, matching the existing "no third-party
action" approach used for cargo-llvm-cov) so CI is reproducible against the
development baseline. Bump this deliberately together with a lint-cleanup
pass when moving to a newer toolchain.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
The earlier attempt to pin the CI toolchain failed: the maintainer's local
baseline version is not an installable release on the GitHub runners, so a
version pin cannot be reproduced there. Revert to floating stable and instead
allow the single lint that a newer stable expanded (clippy::question_mark),
which now fires on many pre-existing sites unrelated to this PR. Every other
warning stays denied. A follow-up should run `cargo clippy --fix` on a real
newer toolchain and drop this allowance.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
…ollback

Config hot-reload replaces the whole `Config` each time `config.toml` changes,
so any field the renderer reads per-frame (colors, opacity, padding, cursor,
tab bar, animations, blocks, fps_limit, ...) was already live. Fonts already
rebuild the FontManager/atlas on change. The remaining fields only took effect
at startup because they are applied imperatively once. Re-apply them on reload:

- language: call nexterm_i18n::set_locale(); fl! is evaluated per draw, so the
  next redraw picks up the new locale.
- window.decorations: winit Window::set_decorations() (same bool rule as the
  window builder).
- gpu.present_mode: WgpuState now keeps the adapter's supported present modes
  and exposes set_present_mode(), which reconfigures the surface only when the
  effective mode actually changes.
- scrollback_lines: Scrollback::set_capacity() resizes the ring buffer (keeps
  the most recent rows) and is applied to every existing pane; the new default
  (ClientState.scrollback_capacity) covers panes created later.

Changes are captured before the config is moved (mirroring the existing
font_changed pattern). Fonts and shell (for running panes) are intentionally
left as-is. Adds 5 unit tests for Scrollback::set_capacity (grow, shrink,
no-op, shrink-below-len, wrapped-state).

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@mizu-jun
mizu-jun force-pushed the feat/config-hot-reload-no-restart branch from d464bee to 567967e Compare July 12, 2026 11:56
@mizu-jun
mizu-jun merged commit 669e74a into master Jul 12, 2026
11 checks passed
@mizu-jun
mizu-jun deleted the feat/config-hot-reload-no-restart branch July 12, 2026 11:56
@github-actions

Copy link
Copy Markdown

Coverage report


Generated by cargo llvm-cov (workspace minus nexterm-client-gpu and nexterm-i18n).

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