mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-27 07:14:44 +00:00
2bcf950b78
Adds a search box and a file-extension filter to the pull request diff sidebar, so reviewers can narrow a large diff down to the files they care about. Both filters apply to the file tree and to the diff itself. The extension menu follows GitHub: extensions sorted alphabetically, dotfiles and extension-less files in their own buckets, and the selection kept in the same `file-filters[]` query parameter, so a filtered view is shareable and survives a reload. The menu can list every extension in a diff, so `createTippy` gains an opt-in `limitSizeToViewport` option that caps a popup to the space left in the viewport and scrolls its content. Popups that do not ask for it are unchanged. Closes https://github.com/go-gitea/gitea/issues/27256 Signed-off-by: silverwind <me@silverwind.io> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Nicolas <bircni@icloud.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
196 lines
4.2 KiB
CSS
196 lines
4.2 KiB
CSS
/* styles are based on node_modules/tippy.js/dist/tippy.css */
|
|
|
|
/* class to hide tippy target elements on page load */
|
|
.tippy-target {
|
|
display: none !important;
|
|
}
|
|
|
|
/* show target element once it's been moved by tippy.js */
|
|
.tippy-content .tippy-target {
|
|
display: unset !important;
|
|
}
|
|
|
|
[data-tippy-root] {
|
|
max-width: calc(100vw - 32px);
|
|
}
|
|
|
|
/* opt-in via createTippy's "limitSizeToViewport" */
|
|
[data-tippy-limit-size] .tippy-box {
|
|
display: flex;
|
|
flex-direction: column;
|
|
max-width: var(--tippy-max-width, none);
|
|
max-height: var(--tippy-max-height, none);
|
|
}
|
|
|
|
[data-tippy-limit-size] .tippy-content {
|
|
overflow: auto;
|
|
}
|
|
|
|
.tippy-box {
|
|
position: relative;
|
|
background-color: var(--color-menu);
|
|
color: var(--color-text);
|
|
border: 1px solid var(--color-secondary);
|
|
border-radius: var(--border-radius);
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.tippy-content {
|
|
position: relative;
|
|
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;
|
|
box-shadow: 0 6px 18px var(--color-shadow);
|
|
}
|
|
|
|
.tippy-box[data-theme="bare"] .tippy-content {
|
|
padding: 0;
|
|
background: transparent;
|
|
}
|
|
|
|
/* tooltip theme for text tooltips */
|
|
|
|
.tippy-box[data-theme="tooltip"] {
|
|
background-color: var(--color-tooltip-bg);
|
|
color: var(--color-tooltip-text);
|
|
border: none;
|
|
}
|
|
|
|
.tippy-box[data-theme="tooltip"] .tippy-content {
|
|
padding: 5px 10px;
|
|
}
|
|
|
|
.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-inner,
|
|
.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-outer {
|
|
fill: var(--color-tooltip-bg);
|
|
}
|
|
|
|
/* menu theme for .ui.menu */
|
|
|
|
.tippy-box[data-theme="menu"] {
|
|
background-color: var(--color-menu);
|
|
color: var(--color-text);
|
|
box-shadow: 0 6px 18px var(--color-shadow);
|
|
}
|
|
|
|
.tippy-box[data-theme="menu"] .tippy-content {
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.tippy-box[data-theme="menu"] .tippy-svg-arrow-inner {
|
|
fill: var(--color-menu);
|
|
}
|
|
|
|
.tippy-box[data-theme="menu"] .item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 9px 18px;
|
|
color: inherit;
|
|
background: inherit;
|
|
text-decoration: none;
|
|
gap: 10px;
|
|
width: 100%;
|
|
}
|
|
|
|
.tippy-box[data-theme="menu"] .item:hover {
|
|
background: var(--color-hover);
|
|
}
|
|
|
|
.tippy-box[data-theme="menu"] .item:focus-visible {
|
|
background: var(--color-hover);
|
|
}
|
|
|
|
.tippy-box[data-theme="menu"] .item.active {
|
|
background: var(--color-active);
|
|
}
|
|
|
|
.tippy-box[data-theme="menu"] .divider {
|
|
margin: 4px 0; /* fit the menu's vertical padding */
|
|
}
|
|
|
|
/* box-with-header theme to look like .ui.attached.segment. can contain .ui.attached.header */
|
|
|
|
.tippy-box[data-theme="box-with-header"] {
|
|
box-shadow: 0 6px 18px var(--color-shadow);
|
|
}
|
|
|
|
.tippy-box[data-theme="box-with-header"] .tippy-content {
|
|
background: var(--color-box-body);
|
|
border-radius: var(--border-radius);
|
|
padding: 0;
|
|
}
|
|
|
|
.tippy-box[data-theme="box-with-header"][data-placement^="top"] .tippy-svg-arrow-inner {
|
|
fill: var(--color-box-body);
|
|
}
|
|
|
|
.tippy-box[data-theme="box-with-header"][data-placement^="bottom"] .tippy-svg-arrow-inner {
|
|
fill: var(--color-box-header);
|
|
}
|
|
|
|
.tippy-box[data-placement^="top"] > .tippy-svg-arrow {
|
|
bottom: 0;
|
|
}
|
|
|
|
.tippy-box[data-placement^="top"] > .tippy-svg-arrow::after,
|
|
.tippy-box[data-placement^="top"] > .tippy-svg-arrow > svg {
|
|
top: 16px;
|
|
transform: rotate(180deg);
|
|
}
|
|
|
|
.tippy-box[data-placement^="bottom"] > .tippy-svg-arrow {
|
|
top: 0;
|
|
}
|
|
|
|
.tippy-box[data-placement^="bottom"] > .tippy-svg-arrow > svg {
|
|
bottom: 16px;
|
|
}
|
|
|
|
.tippy-box[data-placement^="left"] > .tippy-svg-arrow {
|
|
right: 0;
|
|
}
|
|
|
|
.tippy-box[data-placement^="left"] > .tippy-svg-arrow::after,
|
|
.tippy-box[data-placement^="left"] > .tippy-svg-arrow > svg {
|
|
transform: rotate(90deg);
|
|
top: calc(50% - 3px);
|
|
left: 11px;
|
|
}
|
|
|
|
.tippy-box[data-placement^="right"] > .tippy-svg-arrow {
|
|
left: 0;
|
|
}
|
|
|
|
.tippy-box[data-placement^="right"] > .tippy-svg-arrow::after,
|
|
.tippy-box[data-placement^="right"] > .tippy-svg-arrow > svg {
|
|
transform: rotate(-90deg);
|
|
top: calc(50% - 3px);
|
|
right: 11px;
|
|
}
|
|
|
|
.tippy-svg-arrow {
|
|
width: 16px;
|
|
height: 16px;
|
|
text-align: initial;
|
|
}
|
|
|
|
.tippy-svg-arrow,
|
|
.tippy-svg-arrow > svg {
|
|
position: absolute;
|
|
}
|
|
|
|
.tippy-svg-arrow-outer {
|
|
fill: var(--color-secondary);
|
|
}
|
|
|
|
.tippy-svg-arrow-inner {
|
|
fill: var(--color-menu);
|
|
}
|