feat(ui): persist_state window/buffer persistence#281
feat(ui): persist_state window/buffer persistence#281sudo-tee merged 2 commits intosudo-tee:mainfrom
Conversation
f18e9ab to
0eba52d
Compare
0eba52d to
5807fed
Compare
|
Is this MR ready to re-review ? There is some conflicts at the moment against main. |
eef2ee7 to
3edc1fe
Compare
When ui.persist_state = true (default), toggle hides windows without deleting buffers and restores them on next toggle, preserving input draft content, scroll/cursor position, focused pane, and input_hidden state. Three-state window model: closed → visible → hidden → visible ↑___________↓____________↑ (teardown) (restore) Decision engine resolves (status, persist_state, has_display_route, in_tab) → action: | # | status | in_tab | persist_state | has_display_route | action | |---|---------|--------|---------------|-------------------|----------------| | 1 | hidden | any | true | any | restore_hidden | | 2 | hidden | any | false | any | close_hidden | | 3 | visible | false | any | any | migrate | | 4 | visible | true | any | true | close | | 5 | visible | true | false | any | close | | 6 | visible | true | true | false | hide | | 7 | closed | any | any | any | open | Note: Multiple opencode instances across tabs are not currently supported.
3edc1fe to
b9a421a
Compare
|
yes, The core is implementing the persist_state tri-state model (closed/hidden/visible) + decision-driven toggle logic. Major Changes (4 Files)
Actually, the Secondary Changes (Adaptation Adjustments)
Thanks for your hard work (both you and me). I definitely won't take on such a big PR again. I would rather bother you a few more times. @sudo-tee |
sudo-tee
left a comment
There was a problem hiding this comment.
I tested a bit and it works well, I like it overall
I left a couple of comments regarding the structure of the code as this is quite complex.
I feel like this should be simplified a little bit before merging.
Thanks a lot for your efforts on this.
It's almost there :)
- Align toggle decision rules with ordered first-match evaluation shared across state checks. - Split hide/teardown paths and inline finalization in UI close logic. - Replace toggle branching with action-handler dispatch while preserving behavior.
|
Thanks for addressing the comments I made. It definitely is easier to understand this way. I will do a final testing this weekend and it should be good to go |

When ui.persist_state = true (default), toggle hides windows without deleting buffers and restores them on next toggle, preserving input draft content, scroll/cursor position, focused pane, and input_hidden state.
Three-state window model:
closed → visible → hidden → visible
↑___________↓____________↑
(teardown) (restore)
Decision engine resolves (status, persist_state, has_display_route, in_tab) → action:
Note: Multiple opencode instances across tabs are not currently supported.