fix racy light/dark rendering - #776
Open
MichaelMure wants to merge 4 commits into
Open
Conversation
Author
|
After more debugging I realize that this might not be the right fix. But there is a bug: from what I'm seeing, there is a race, at least in |
This is a regression that happened in commit 47e59e9
Before, this was relying on a side effect of compat.HasDarkBackground in lipgloss (package level var) triggering the terminal request, which would eventually flow back to the form. This makes it explicit and execute in all cases. Arguably, compat.HasDarkBackground could cause problems as it queries (os.Stdin, os.Stdout) instead of the real input/output of the form.
Previously, message other than tea.KeyPressMsg, tea.PasteMsg were propagated twice. This also makes the code more obvious.
MichaelMure
force-pushed
the
fix-theme-bg
branch
from
April 29, 2026 06:29
358d662 to
45eb237
Compare
Author
|
I found the real root causes, see my root message. |
6 tasks
Aharonee
added a commit
to pearl-research-labs/pearl
that referenced
this pull request
Jul 16, 2026
…rst internals Provisioned configs no longer pin rpclisten: oyster's own default is loopback-only listeners on the active network's port, so one conf now serves mainnet and testnet side by side, and an explicit rpclisten in an existing conf becomes the address oystercli dials (the daemon listens exactly there, whatever the network default is). Non-loopback connect targets are treated as remote: no local auto-provisioning, no local wallet-creation or daemon-start offers in triage, and the not-running advice speaks about the remote's listener, firewall, credentials, and certificate instead. Internals now lean on libraries instead of hand-rolled logic: oyster.conf is parsed with go-flags' ini parser (the daemon's own format machinery) rather than regexes, required-field validation uses huh.ValidateNotEmpty, and first-non-empty selection uses cmp.Or. Theming drops the custom hex palette entirely — printed output uses only basic ANSI colors and the Faint attribute, which terminal themes keep readable on any background, and forms use huh's stock ThemeCharm with one workaround (option foregrounds unset to the terminal default) for the unreleased upstream fix charmbracelet/huh#776, whose v2.0.3 light palette rendered menu options near-white on light terminals.
Aharonee
added a commit
to pearl-research-labs/pearl
that referenced
this pull request
Jul 16, 2026
…pport (#249) - Restore from seed: an omitted wallet birthday now sends the chain's genesis time instead of falling through to oyster's time.Now() default, which skipped all history and left restored wallets with no addresses and no balance (the desktop wallet works because it hardcodes a pre-genesis birthday). The wizard now describes the birthday as narrowing the recovery scan, not as an optimization. - One conf, every network: auto-provisioned configs no longer pin rpclisten — oyster's own default is loopback-only listeners on the active network's port — so the same oyster.conf serves mainnet and testnet daemons side by side and `oystercli --testnet` works end to end. An explicit rpclisten in an existing conf (e.g. the release installer's) is where the daemon actually listens, so oystercli now dials it, mapping wildcard hosts to loopback and reporting the provenance as "oyster.conf (rpclisten)". - Remote daemons: non-loopback connect targets skip local bootstrapping — no auto-provisioning, no wallet-creation or daemon-start offers in triage — and the not-running advice covers the remote's listener, firewall, credentials, and certificate. Supported patterns (flags + copied rpc.cert, SSH tunnel, dedicated client appdata dir) are documented in the README. - Terminal-theme readability: the custom hex palette is gone. Printed output uses only basic ANSI colors and the Faint attribute, which terminal themes keep readable on light and dark backgrounds. Forms use huh's stock ThemeCharm with one workaround — option foregrounds unset to the terminal default — because huh v2.0.3 always renders its light palette, whose near-white option color is invisible on light terminals; drop when charmbracelet/huh#776 ships. - Library-first internals: oyster.conf is parsed with go-flags' ini parser (the daemon's own format machinery) instead of regexes, required-field validation uses huh.ValidateNotEmpty, and first-non-empty selection uses cmp.Or. The log sanitizer stays custom on purpose: x/ansi.Strip passes bare C0 controls through, which would defeat the escape-injection defense.
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.
Forms were racingly rendered with light-theme colors regardless of the terminal background, due to three related bugs:
ThemeCharm.This is a regression that happened in commit 47e59e9compat.HasDarkBackgroundin lipgloss (package level var) triggering the terminal request, which would eventually flow back to the form. This makes it explicit and execute in all cases. Arguably,compat.HasDarkBackgroundcan cause problems as it queries(os.Stdin, os.Stdout)instead of the real input/output of the form.Additionally:
fix(group): don't propagate events twice. Previously, message other than
tea.KeyPressMsg, tea.PasteMsgwere propagated twice. This also makes the code more obvious.I have read
CONTRIBUTING.md.I have created a discussion that was approved by a maintainer (for new features).
Before fix:

After fix:
