fix: convert 9 remaining Display impls from write_str to pad - #6162
Merged
Conversation
SessionKind/SessionStatus/SessionChannel were fixed in #6060 for the same latent bug: Formatter::write_str silently ignores width/fill/align flags from the caller's format spec, while Formatter::pad respects them. Converts the remaining 9 instances of this pattern to f.pad(...): ProviderKind, MemoryTier, ContentFidelity, EntityType, SourceKind, ParameterKind, ExperimentSource, EdgeType, and Lang (found during review, using a different self-accessor than the issue's original grep pattern). Adds width-spec regression tests for each type. Closes #6066
bug-ops
force-pushed
the
fix/6066-display-write-str-to-pad
branch
from
July 12, 2026 19:02
ff9257a to
aff3767
Compare
bug-ops
enabled auto-merge (squash)
July 12, 2026 19:03
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.
Summary
SessionKind/SessionStatus/SessionChannelwere fixed in fix(tui): clear fleet/task-registry overlays and fix Display padding in fleet panel #6060 for a latent bug:Formatter::write_strsilently ignores width/fill/align flags from the caller's format spec, whileFormatter::padrespects them. The fix scoped itself to those 3 confirmed-live instances, leaving 8 other flagged sites for a follow-up pass (per TUI Fleet panel: KIND/STATUS/CH/MODEL columns render with no separator (Display::write_str ignores width spec) #6015's own text).f.write_str(...)tof.pad(...):ProviderKind,MemoryTier,ContentFidelity,EntityType,SourceKind,ParameterKind,ExperimentSource,EdgeType(the 8 originally named in the issue), plusLang(crates/zeph-index/src/languages.rs) — a 9th same-class site found during adversarial review that usedf.id()instead off.as_str(), so it wasn't caught by the issue's own grep pattern. Fixing it now closes the anti-pattern crate-wide, matching the issue's stated goal, instead of leaving it for yet another follow-up.format!("{:<N}", value)/format!("{:>N}", value)actually pads, which fails under the oldwrite_strbehavior and passes underpad.This is a preventive/tech-debt fix — no confirmed live width-spec call site exists for these types today (verified in the issue and re-verified during review), so the change closes off the anti-pattern before it can cause a visible rendering bug.
Closes #6066
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins(13186 passed, 0 failed)RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"padback towrite_strmakes the corresponding test fail)