From 4f3c56f6d8f746acb3d65cafd0e90c3754bba98a Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 23 Jan 2025 01:11:04 +0100 Subject: [PATCH 1/4] Clone button tweaks --- web_src/css/modules/tippy.css | 4 ++++ web_src/css/repo/clone.css | 2 +- web_src/js/features/repo-common.ts | 2 ++ web_src/js/modules/tippy.ts | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web_src/css/modules/tippy.css b/web_src/css/modules/tippy.css index 55b9751cc635a..4438a31c9d53b 100644 --- a/web_src/css/modules/tippy.css +++ b/web_src/css/modules/tippy.css @@ -28,6 +28,10 @@ z-index: 1; } +.tippy-box[data-theme="default"] { + box-shadow: 0 6px 18px var(--color-shadow); +} + /* bare theme, no styling at all, except box-shadow */ .tippy-box[data-theme="bare"] { border: none; diff --git a/web_src/css/repo/clone.css b/web_src/css/repo/clone.css index 3f6a1323fea26..4466bd225616f 100644 --- a/web_src/css/repo/clone.css +++ b/web_src/css/repo/clone.css @@ -23,7 +23,7 @@ } .clone-panel-tab .item.active { - border-bottom: 3px solid var(--color-secondary); + border-bottom: 3px solid var(--color-text); } .clone-panel-tab + .divider { diff --git a/web_src/js/features/repo-common.ts b/web_src/js/features/repo-common.ts index fb76d8ed36483..cf89845992781 100644 --- a/web_src/js/features/repo-common.ts +++ b/web_src/js/features/repo-common.ts @@ -99,6 +99,8 @@ function initClonePanelButton(btn: HTMLButtonElement) { placement: 'bottom-end', interactive: true, hideOnClick: true, + arrow: false, + offset: [0, 6], }); } diff --git a/web_src/js/modules/tippy.ts b/web_src/js/modules/tippy.ts index bc6d5bfdd6cf3..7c796079a5200 100644 --- a/web_src/js/modules/tippy.ts +++ b/web_src/js/modules/tippy.ts @@ -42,7 +42,7 @@ export function createTippy(target: Element, opts: TippyOpts = {}): Instance { visibleInstances.add(instance); return onShow?.(instance); }, - arrow: arrow || (theme === 'bare' ? false : arrowSvg), + arrow: arrow ?? (theme === 'bare' ? false : arrowSvg), // HTML role attribute, ideally the default role would be "popover" but it does not exist role: role || 'menu', // CSS theme, either "default", "tooltip", "menu", "box-with-header" or "bare" From cb12635d8247e7dd26725354a16dcaa85677e390 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 23 Jan 2025 01:20:17 +0100 Subject: [PATCH 2/4] tweaks --- web_src/css/repo/clone.css | 4 +++- web_src/js/modules/tippy.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web_src/css/repo/clone.css b/web_src/css/repo/clone.css index 4466bd225616f..c6887fbf161c4 100644 --- a/web_src/css/repo/clone.css +++ b/web_src/css/repo/clone.css @@ -20,10 +20,12 @@ .clone-panel-tab .item { padding: 5px 10px; background: none; + color: var(--color-text-light-2); } .clone-panel-tab .item.active { - border-bottom: 3px solid var(--color-text); + color: var(--color-text-dark); + border-bottom: 3px solid currentcolor; } .clone-panel-tab + .divider { diff --git a/web_src/js/modules/tippy.ts b/web_src/js/modules/tippy.ts index 7c796079a5200..5c10859526590 100644 --- a/web_src/js/modules/tippy.ts +++ b/web_src/js/modules/tippy.ts @@ -51,7 +51,7 @@ export function createTippy(target: Element, opts: TippyOpts = {}): Instance { ...other, } satisfies Partial); - if (role === 'menu') { + if (instance.props.role === 'menu') { target.setAttribute('aria-haspopup', 'true'); } From 400eff30ab65a07e18d6ab452e33496faec570e5 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 26 Jan 2025 14:46:19 +0100 Subject: [PATCH 3/4] set offset in createTippy --- web_src/js/features/repo-common.ts | 1 - web_src/js/modules/tippy.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/repo-common.ts b/web_src/js/features/repo-common.ts index cf89845992781..2f62d51597c44 100644 --- a/web_src/js/features/repo-common.ts +++ b/web_src/js/features/repo-common.ts @@ -100,7 +100,6 @@ function initClonePanelButton(btn: HTMLButtonElement) { interactive: true, hideOnClick: true, arrow: false, - offset: [0, 6], }); } diff --git a/web_src/js/modules/tippy.ts b/web_src/js/modules/tippy.ts index 5c10859526590..af715f48b9e36 100644 --- a/web_src/js/modules/tippy.ts +++ b/web_src/js/modules/tippy.ts @@ -47,6 +47,7 @@ export function createTippy(target: Element, opts: TippyOpts = {}): Instance { role: role || 'menu', // CSS theme, either "default", "tooltip", "menu", "box-with-header" or "bare" theme: theme || role || 'default', + offset: [0, arrow ? 10 : 6], plugins: [followCursor], ...other, } satisfies Partial); From 8a04e50a87407b2f175bd8ec2bfad894321aa1e4 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 27 Jan 2025 00:31:57 +0800 Subject: [PATCH 4/4] fix wrap for narrow screen --- web_src/css/repo.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index c40b175638a3f..2752174f8639d 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1630,7 +1630,7 @@ td .commit-summary { } .repo-button-row-left { - flex: 1; + flex-grow: 1; } .repo-button-row .button {