mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
Every refresh scope needs two ambient values to bounce its model and view updates back to the UI thread safely: the background flag (which picks the dispatch variant that doesn't count towards lazygit being busy) and the repo generation that guards the bounce against a repo switch. These were threaded separately — background as a parameter on every refreshXxx function, generation re-read from the model inside each one. Bundle them into a single refreshEnv passed through instead, so the guard has a home to grow into (the next commit needs the generation in refreshView, which currently has no access to it). Capturing the generation once, at the start of the refresh, is also more correct than the previous per-function re-read. The baseline should reflect the repo whose inputs the refresh snapshotted (all captured up front on the UI thread), not whenever each scope's worker happens to wake. With the per-function read, a background refresh whose worker woke after a repo switch would read the new generation and let its bounce through, writing data computed from the old repo's inputs into the new repo; capturing up front makes that bounce drop instead. No behavior change for foreground refreshes, where the UI thread is held for the whole refresh and the generation can't move under it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| context | ||
| controllers | ||
| filetree | ||
| mergeconflicts | ||
| modes | ||
| patch_exploring | ||
| popup | ||
| presentation | ||
| services/custom_commands | ||
| status | ||
| style | ||
| types | ||
| background.go | ||
| command_log_panel.go | ||
| context.go | ||
| context_config.go | ||
| controllers.go | ||
| dummies.go | ||
| editors.go | ||
| extras_panel.go | ||
| global_handlers.go | ||
| gui.go | ||
| gui_common.go | ||
| gui_driver.go | ||
| information_panel.go | ||
| keybindings.go | ||
| layout.go | ||
| main_panels.go | ||
| menu_panel.go | ||
| options_map.go | ||
| pty.go | ||
| recent_repos_panel.go | ||
| side_panels.go | ||
| side_panels_test.go | ||
| tasks_adapter.go | ||
| test_mode.go | ||
| view_helpers.go | ||
| views.go | ||