fix(lana): send settings to the log view, and keep sending them - #897
Open
lukecotter wants to merge 2 commits into
Open
fix(lana): send settings to the log view, and keep sending them#897lukecotter wants to merge 2 commits into
lukecotter wants to merge 2 commits into
Conversation
`lana.database.*` is private globalState rather than a registered setting, so the merged settings tree has no `database` branch on a profile that never wrote one. Reading it threw before the settings were sent, so on a fresh install nothing arrived: the timeline sat on its loading skeleton and every column view, filter and colour fell back to a default. Seed the branch the `Config` shape promises. The panel sets `retainContextWhenHidden`, so it is never re-created and never re-reads config on its own. Watch `lana` config changes and push `configChanged` to the webview, deduped against the last payload. `subscribeSettings()` seeds a consumer and follows later pushes in one call, and the timeline and the call-tree colouring adopt it, so editing a timeline theme applies without reopening the log view. Also fail a webview request when no extension host can answer it, instead of leaving the promise pending forever.
This was referenced Aug 1, 2026
Each subscriber sent its own getConfig round trip and carried a flag to drop a reply a push had overtaken. A cached newest value plus one shared request seeds later subscribers with no traffic at all. Also releases the category-colouring subscription when its host disconnects, and keeps the custom-theme registration inside the palette guard.
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.
Splits the second slice out of #894.
Fresh installs got no settings at all
lana.database.*is privateglobalState, not a registered setting, so the merged settings tree carries nodatabasebranch on any profile that never wrote one — every fresh install. Reading it threw before the settings were posted, so nothing reached the webview: the Timeline sat on its loading skeleton, and column views, table filters and colours all fell back to defaults.getConfig()now seeds the shapeConfigpromises.Settings did not stay current
The panel sets
retainContextWhenHidden, so it is never re-created and never re-reads config on its own — a settings edit only landed after closing and reopening the log view.LogViewwatcheslanaconfiguration changes and postsconfigChanged, deduped against the last payload so a no-op edit costs nothing. The listener is disposed with the panel.resolveConfig()is shared by the initialgetConfigreply and every push, so the two cannot drift.subscribeSettings()seeds a consumer and follows later pushes in one call, behind a single window listener. A push that lands before the seed reply wins, so the older value can't be applied over the newer one.lana.*edit cannot stomp an unpersisted quick-pick theme preview.Also: a webview request now rejects when no extension host can answer it, rather than leaving the promise pending forever (this is what surfaced the throw above as a silent hang).
Verification
tsc -b,eslint lana log-viewerand the full jest run (1266 tests, two new) are clean. Checked on a fresh profile — the Timeline loads and the real defaults apply; and with the panel open — editinglana.timeline.activeThemeandcustomThemesapplies live, and a quick-pick preview survives an unrelatedlana.*edit.Follow-ups
Sibling PRs carry the rest of #894: the appearance token layer and colour fixes, and live re-theming of the canvas timeline. A fourth (modern/cards chrome) follows once this and the token PR merge.