refactor(tui): share StyledGlyph across queue show/status renderers#1444
Merged
mergify[bot] merged 3 commits intoMay 28, 2026
Conversation
This was referenced May 19, 2026
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced May 19, 2026
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 ⛓️ Depends-On RequirementsWonderful, this rule succeeded.Requirement based on the presence of
🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
sileht
previously approved these changes
May 20, 2026
d729c8f to
66bd10c
Compare
e195107 to
1a26a25
Compare
Member
Author
Revision history
|
This was referenced May 27, 2026
0028ed5 to
de0a5de
Compare
de0a5de to
bf480c8
Compare
…odule `with_ci_env` (clear every CI-provider env var before applying test overrides) lived in two copies — one inside the `tests` sub-module of `detector.rs`, one inside `scopes_send.rs` (which also had a `with_ci_env_async` counterpart). Both spelled the same 10-var list inline; both were drifting candidates. Extract to a new `crate::testing` (`#[cfg(test)] mod testing`) with the env-var list named as a const, sync + async variants behind one helper that builds the override list. Each test module now does a plain `use crate::testing::with_ci_env;`. Net `-71 / +51`. No behavior change; the existing 49 `mergify-ci` tests still pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Change-Id: Icd8c84417ad51b242cc8d9664d1cd40fff744497
Two unrelated polish items grouped because each is too small for
its own commit:
1. Module docs across `mergify-core`, `mergify-config`,
`mergify-queue`, `mergify-cli`, and `mergify-py-shim` were
pinned to the phase numbering the port plan used during
bootstrapping ("Phase 1.2 populates…", "Phase 1.7 ports…",
"Phase 6 deletes…"). Those references no longer aid the reader
and contradict the project rule about not embedding phase
numbers in long-lived artifacts — rewrite each docstring to
describe the module's *current* shape and let `git log`
reconstruct the trajectory if anyone needs it.
2. `freeze/list.rs::write_row` still had an `if theme.enabled { …
theme.fg(c) } else { Style::new() }` branch around the Status
cell — the same redundant indirection the earlier dedup pass
removed elsewhere. `Theme::fg` already collapses to
`Style::new()` when colors are disabled, so the outer branch
is pure noise. Drop it.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I477e098578452de9e955119241ce7b92c0641b22
`queue show` and `queue status` both map an enum-ish state code to
an "(icon, ANSI style)" pair, but spelled the pairing two different
ways: `show.rs::check_state_glyph` returned `(&'static str, Style)`,
while `status.rs` split it into separate `status_icon` /
`batch_status_style` functions. Same shape, different names, drifting
naturally as new states land.
Add a small `StyledGlyph` struct to `mergify-tui` and route both
callers through it. `status.rs::status_icon` + `batch_status_style`
collapse into a single `batch_glyph(theme, code) -> StyledGlyph`;
the early-return for the disabled-theme case is preserved (the
`merged → green.dimmed()` composition would otherwise emit a dim
escape when colors are off).
The third candidate — `freeze/list.rs`'s active/scheduled coloring
— stays inline: it has no icon, just a two-arm color pick, and
forcing a `StyledGlyph::new("", color)` would add more noise than
it removes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I8ed9bb5fffd46ecf75ff833df85b2ddf9812a4d8
bf480c8 to
c05040f
Compare
JulianMaurin
approved these changes
May 28, 2026
sileht
approved these changes
May 28, 2026
Contributor
Merge Queue Status
This pull request spent 16 minutes 51 seconds in the queue, including 16 minutes 15 seconds running CI. Required conditions to merge
|
38 tasks
Base automatically changed from
devs/jd/worktree-rust-port/drop-stale-phase-x-y-doc-markers-one-inline-color--477e0985
to
main
May 28, 2026 08:52
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.
queue showandqueue statusboth map an enum-ish state code toan "(icon, ANSI style)" pair, but spelled the pairing two different
ways:
show.rs::check_state_glyphreturned(&'static str, Style),while
status.rssplit it into separatestatus_icon/batch_status_stylefunctions. Same shape, different names, driftingnaturally as new states land.
Add a small
StyledGlyphstruct tomergify-tuiand route bothcallers through it.
status.rs::status_icon+batch_status_stylecollapse into a single
batch_glyph(theme, code) -> StyledGlyph;the early-return for the disabled-theme case is preserved (the
merged → green.dimmed()composition would otherwise emit a dimescape when colors are off).
The third candidate —
freeze/list.rs's active/scheduled coloring— stays inline: it has no icon, just a two-arm color pick, and
forcing a
StyledGlyph::new("", color)would add more noise thanit removes.
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Depends-On: #1443