Skip to content

Commit d0060b3

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: replace source._outcome cross-class access with public outcome property
`_FullscreenPeek._build_header` was reading `source._outcome` directly on a `_LivePanelBase` instance, crossing class boundaries into a private attribute. Expose an `outcome` property on `_LivePanelBase` (matching the `iteration_id` property added in ef9a178 for the parallel case) so the fullscreen header reads the value through a public API. Same observable behavior; the attribute is still the single source of truth inside `freeze`. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 9cc0588 commit d0060b3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

β€Žsrc/ralphify/_console_emitter.pyβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ def freeze(self, outcome: str) -> None:
353353
self._end = time.monotonic()
354354
self._outcome = outcome
355355

356+
@property
357+
def outcome(self) -> str | None:
358+
"""The frozen-iteration outcome label, or ``None`` while live."""
359+
return self._outcome
360+
356361
# ── Scroll buffer management ─────────────────────────────────────
357362

358363
def add_scroll_line(self, markup: str) -> None:
@@ -830,7 +835,7 @@ def _build_header(self, total: int, visible: int) -> Text:
830835
header.append("live", style=f"italic {_brand.GREEN}")
831836
else:
832837
source = self._source
833-
outcome = source._outcome if source is not None else None
838+
outcome = source.outcome if source is not None else None
834839
if outcome:
835840
header.append(" Β· ", style="dim")
836841
header.append(outcome, style=f"italic {_brand.LAVENDER}")

0 commit comments

Comments
Β (0)