feat(z01): 열 제목 눌러 차례 — 누르기 전엔 표시 없음(원본 차례) · 오름→내림→원본 · 세우기는 서버 몫(sort·desc 보냄 · 서버가 거절하면 누른 표시 지움) · 제목은 서버가 준 sortable 열만 눌림(눌렀는데 그대로인 화면 막음)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
This commit is contained in:
2026-09-16 10:59:36 +09:00
co-authored by Claude Opus 5
parent d4aa466b60
commit 3a61d4c158
5 changed files with 79 additions and 4 deletions
+17
View File
@@ -85,6 +85,18 @@ export function outdatedBanner(sources?: TableSource[]): string[] {
});
}
/** 열 제목을 눌러 세운 차례 — null 이면 원본 차례(서버가 sort 없이 주는 그대로). */
export interface SortOrder {
key: string;
desc: boolean;
}
/** 같은 열을 누르면 오름 → 내림 → 원본 차례, 다른 열이면 그 열 오름부터. */
export function nextSort(current: SortOrder | null, key: string): SortOrder | null {
if (current?.key !== key) return { key, desc: false };
return current.desc ? null : { key, desc: true };
}
/** 알림은 한 줄로도 목록으로도 옴 — 받은 대로 줄 목록으로. */
export function noticeLines(notice?: string | string[]): string[] {
if (!notice) return [];
@@ -108,6 +120,11 @@ export interface TableMeta {
* 화면이 사전을 가지면 두 벌이 됨.
*/
notice?: string | string[];
/**
* 서버가 세워 줄 수 있는 열 — 이 목록에 있는 제목만 눌림.
* 없으면 제목이 안 눌림(원본 차례) — 눌렀는데 그대로인 화면을 안 만들려고 서버에 물어서 켬.
*/
sortable?: string[];
editable?: string[];
/** 열key → 왜 못 고치나 */
locked?: Record<string, string>;