handle split resize safely + use store subscribe#328
Merged
sudo-tee merged 2 commits intosudo-tee:refactor/state-managementfrom Mar 18, 2026
Merged
Conversation
added 2 commits
March 18, 2026 16:44
Use window-type-aware resize logic in output_window.update_dimensions. - guard missing or invalid output_win before resizing - use nvim_win_set_width for split windows (relative == '') - keep nvim_win_set_config for floating windows - add regression tests for float-focus resize and invalid window This prevents "Cannot split a floating window" on VimResized while preserving existing zoom width behavior. Verified with: - ./run_tests.sh -t tests/unit/zoom_spec.lua
Follow the state observable API migration by switching reference picker setup from state.subscribe(...) to state.store.subscribe(...). This matches the refactor that centralized observable helpers under state.store and fixes startup error: attempt to call field 'subscribe' (a nil value). Verified with: ./run_tests.sh -t tests/unit/reference_picker_spec.lua
sudo-tee
added a commit
that referenced
this pull request
Mar 18, 2026
* wip: state-management refactor * feat(state): split state in smaller slices * refactor(state): move UI/window APIs into state.ui Move window state, cursor, visibility, and hidden-buffer helpers into a dedicated state.ui table. Update callers across modules and tests to reference state.ui.*, improving separation between core store logic and UI utilities. * refactor(state): centralize protected state mutations into domain setters * refactor(state): add mutation type annotations for state modules * refactor(state): rename notify to emit * fix: unsubscribe in tests * fix: context setting immutability * refactor(state): use std.RawGet and keyof OpencodeState in annotations * refactor(state): simplify store API and session/jobs mutations * refactor(state): centralize observable API under state.store Replace top-level observable helpers (state.subscribe, state.unsubscribe, state.append, state.emit) * fix: reference_picker * handle split resize safely + use store subscribe (#328) * fix(ui): handle split resize safely Use window-type-aware resize logic in output_window.update_dimensions. - guard missing or invalid output_win before resizing - use nvim_win_set_width for split windows (relative == '') - keep nvim_win_set_config for floating windows - add regression tests for float-focus resize and invalid window This prevents "Cannot split a floating window" on VimResized while preserving existing zoom width behavior. Verified with: - ./run_tests.sh -t tests/unit/zoom_spec.lua * fix(reference-picker): use store subscribe Follow the state observable API migration by switching reference picker setup from state.subscribe(...) to state.store.subscribe(...). This matches the refactor that centralized observable helpers under state.store and fixes startup error: attempt to call field 'subscribe' (a nil value). Verified with: ./run_tests.sh -t tests/unit/reference_picker_spec.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The window-splitting issue appears to be a legacy bug, but it was affecting my local development, so I fixed it. @sudo-tee