From c8bdbe06dca2cc22945403dc5c0e462a124816ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 23 Oct 2026 16:08:37 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20new=20repository=20togg?= =?UTF-8?q?le=20names=20the=20chosen=20visibility=20and=20fields=20line=20?= =?UTF-8?q?up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The selected visibility segment opens its word beside the icon, with a CSS transition that respects reduced motion. The Imports tab sits with the other tabs, the default branch field is as wide as the other fields, and the default labels checkbox aligns with its first line. --- crates/forge-web/src/pages/import.rs | 2 +- style/_import.scss | 4 -- style/_repo.scss | 69 +++++++++++++++++++++++++--- 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/crates/forge-web/src/pages/import.rs b/crates/forge-web/src/pages/import.rs index 0b01a40..df0c443 100644 --- a/crates/forge-web/src/pages/import.rs +++ b/crates/forge-web/src/pages/import.rs @@ -161,7 +161,7 @@ pub(crate) async fn newrepo_tabs(lang: Lang, active: &str) -> Result }) } diff --git a/style/_import.scss b/style/_import.scss index b7ec330..3cb97a5 100644 --- a/style/_import.scss +++ b/style/_import.scss @@ -28,10 +28,6 @@ color: var(--accent-ink); border-bottom-color: var(--accent); } - - &.import-tab-end { - margin-left: auto; - } } .import-sources { diff --git a/style/_repo.scss b/style/_repo.scss index a971715..a39f84c 100644 --- a/style/_repo.scss +++ b/style/_repo.scss @@ -593,8 +593,65 @@ height: var(--control-h); } - .segment > span { + // A drawer: the selected segment is the pill and opens its word beside the icon. The other + // segment stays icon only. The highlight sits on the segment, so the icon is inside it. The + // selectors repeat .segmented to outrank the shared pill rules in main.scss. + .segmented .segment { height: calc(var(--control-h) - 6px); + padding: 0 9px; + border-radius: var(--radius-full); + transition: background-color 0.2s ease, box-shadow 0.2s ease; + + > svg { + position: static; + flex: none; + transform: none; + } + + > span { + display: inline-flex; + align-items: center; + box-sizing: border-box; + width: auto; + max-width: 0; + height: calc(var(--control-h) - 6px); + padding: 0; + overflow: hidden; + font-size: 0.8125rem; + line-height: 1; + opacity: 0; + transition: max-width 0.25s ease, padding 0.25s ease, opacity 0.2s ease; + } + + input[type="radio"]:checked ~ span { + background: none; + box-shadow: none; + } + + &:has(input[type="radio"]:checked) { + background: var(--surface); + color: var(--accent-ink); + box-shadow: 0 1px 2px rgba(30, 36, 32, .12); + } + + &:has(input[type="radio"]:focus-visible) { + box-shadow: 0 0 0 2px var(--focus); + } + + // The word opens only for the chosen segment, so the other one stays a plain icon. + &:has(input[type="radio"]:checked) > span { + max-width: 8em; + padding: 0 10px 0 6px; + opacity: 1; + color: var(--accent-ink); + } + } + + @media (prefers-reduced-motion: reduce) { + .segmented .segment, + .segmented .segment > span { + transition: none; + } } } @@ -647,16 +704,16 @@ color: var(--muted); } +// Stacked like the other fields, so the branch input is as wide as the name and description. .newrepo-options { + flex-direction: column; + align-items: stretch; + .newrepo-branch { - flex: 0 1 240px; min-width: 0; } .newrepo-labels { - align-self: flex-end; - align-items: center; - min-height: var(--control-h); margin: 0; } } @@ -731,7 +788,7 @@ } @media (max-width: 480px) { - // Below 480px the visibility switch shows icons only, so Create fits beside it. + // Below 480px the visibility pill and Create share one row, spread to the edges. .newrepo-head-actions { justify-content: space-between; margin-left: 0;