Skip to content

Commit 24d3546

Browse files
committed
refactor(ui): Restructure banner counts and drop quota gauge brackets
Banner right-of-logo now reads: - line 1: "<N> models" - line 2: "<M> MCP servers · <S> skills" - line 3: "Type /help for more information" Drops the brand/version line and the active-model display from the banner (the bottom bar already surfaces the active model). Splits the single counts line into two so the model count gets top billing. Also drops the surrounding [...] from the bottom-bar quota gauge so it reads "rpm 0/50 tpm 0/128k ..." flat. e2e wait_for_main_screen keys off "/help" since "Model: " is gone. Snapshots regenerated.
1 parent 9d19b45 commit 24d3546

26 files changed

Lines changed: 84 additions & 90 deletions

File tree

‎albert_code/cli/textual_ui/app.tcss‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -963,15 +963,6 @@ QuotaDisplay.quota-danger {
963963
width: auto;
964964
}
965965

966-
#banner-model {
967-
color: ansi_cyan;
968-
width: auto;
969-
}
970-
971-
#banner-meta-counts {
972-
width: auto;
973-
}
974-
975966
.banner-cmd {
976967
color: ansi_cyan;
977968
width: auto;

‎albert_code/cli/textual_ui/widgets/banner/banner.py‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
@dataclass
1818
class BannerState:
19-
active_model: str = ""
2019
models_count: int = 0
2120
mcp_servers_count: int = 0
2221
skills_count: int = 0
@@ -31,7 +30,6 @@ def __init__(
3130
super().__init__(**kwargs)
3231
self.can_focus = False
3332
self._initial_state = BannerState(
34-
active_model=config.active_model,
3533
models_count=len(config.models),
3634
mcp_servers_count=len(config.mcp_servers),
3735
skills_count=len(skill_manager.available_skills),
@@ -44,10 +42,9 @@ def compose(self) -> ComposeResult:
4442

4543
with Vertical(id="banner-info"):
4644
with Horizontal(classes="banner-line"):
47-
yield NoMarkupStatic("Model: ", classes="banner-meta")
48-
yield NoMarkupStatic("", id="banner-model")
45+
yield NoMarkupStatic("", id="banner-models-count")
4946
with Horizontal(classes="banner-line"):
50-
yield NoMarkupStatic("", id="banner-meta-counts")
47+
yield NoMarkupStatic("", id="banner-extras-count")
5148
with Horizontal(classes="banner-line"):
5249
yield NoMarkupStatic("Type ", classes="banner-meta")
5350
yield NoMarkupStatic("/help", classes="banner-cmd")
@@ -57,9 +54,11 @@ def on_mount(self) -> None:
5754
self.state = self._initial_state
5855

5956
def watch_state(self) -> None:
60-
self.query_one("#banner-model", NoMarkupStatic).update(self.state.active_model)
61-
self.query_one("#banner-meta-counts", NoMarkupStatic).update(
62-
self._format_meta_counts()
57+
self.query_one("#banner-models-count", NoMarkupStatic).update(
58+
self._format_models_count()
59+
)
60+
self.query_one("#banner-extras-count", NoMarkupStatic).update(
61+
self._format_extras_count()
6362
)
6463

6564
def freeze_animation(self) -> None:
@@ -68,15 +67,19 @@ def freeze_animation(self) -> None:
6867

6968
def set_state(self, config: VibeConfig, skill_manager: SkillManager) -> None:
7069
self.state = BannerState(
71-
active_model=config.active_model,
7270
models_count=len(config.models),
7371
mcp_servers_count=len(config.mcp_servers),
7472
skills_count=len(skill_manager.available_skills),
7573
)
7674

77-
def _format_meta_counts(self) -> str:
75+
def _format_models_count(self) -> str:
76+
n = self.state.models_count
77+
return f"{n} model{'s' if n != 1 else ''}"
78+
79+
def _format_extras_count(self) -> str:
80+
m = self.state.mcp_servers_count
81+
s = self.state.skills_count
7882
return (
79-
f"{self.state.models_count} model{'s' if self.state.models_count != 1 else ''}"
80-
f" · {self.state.mcp_servers_count} MCP server{'s' if self.state.mcp_servers_count != 1 else ''}"
81-
f" · {self.state.skills_count} skill{'s' if self.state.skills_count != 1 else ''}"
83+
f"{m} MCP server{'s' if m != 1 else ''}"
84+
f" · {s} skill{'s' if s != 1 else ''}"
8285
)

‎albert_code/cli/textual_ui/widgets/quota_display.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def update_from_snapshot(self, snap: UsageSnapshot | None) -> None:
7474
f"tpd {_compact_tokens(snap.tpd_used)}/{_compact_tokens(snap.tpd_limit)}"
7575
)
7676

77-
self.update("[" + " ".join(parts) + "]")
77+
self.update(" ".join(parts))
7878

7979
# Pick the strongest signal across all four counters to colour the
8080
# line: any one being close to its cap deserves attention.

‎tests/e2e/common.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def wait_for_request_count(
6161

6262

6363
def wait_for_main_screen(child: pexpect.spawn, timeout: float = 20.0) -> None:
64-
child.expect(ansi_tolerant_pattern("Model: "), timeout=timeout)
64+
child.expect(ansi_tolerant_pattern("/help"), timeout=timeout)
6565

6666

6767
def wait_for_rendered_text(

‎tests/snapshots/__snapshots__/test_ui_snapshot_ask_user_question/test_snapshot_ask_user_question_collapsed.svg‎

Lines changed: 3 additions & 3 deletions
Loading

‎tests/snapshots/__snapshots__/test_ui_snapshot_ask_user_question/test_snapshot_ask_user_question_expanded.svg‎

Lines changed: 3 additions & 3 deletions
Loading

‎tests/snapshots/__snapshots__/test_ui_snapshot_basic_conversation/test_snapshot_shows_basic_conversation.svg‎

Lines changed: 3 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)