* fix(uimd): render bd show DESCRIPTION with terminal's actual background
glamour.WithEnvironmentConfig() defaults to styles.DarkStyle whenever
GLAMOUR_STYLE is unset, with no light/dark auto-detection. That left
the DESCRIPTION section's markdown body always dark-themed regardless
of the terminal's real background, even though internal/ui already
detects it (lipgloss.HasDarkBackground) for the header and every other
adaptive color in bd's output. Result: unreadable low-contrast body
text on light-background terminals.
Export internal/ui's detected background as IsDarkBackground and have
internal/uimd pick glamour's "light" or "dark" style from it, still
honoring an explicit GLAMOUR_STYLE override first.
Fixes#5775
* test(uimd): pin glamourStylePath, add CHANGELOG entry, harden IsDarkBackground
Address PR review requests on #5776:
- Add a table test for glamourStylePath() covering the GLAMOUR_STYLE
override and the dark/light background branches.
- Add a CHANGELOG entry under Unreleased, scoped to every markdown body
bd prints (DESCRIPTION, DESIGN, NOTES, ACCEPTANCE CRITERIA, comments,
direct and proxied), not just bd show's DESCRIPTION field.
- Turn ui.IsDarkBackground from an exported mutable variable into an
accessor over an unexported one, with a SetDarkBackgroundForTest seam
for the new table test.
- Document why glamourStylePath's read of the background can never see
an unprobed zero value: it only runs under the same ui.ShouldUseColor()
gate that guards the probe.
* docs(recovery): refresh init-safety.md freshness marker
CI doc-flags-freshness check flagged Last reviewed as stale
(2026-06-09, 110 days). Content unchanged, marker bumped.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* chore(bazel): sync internal/uimd BUILD.bazel for the new test imports
markdown_test.go gains `charm.land/glamour/v2/styles` and
`internal/ui`, but `go_test(name = "uimd_test")` carried no `deps`
attribute, so `make bazel-sync` (gazelle) rewrites the file. The
advisory Bazel lane's "BUILD files in sync" step runs that exact
command and `exit 1`s on any porcelain drift, and it arms
unconditionally for fork PRs.
Generated with `make bazel-sync`, the remedy the gate itself prescribes.
No hand-written lines.
* fix(uimd,changelog): pin the style wiring at RenderMarkdown, move the entry to Unreleased
Both review lanes filed the CHANGELOG placement and codex filed the test gap;
this takes both. Neither needed a production change.
CHANGELOG: the 16-line entry was added inside `## [1.3.0] - 2026-09-15`, a
shipped and tagged release, so it rewrote published history for a fix that was
not in 1.3.0 and the next release cut would not have picked it up. Moved under
`## [Unreleased]`, at the END of its first `### Fixed` list rather than the top:
main is appending new entries at the top of that list constantly, and an
insertion there makes the adopted head conflict with main for no benefit
(measured -- top placement gave `git merge-tree` a CHANGELOG conflict, the tail
placement merges clean). The bullet text is byte-identical to the contributor's.
Test: TestGlamourStylePath pinned the helper but nothing pinned
markdown.go's `glamour.WithStylePath(glamourStylePath())`, so the whole
user-visible fix could be reverted with a green suite. Codex confirmed that
empirically and so did this change: reverting that one line to
`glamour.WithEnvironmentConfig()` leaves every pre-existing test in the package
PASSING -- including all four TestGlamourStylePath subtests -- and reds only the
new TestRenderMarkdownUsesTheDetectedBackgroundStyle. The new test renders one
sample under each background and requires the output to differ, so it detects
exactly that regression and nothing else.
The nit (SetDarkBackgroundForTest not re-running initColors) is left alone: the
synthesis marks it "none for merge" and today's only caller reads the flag.
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>