rebuild(stage-13): redesign mobile information architecture
This commit is contained in:
@@ -9,13 +9,19 @@ type TableColumn = {
|
||||
format?: (value: unknown, row: Record<string, unknown>) => string;
|
||||
};
|
||||
|
||||
defineProps<{
|
||||
const props = defineProps<{
|
||||
columns: TableColumn[];
|
||||
rows: Record<string, unknown>[];
|
||||
sortKey: string;
|
||||
sortDirection: "asc" | "desc";
|
||||
}>();
|
||||
const emit = defineEmits<{ sort: [key: string] }>();
|
||||
|
||||
function ariaSort(key: string, sortable?: boolean): "ascending" | "descending" | "none" | undefined {
|
||||
if (!sortable) return undefined;
|
||||
if (key !== props.sortKey) return "none";
|
||||
return props.sortDirection === "asc" ? "ascending" : "descending";
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -23,8 +29,8 @@ const emit = defineEmits<{ sort: [key: string] }>();
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="index-column">序号</th>
|
||||
<th v-for="column in columns" :key="column.key" :class="{ numeric: column.numeric, 'wide-column': column.wide, 'code-column': column.code }">
|
||||
<th class="index-column" scope="col">序号</th>
|
||||
<th v-for="column in columns" :key="column.key" scope="col" :aria-sort="ariaSort(column.key, column.sortable)" :class="{ numeric: column.numeric, 'wide-column': column.wide, 'code-column': column.code }">
|
||||
<button v-if="column.sortable" type="button" @click="emit('sort', column.key)">
|
||||
{{ column.label }}<span v-if="sortKey === column.key">{{ sortDirection === "asc" ? "↑" : "↓" }}</span>
|
||||
</button>
|
||||
@@ -35,7 +41,7 @@ const emit = defineEmits<{ sort: [key: string] }>();
|
||||
<tbody>
|
||||
<tr v-for="(row, index) in rows" :key="String(row.identifier ?? index)">
|
||||
<td class="index-column numeric">{{ index + 1 }}</td>
|
||||
<td v-for="column in columns" :key="column.key" :class="{ numeric: column.numeric, 'wide-column': column.wide, 'code-column': column.code, up: column.key.includes('change') && Number(row[column.key]) > 0, down: column.key.includes('change') && Number(row[column.key]) < 0 }">
|
||||
<td v-for="column in columns" :key="column.key" :data-label="column.label" :class="{ numeric: column.numeric, 'wide-column': column.wide, 'code-column': column.code, up: column.key.includes('change') && Number(row[column.key]) > 0, down: column.key.includes('change') && Number(row[column.key]) < 0 }">
|
||||
{{ column.format ? column.format(row[column.key], row) : (row[column.key] ?? "") }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -87,13 +87,29 @@ p {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: fixed;
|
||||
top: var(--s-8);
|
||||
left: var(--s-8);
|
||||
z-index: var(--z-toast);
|
||||
padding: var(--s-8) var(--s-12);
|
||||
border-radius: var(--control-radius);
|
||||
color: var(--c-gray-050);
|
||||
background: var(--color-primary);
|
||||
transform: translateY(calc(-100% - var(--s-16)));
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
scroll-behavior: auto !important;
|
||||
animation-duration: var(--s-1) !important;
|
||||
animation-duration: var(--duration-reduced) !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: var(--s-1) !important;
|
||||
transition-duration: var(--duration-reduced) !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,18 @@
|
||||
.dialog,
|
||||
.dialog-wide {
|
||||
width: 100%;
|
||||
max-height: calc(100vh - var(--s-44));
|
||||
max-height: calc(100dvh - var(--s-44));
|
||||
border-radius: var(--card-radius) var(--card-radius) 0 0;
|
||||
}
|
||||
|
||||
button,
|
||||
.btn,
|
||||
.icon-button {
|
||||
.icon-button,
|
||||
.seg-control button,
|
||||
.segmented button,
|
||||
.mobile-nav-item,
|
||||
.mobile-workspace-switch select {
|
||||
min-width: var(--touch-height);
|
||||
min-height: var(--touch-height);
|
||||
}
|
||||
|
||||
@@ -27,7 +33,7 @@
|
||||
|
||||
.app-shell {
|
||||
padding-left: 0;
|
||||
padding-bottom: var(--shell-mobile-nav-height);
|
||||
padding-bottom: calc(var(--shell-mobile-nav-height) + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.sidebar,
|
||||
@@ -47,8 +53,7 @@
|
||||
}
|
||||
|
||||
.identity-cluster .tag,
|
||||
.account-name,
|
||||
.date-control .icon-button {
|
||||
.account-name {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -69,10 +74,53 @@
|
||||
}
|
||||
|
||||
.page-frame {
|
||||
min-height: calc(100vh - var(--shell-topbar-height) - var(--shell-summary-height) - var(--shell-mobile-nav-height));
|
||||
min-height: calc(100dvh - var(--shell-topbar-height) - var(--shell-summary-height) - var(--shell-mobile-nav-height));
|
||||
padding: var(--s-12) var(--s-10);
|
||||
}
|
||||
|
||||
.mobile-context-bar {
|
||||
display: grid;
|
||||
gap: var(--s-10);
|
||||
padding: var(--s-6) var(--s-10);
|
||||
border-bottom: var(--s-1) solid var(--color-border);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.mobile-workspace-switch {
|
||||
min-height: var(--touch-height);
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: var(--s-10);
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-12);
|
||||
font-weight: var(--weight-600);
|
||||
}
|
||||
|
||||
.mobile-workspace-switch select {
|
||||
min-width: 0;
|
||||
padding: 0 var(--s-10);
|
||||
border: var(--s-1) solid var(--color-border);
|
||||
border-radius: var(--control-radius);
|
||||
color: var(--color-text);
|
||||
background: var(--color-surface-muted);
|
||||
}
|
||||
|
||||
.mobile-date-control {
|
||||
display: grid;
|
||||
grid-template-columns: var(--touch-height) minmax(0, 1fr) var(--touch-height);
|
||||
}
|
||||
|
||||
.mobile-date-control .date-input {
|
||||
width: 100%;
|
||||
height: var(--touch-height);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mobile-only {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
align-items: flex-start;
|
||||
gap: var(--s-4);
|
||||
@@ -85,7 +133,7 @@
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: var(--z-mobile-nav);
|
||||
height: var(--shell-mobile-nav-height);
|
||||
min-height: calc(var(--shell-mobile-nav-height) + env(safe-area-inset-bottom));
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
@@ -101,7 +149,8 @@
|
||||
font-size: var(--font-11);
|
||||
}
|
||||
|
||||
.mobile-nav-item.router-link-active {
|
||||
.mobile-nav-item.router-link-active,
|
||||
.mobile-nav-item.active {
|
||||
color: var(--color-primary);
|
||||
font-weight: var(--weight-600);
|
||||
}
|
||||
@@ -246,8 +295,94 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 430px) {
|
||||
.data-table-wrap {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.data-table thead {
|
||||
position: absolute;
|
||||
width: var(--s-1);
|
||||
height: var(--s-1);
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.data-table tbody {
|
||||
display: grid;
|
||||
gap: var(--s-8);
|
||||
padding: var(--s-8);
|
||||
}
|
||||
|
||||
.data-table tbody tr {
|
||||
display: grid;
|
||||
padding: var(--s-8) var(--s-10);
|
||||
border: var(--s-1) solid var(--color-border);
|
||||
border-radius: var(--control-radius);
|
||||
background: var(--color-surface-muted);
|
||||
}
|
||||
|
||||
.data-table tbody td,
|
||||
.data-table tbody td.numeric,
|
||||
.data-table tbody td.code-column,
|
||||
.data-table tbody td.wide-column {
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(var(--s-96), 1fr) minmax(0, 2fr);
|
||||
gap: var(--s-8);
|
||||
padding: var(--s-6) 0;
|
||||
border-bottom: var(--s-1) solid var(--color-divider);
|
||||
text-align: right;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.data-table tbody td:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.data-table tbody td::before {
|
||||
content: attr(data-label);
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-11);
|
||||
font-weight: var(--weight-600);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.data-table tbody td.index-column {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 430px) {
|
||||
.page-header {
|
||||
align-items: baseline;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.pool-toolbar {
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.pool-filters {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.pool-search {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.review-main-grid { grid-template-columns: minmax(0, 1fr); }
|
||||
.review-heading-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-left: 0; }
|
||||
.trade-card, .daily-review-card { min-height: auto; }
|
||||
.review-watch-table { max-height: var(--s-320); }
|
||||
.trade-scroll { max-height: var(--s-320); }
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.review-heading-actions {
|
||||
display: flex;
|
||||
gap: var(--s-8);
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.review-watch-table {
|
||||
width: 100%;
|
||||
max-height: var(--s-260);
|
||||
|
||||
@@ -279,6 +279,15 @@
|
||||
padding: var(--page-padding-y) var(--page-padding-x);
|
||||
}
|
||||
|
||||
.shell-content {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.mobile-context-bar,
|
||||
.mobile-only {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
--shadow-float: 0 12px 32px rgba(0, 0, 0, 0.18);
|
||||
--duration-fast: 160ms;
|
||||
--duration-normal: 220ms;
|
||||
--duration-reduced: 1ms;
|
||||
--ease-standard: ease;
|
||||
--opacity-disabled: 0.52;
|
||||
--opacity-muted: 0.72;
|
||||
|
||||
Reference in New Issue
Block a user