Skip to content

Fix vertical centering of file tree icons and use entryIcon for submodules/symlinks #34137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1181,3 +1181,14 @@ the "!important" is necessary to override Fomantic UI menu item styles, meanwhil
flex-grow: 1;
justify-content: space-between;
}

.svg.octicon-file-directory-fill,
.svg.octicon-file-submodule {
color: var(--color-primary);
}

.svg.octicon-file,
.svg.octicon-file-symlink-file,
.svg.octicon-file-directory-symlink {
color: var(--color-secondary-dark-7);
}
11 changes: 0 additions & 11 deletions web_src/css/repo/home-file-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@
}
}

#repo-files-table .svg.octicon-file-directory-fill,
#repo-files-table .svg.octicon-file-submodule {
color: var(--color-primary);
}

#repo-files-table .svg.octicon-file,
#repo-files-table .svg.octicon-file-symlink-file,
#repo-files-table .svg.octicon-file-directory-symlink {
color: var(--color-secondary-dark-7);
}

#repo-files-table .repo-file-item {
display: contents;
}
Expand Down
14 changes: 10 additions & 4 deletions web_src/js/components/ViewFileTreeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ const doGotoSubModule = () => {
>
<!-- submodule -->
<div class="item-content">
<SvgIcon class="text primary" name="octicon-file-submodule"/>
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="contents" v-html="item.entryIcon"/>
<span class="gt-ellipsis tw-flex-1">{{ item.entryName }}</span>
</div>
</div>
Expand All @@ -70,7 +71,8 @@ const doGotoSubModule = () => {
>
<!-- symlink -->
<div class="item-content">
<SvgIcon name="octicon-file-symlink-file"/>
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="contents" v-html="item.entryIcon"/>
<span class="gt-ellipsis tw-flex-1">{{ item.entryName }}</span>
</div>
</div>
Expand All @@ -83,7 +85,7 @@ const doGotoSubModule = () => {
<!-- file -->
<div class="item-content">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="item.entryIcon"/>
<span class="contents" v-html="item.entryIcon"/>
<span class="gt-ellipsis tw-flex-1">{{ item.entryName }}</span>
</div>
</div>
Expand All @@ -101,7 +103,7 @@ const doGotoSubModule = () => {
</div>
<div class="item-content">
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="text primary" v-html="(!collapsed && item.entryIconOpen) ? item.entryIconOpen : item.entryIcon"/>
<span class="contents" v-html="(!collapsed && item.entryIconOpen) ? item.entryIconOpen : item.entryIcon"/>
<span class="gt-ellipsis">{{ item.entryName }}</span>
</div>
</div>
Expand Down Expand Up @@ -158,4 +160,8 @@ const doGotoSubModule = () => {
text-overflow: ellipsis;
min-width: 0;
}

.item-content .contents {
display: contents;
}
</style>