Skip to content

fix(persist): preserve popup hierarchy across restore and harden config validation#26

Merged
mhiro2 merged 4 commits intomainfrom
refactor/root-resolution-and-validation-hardening
Mar 10, 2026
Merged

fix(persist): preserve popup hierarchy across restore and harden config validation#26
mhiro2 merged 4 commits intomainfrom
refactor/root-resolution-and-validation-hardening

Conversation

@mhiro2
Copy link
Copy Markdown
Owner

@mhiro2 mhiro2 commented Mar 10, 2026

Summary

  • Unified stack view root window resolution so popup-triggered flows resolve the correct root window even in multi-split layouts
  • Preserved popup hierarchy, pinned state, and buffer mode when restoring from history and persisted sessions
  • Hardened config validation for previously unchecked fields so invalid values warn and fall back to defaults

Changes

  • 3f3a3ba : refactor(ui): unify root winid resolution for stack view
    • Centralized stack view root winid resolution through core.stack.get_root_winid() and removed duplicated lookup logic
    • Fixed incorrect root detection when opening the stack view from a popup in multi-split layouts by honoring popup/root window metadata
    • Added coverage to verify the stack view binds to the correct root window in popup-driven flows
  • c6f2769 : fix(history): remap parent_popup_id on restore to preserve parent-child links
    • Stored the original popup_id in history entries and rebuilt parent_popup_id references through an old-to-new ID remap during restore
    • Dropped stale parent references safely when the parent popup is no longer restorable
    • Added tests covering both single-entry restore and bulk restore of nested popup chains
  • 06f6252 : feat(persist): save pinned, buffer_mode, and parent-child links in sessions
    • Extended persisted session items to include popup_id, pinned, buffer_mode, and parent_popup_id so saved sessions reproduce the original exploration state more faithfully
    • Reconnected parent-child relationships during session restore with ID remapping and avoided carrying forward invalid parent references
    • Added session persistence tests covering pinned popups and source/copy buffer mode restoration
  • 625790b : fix(config): validate missing boolean fields and add negative tests
    • Added type and range validation for previously unchecked fields such as providers.*.enable, persist.enabled, ui.popup.auto_close, and ui.title
    • Normalized nested config sections before validation so malformed tables also fall back cleanly to defaults
    • Added negative tests for invalid booleans and out-of-range values to lock in warning and fallback behavior

mhiro2 added 4 commits March 10, 2026 23:23
Delegate stack_view.window.find_root_winid() to
core.stack.get_root_winid() to eliminate duplicated root
window resolution logic. The core version additionally checks
the popup index and peekstack_root_winid window variable,
which fixes incorrect root detection when opening stack view
from a popup in a multi-split layout.
…ld links

Save the original popup_id in history entries and use it to build
an old-to-new ID mapping during restore_all. This ensures that
parent_popup_id references point to the correct newly-created
popup IDs rather than stale ones from before the close.
…ssions

Extend session items to include popup_id, pinned, buffer_mode,
and parent_popup_id so that restored sessions faithfully reproduce
the original exploration flow. Parent IDs are remapped during
restore to point to newly created popup IDs.
Add validation rules for previously unchecked config fields:
- providers.{lsp,diagnostics,file}.enable
- providers.marks.enable
- persist.enabled
- ui.popup.auto_close.{enabled,idle_ms,check_interval_ms,ignore_pinned}
- ui.feedback.highlight_origin_on_close
- ui.promote.close_popup
- ui.title.{enabled,format}
- ui.title.context.{enabled,max_depth,separator}

Invalid values (e.g. string "false" for booleans) now warn and
fall back to defaults instead of silently being treated as truthy.
@mhiro2 mhiro2 self-assigned this Mar 10, 2026
@mhiro2 mhiro2 added the bug Something isn't working label Mar 10, 2026
@mhiro2 mhiro2 merged commit 5384525 into main Mar 10, 2026
3 checks passed
@mhiro2 mhiro2 deleted the refactor/root-resolution-and-validation-hardening branch March 10, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant