diff --git a/crates/forge-web/src/views/mod.rs b/crates/forge-web/src/views/mod.rs index b113763..c7970ce 100644 --- a/crates/forge-web/src/views/mod.rs +++ b/crates/forge-web/src/views/mod.rs @@ -1254,9 +1254,15 @@ async fn ref_panel( for (n, link) in links.into_iter().enumerate() { } @@ -1281,11 +1287,18 @@ pub async fn ref_selector( branches_href: String, tags_href: String, ) -> Result { + // A tag shows a tag icon only when it is the current ref and no branch of that name is. + let is_tag = !branches.iter().any(|b| b.current) && tags.iter().any(|t| t.current); Ok(view! {
- - (label) - (current.as_str()) + + if is_tag { + + } else { + + } + (current.as_str()) +
diff --git a/style/main.scss b/style/main.scss index 5fb0552..3f19630 100644 --- a/style/main.scss +++ b/style/main.scss @@ -1137,6 +1137,30 @@ code { code { background: none; padding: 0; + min-width: 0; + max-width: 220px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + // Inline SVG icons: the trigger's branch or tag and caret, and the checkmark in the list. + svg { + flex: none; + width: 16px; + height: 16px; + fill: none; + stroke: currentColor; + stroke-width: 1.8; + stroke-linecap: round; + stroke-linejoin: round; + } + + .ref-icon, + .ref-caret { + display: inline-flex; + flex: none; + color: var(--muted); } } @@ -1157,8 +1181,9 @@ code { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); } +// The tabs row is the bottom edge of the top block: its underline sits on the divider. .ref-top { - padding: 8px; + padding: 8px 8px 0; border-bottom: 1px solid var(--border); } @@ -1182,32 +1207,38 @@ code { } } +// Underline tabs: the 2px underline overlaps the 1px divider of .ref-top. .ref-tabs { display: flex; - gap: 4px; - margin-top: 8px; + gap: 16px; + margin: 8px 0 -1px; button { - flex: 1 1 0; + flex: 0 0 auto; min-height: 32px; - padding: 0 10px; + padding: 0 2px; font: inherit; font-size: 13px; color: var(--muted); - background: none; + background: transparent; border: 0; - border-radius: var(--radius-md); + border-bottom: 2px solid transparent; + border-radius: 0; cursor: pointer; + &:hover { + color: var(--text); + } + &[aria-selected="true"] { color: var(--text); - background: var(--accent-soft); font-weight: 600; + border-bottom-color: var(--accent); } &:focus-visible { outline: 2px solid var(--focus); - outline-offset: 1px; + outline-offset: -2px; box-shadow: none; } } @@ -1229,9 +1260,16 @@ code { padding: 8px 14px; font-size: 13px; color: var(--text-2); + text-decoration: none; border-top: 1px solid var(--border); + + &:hover { + color: var(--text); + background: var(--surface-2); + } } +// Rows: a fixed 16px gutter holds the checkmark on the current ref, so names line up. .ref-list { list-style: none; margin: 0; @@ -1239,20 +1277,33 @@ code { li[aria-selected="true"] a, a:hover { - background: var(--accent-soft); + background: var(--surface-2); } a { - display: block; + display: flex; + align-items: center; + gap: 8px; padding: 6px 14px; color: var(--text); - word-break: break-all; + text-decoration: none; &.current { - color: var(--accent); font-weight: 600; } } + + .ref-check { + display: inline-flex; + flex: none; + width: 16px; + height: 16px; + } + + .ref-text { + min-width: 0; + word-break: break-all; + } } .crumbs { @@ -1990,7 +2041,7 @@ code { } .ref-top { - padding: 8px 16px; + padding: 8px 16px 0; } .ref-note {