Remove dim styling from hook details in the TUI (#64391)

Use the default text style for single-line and wrapped values in the
hooks browser detail pane.

## Testing

Extend the wrapped hook command test to check that every detail span
uses the default style while still checking the full hyperlink destination.

GitOrigin-RevId: 77041a3bd95ad1f9fa71aa38857208c59ba44f9b
This commit is contained in:
Eric Traut
2026-11-27 22:43:21 +00:00
committed by copyberry
parent 5729aca45d
commit 7d8506410c
2 changed files with 8 additions and 3 deletions
@@ -168,7 +168,7 @@ impl Renderable for HooksBrowserView {
pub(super) fn detail_line(label: &str, value: &str) -> crate::terminal_hyperlinks::HyperlinkLine {
crate::terminal_hyperlinks::annotate_web_urls_in_line(Line::from(vec![
format!("{label:<10}").into(),
value.to_string().dim(),
value.to_string().into(),
]))
}
@@ -185,7 +185,7 @@ pub(super) fn detail_wrapped_lines(
.split('\n')
.flat_map(|text| {
let source =
crate::terminal_hyperlinks::annotate_web_urls_in_line(text.to_owned().dim().into());
crate::terminal_hyperlinks::annotate_web_urls_in_line(text.to_owned().into());
let wrapped = crate::wrapping::wrap_ranges_trim(text, available)
.into_iter()
.map(|range| {
@@ -196,7 +196,7 @@ pub(super) fn detail_wrapped_lines(
" ".repeat(label_width)
};
crate::wrapping::WrappedLine {
line: vec![prefix.into(), text[range.clone()].to_owned().dim()].into(),
line: vec![prefix.into(), text[range.clone()].to_owned().into()].into(),
range,
prefix_bytes: label_width,
}
@@ -75,6 +75,11 @@ fn wrapped_hook_command_preserves_the_complete_url_destination() {
AppEventSender::new(tx_raw),
);
view.handle_key_event(KeyEvent::from(KeyCode::Enter));
for detail in view.detail_lines(HookEventName::PreToolUse, /*width*/ 40) {
for span in detail.line.spans {
assert_eq!(span.style, Style::default(), "{}", span.content);
}
}
let buf = render_buffer(&view, /*width*/ 44);
let linked = buf
.content