Skip to content

Commit

Permalink
improved layout for sample info
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Nov 23, 2024
1 parent 60036cd commit 81f774d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/inspect_ai/_display/textual/widgets/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ def sample_for_highlighted(self, highlighted: int) -> ActiveSample | None:


class SampleInfo(Horizontal):
DEFAULT_CSS = f"""
SampleInfo {{
DEFAULT_CSS = """
SampleInfo {
color: $text-muted;
layout: grid;
grid-size: 2 1;
grid-columns: 1fr {MAX_MODEL_NAME_WIDTH+1};
grid-columns: 1fr auto;
width: 100%;
}}
#sample-info-model {{
}
#sample-info-model {
text-align: right;
}}
}
"""

def compose(self) -> ComposeResult:
Expand All @@ -175,8 +175,7 @@ async def sync_sample(self, sample: ActiveSample | None) -> None:
)
info_id.update(id)
model = Text.from_markup(sample.model)
model.truncate(MAX_MODEL_NAME_WIDTH, overflow="ellipsis")
info_model.update(sample.model)
info_model.update(model)
else:
self.display = False

Expand Down

0 comments on commit 81f774d

Please sign in to comment.