1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Tweak repo sidebar (#32847)

Before and after:

<img width="218" alt="Screenshot 2024-12-15 at 04 53 53"
src="https://github.com/user-attachments/assets/299b1f0a-ba72-47c6-b662-a9d540d4d741"
/>
<img width="222" alt="Screenshot 2024-12-15 at 04 53 41"
src="https://github.com/user-attachments/assets/5a2b5332-e324-4d20-82e9-21d1c850e826"
/>

Diff without whitespace:
https://github.com/go-gitea/gitea/pull/32847/files?diff=unified&w=1

The `tw-mt-2` is fine even if the element renders empty:

<img width="387" alt="image"
src="https://github.com/user-attachments/assets/76a976e4-ba2e-48a5-9248-c361552a937a"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2024-12-15 11:01:46 +01:00
committed by GitHub
parent 9264811217
commit df9a78cd04
9 changed files with 141 additions and 131 deletions

View File

@@ -101,11 +101,6 @@
margin-bottom: 12px;
}
.repository .repo-description {
font-size: 16px;
margin-bottom: 5px;
}
.commit-summary {
flex: 1;
overflow-wrap: anywhere;

View File

@@ -4,22 +4,24 @@
grid-template-rows: auto auto 1fr;
}
.repo-grid-filelist-sidebar .repo-home-filelist {
.repo-home-filelist {
min-width: 0;
grid-column: 1;
grid-row: 1 / 4;
}
.repo-grid-filelist-sidebar .repo-home-sidebar-top {
.repo-home-sidebar-top {
grid-column: 2;
grid-row: 1;
padding-left: 1em;
}
.repo-grid-filelist-sidebar .repo-home-sidebar-bottom {
.repo-home-sidebar-bottom {
grid-column: 2;
grid-row: 2;
padding-left: 1em;
}
.repo-home-sidebar-bottom .flex-list > :first-child {
border-top: 1px solid var(--color-secondary); /* same to .flex-list > .flex-item + .flex-item */
}
@@ -29,16 +31,16 @@
grid-template-columns: 100%;
grid-template-rows: auto auto auto;
}
.repo-grid-filelist-sidebar .repo-home-filelist {
.repo-home-filelist {
grid-column: 1;
grid-row: 2;
}
.repo-grid-filelist-sidebar .repo-home-sidebar-top {
.repo-home-sidebar-top {
grid-column: 1;
grid-row: 1;
padding-left: 0;
}
.repo-grid-filelist-sidebar .repo-home-sidebar-bottom {
.repo-home-sidebar-bottom {
grid-column: 1;
grid-row: 3;
padding-left: 0;

View File

@@ -16,7 +16,7 @@ export function initRepoTopicBar() {
let lastErrorToast: Toast;
mgrBtn.addEventListener('click', () => {
hideElem(viewDiv);
hideElem([viewDiv, mgrBtn]);
showElem(editDiv);
topicDropdown.querySelector<HTMLInputElement>('input.search').focus();
});
@@ -24,7 +24,7 @@ export function initRepoTopicBar() {
document.querySelector('#cancel_topic_edit').addEventListener('click', () => {
lastErrorToast?.hideToast();
hideElem(editDiv);
showElem(viewDiv);
showElem([viewDiv, mgrBtn]);
mgrBtn.focus();
});
@@ -55,7 +55,7 @@ export function initRepoTopicBar() {
}
}
hideElem(editDiv);
showElem(viewDiv);
showElem([viewDiv, mgrBtn]);
}
} else if (response.status === 422) {
// how to test: input topic like " invalid topic " (with spaces), and select it from the list, then "Save"