style(groups): align card footers and keep role badges intact

Give long names two lines, show the current role in its own non-wrapping row, and anchor every card footer to the grid-row bottom regardless of optional source metadata.
This commit is contained in:
翅膀 committed 2026-10-17 09:49:26 +08:00
1 parent 084acee7dd
commit 0b8c7c368d
2 files changed
+35 -12

No files matched your search

+31 -10
View File
@@ -200,18 +200,18 @@
:style="{ animationDelay: i * 35 + 'ms' }" :style="{ animationDelay: i * 35 + 'ms' }"
@click="enterGroup(g)" @click="enterGroup(g)"
> >
<div class="p-4 space-y-3"> <div class="flex flex-1 flex-col gap-3 p-4">
<div class="flex items-start justify-between gap-2.5"> <div class="flex items-start justify-between gap-2.5">
<div class="min-w-0 flex-1"> <div class="min-w-0 flex-1">
<div class="flex items-center gap-2"> <div
<span class="truncate text-[15px] font-semibold text-text">{{ class="line-clamp-2 text-[15px] leading-snug font-semibold text-text [overflow-wrap:anywhere]"
g.name || t("route.untitled") :title="g.name || t('route.untitled')"
}}</span> >
<RcBadge v-if="roleOf(g.id)" variant="brand" size="xs"> {{ g.name || t("route.untitled") }}
{{ t("role.badge", { role: t("roles." + roleOf(g.id)) }) }} </div>
</RcBadge> <div class="mt-0.5 font-mono text-[11px] text-faint truncate" :title="g.id">
{{ g.id }}
</div> </div>
<div class="mt-0.5 font-mono text-[11px] text-faint truncate">{{ g.id }}</div>
</div> </div>
<div <div
v-if="canEditGroup(g.id)" v-if="canEditGroup(g.id)"
@@ -232,6 +232,8 @@
color="error" color="error"
size="icon" size="icon"
class="h-7 w-7 text-muted hover:text-bad" class="h-7 w-7 text-muted hover:text-bad"
:title="t('groups.delete')"
:aria-label="t('groups.delete')"
@click="onDeleteGroup(g)" @click="onDeleteGroup(g)"
> >
<Trash2 :size="13.5" /> <Trash2 :size="13.5" />
@@ -240,6 +242,15 @@
</div> </div>
<div class="space-y-1.5 text-xs"> <div class="space-y-1.5 text-xs">
<div
v-if="roleOf(g.id)"
class="flex items-center justify-between text-[11.5px]"
>
<span class="text-faint font-semibold">{{ t("groups.myRole") }}</span>
<RcBadge variant="brand" size="xs" class="whitespace-nowrap">
{{ t("roles." + roleOf(g.id)) }}
</RcBadge>
</div>
<div class="flex items-center justify-between text-[11.5px]"> <div class="flex items-center justify-between text-[11.5px]">
<span class="text-faint font-semibold">{{ t("groups.members") }}</span> <span class="text-faint font-semibold">{{ t("groups.members") }}</span>
<span class="rounded bg-surface-2 px-1.5 py-0.5 font-mono text-text"> <span class="rounded bg-surface-2 px-1.5 py-0.5 font-mono text-text">
@@ -260,7 +271,7 @@
</div> </div>
<div <div
class="flex items-center justify-between pt-2 border-t border-border/70 text-xs" class="mt-auto flex items-center justify-between pt-2 border-t border-border/70 text-xs"
> >
<span class="text-faint text-[11px]">{{ t("overview.routes") }}</span> <span class="text-faint text-[11px]">{{ t("overview.routes") }}</span>
<span <span
@@ -1004,6 +1015,16 @@ async function onDeleteGroup(group: Group): Promise<void> {
.console-group-card { .console-group-card {
cursor: pointer; cursor: pointer;
} }
/* Cards stretch to their grid row; the footer sits at the bottom so the
dividers of one row line up whatever each card lists above them. */
.console-group-card,
.console-group-card > :deep(div) {
display: flex;
flex-direction: column;
}
.console-group-card > :deep(div) {
flex: 1 1 auto;
}
.console-open { .console-open {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
+4 -2
View File
@@ -84,7 +84,6 @@ const en: Dict = {
"role.owner": "Owner", "role.owner": "Owner",
"role.admin": "Admin", "role.admin": "Admin",
"role.viewer": "Viewer", "role.viewer": "Viewer",
"role.badge": "You: {role}",
"roles.owner": "Owner", "roles.owner": "Owner",
"roles.admin": "Admin", "roles.admin": "Admin",
"roles.viewer": "Viewer", "roles.viewer": "Viewer",
@@ -136,9 +135,11 @@ const en: Dict = {
"groups.admins": "ADMINS", "groups.admins": "ADMINS",
"groups.owners": "OWNERS", "groups.owners": "OWNERS",
"groups.members": "MEMBERS", "groups.members": "MEMBERS",
"groups.myRole": "MY ROLE",
"groups.any": "any", "groups.any": "any",
"groups.open": "Open", "groups.open": "Open",
"group.back": "Groups", "group.back": "Groups",
"groups.delete": "Delete group",
"group.routesIn": "Routes in {name}", "group.routesIn": "Routes in {name}",
"routes.emptyGroup": "No routes in this group yet.", "routes.emptyGroup": "No routes in this group yet.",
"routes.createFirst": "Create your first route", "routes.createFirst": "Create your first route",
@@ -522,7 +523,6 @@ const zh: Dict = {
"role.owner": "拥有者", "role.owner": "拥有者",
"role.admin": "管理员", "role.admin": "管理员",
"role.viewer": "只读", "role.viewer": "只读",
"role.badge": "我的角色:{role}",
"roles.owner": "拥有者", "roles.owner": "拥有者",
"roles.admin": "管理员", "roles.admin": "管理员",
"roles.viewer": "只读", "roles.viewer": "只读",
@@ -572,9 +572,11 @@ const zh: Dict = {
"groups.admins": "管理员", "groups.admins": "管理员",
"groups.owners": "来源", "groups.owners": "来源",
"groups.members": "成员", "groups.members": "成员",
"groups.myRole": "我的角色",
"groups.any": "任意", "groups.any": "任意",
"groups.open": "进入", "groups.open": "进入",
"group.back": "返回分组", "group.back": "返回分组",
"groups.delete": "删除分组",
"group.routesIn": "{name} 的路由", "group.routesIn": "{name} 的路由",
"routes.emptyGroup": "该分组还没有路由。", "routes.emptyGroup": "该分组还没有路由。",
"routes.createFirst": "创建第一个路由", "routes.createFirst": "创建第一个路由",