Skip to content

Commit 6b99dd5

Browse files
authored
tui: align session empty states (anomalyco#16412)
1 parent c53c9d4 commit 6b99dd5

20 files changed

Lines changed: 54 additions & 31 deletions

File tree

packages/app/src/components/session/session-new-view.tsx

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { getDirectory, getFilename } from "@opencode-ai/util/path"
88

99
const MAIN_WORKTREE = "main"
1010
const CREATE_WORKTREE = "create"
11-
const ROOT_CLASS =
12-
"size-full flex flex-col justify-end items-start gap-4 flex-[1_0_0] self-stretch max-w-200 mx-auto 2xl:max-w-[1000px] px-6 pb-16"
11+
const ROOT_CLASS = "size-full flex flex-col"
1312

1413
interface NewSessionViewProps {
1514
worktree: string
@@ -50,33 +49,40 @@ export function NewSessionView(props: NewSessionViewProps) {
5049

5150
return (
5251
<div class={ROOT_CLASS}>
53-
<div class="text-20-medium text-text-weaker">{language.t("command.session.new")}</div>
54-
<div class="flex justify-center items-start gap-3 min-h-5">
55-
<Icon name="folder" size="small" class="mt-0.5 shrink-0" />
56-
<div class="text-12-medium text-text-weak select-text leading-5">
57-
{getDirectory(projectRoot())}
58-
<span class="text-text-strong">{getFilename(projectRoot())}</span>
59-
</div>
60-
</div>
61-
<div class="flex justify-center items-start gap-3 min-h-5">
62-
<Icon name="branch" size="small" class="mt-0.5 shrink-0" />
63-
<div class="text-12-medium text-text-weak select-text leading-5">{label(current())}</div>
64-
</div>
65-
<Show when={sync.project}>
66-
{(project) => (
67-
<div class="flex justify-center items-start gap-3 min-h-5">
68-
<Icon name="pencil-line" size="small" class="mt-0.5 shrink-0" />
69-
<div class="text-12-medium text-text-weak leading-5">
70-
{language.t("session.new.lastModified")}&nbsp;
71-
<span class="text-text-strong">
72-
{DateTime.fromMillis(project().time.updated ?? project().time.created)
73-
.setLocale(language.intl())
74-
.toRelative()}
75-
</span>
52+
<div class="h-12 shrink-0" aria-hidden />
53+
<div class="flex-1 px-6 pb-30 flex items-center justify-center text-center">
54+
<div class="w-full max-w-200 flex flex-col items-center text-center gap-4">
55+
<div class="text-20-medium text-text-strong">{language.t("session.new.title")}</div>
56+
<div class="w-full flex flex-col gap-4 items-center">
57+
<div class="flex items-start justify-center gap-3 min-h-5">
58+
<div class="text-12-medium text-text-weak select-text leading-5 min-w-0 max-w-160 break-words text-center">
59+
{getDirectory(projectRoot())}
60+
<span class="text-text-strong">{getFilename(projectRoot())}</span>
61+
</div>
7662
</div>
63+
<div class="flex items-start justify-center gap-1.5 min-h-5">
64+
<Icon name="branch" size="small" class="mt-0.5 shrink-0" />
65+
<div class="text-12-medium text-text-weak select-text leading-5 min-w-0 max-w-160 break-words text-center">
66+
{label(current())}
67+
</div>
68+
</div>
69+
<Show when={sync.project}>
70+
{(project) => (
71+
<div class="flex items-start justify-center gap-3 min-h-5">
72+
<div class="text-12-medium text-text-weak leading-5 min-w-0 max-w-160 break-words text-center">
73+
{language.t("session.new.lastModified")}&nbsp;
74+
<span class="text-text-strong">
75+
{DateTime.fromMillis(project().time.updated ?? project().time.created)
76+
.setLocale(language.intl())
77+
.toRelative()}
78+
</span>
79+
</div>
80+
</div>
81+
)}
82+
</Show>
7783
</div>
78-
)}
79-
</Show>
84+
</div>
85+
</div>
8086
</div>
8187
)
8288
}

packages/app/src/i18n/ar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ export const dict = {
456456
"session.todo.title": "المهام",
457457
"session.todo.collapse": "طي",
458458
"session.todo.expand": "توسيع",
459+
"session.new.title": "ابنِ أي شيء",
459460
"session.new.worktree.main": "الفرع الرئيسي",
460461
"session.new.worktree.mainWithBranch": "الفرع الرئيسي ({{branch}})",
461462
"session.new.worktree.create": "إنشاء شجرة عمل جديدة",

packages/app/src/i18n/br.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ export const dict = {
459459
"session.todo.title": "Tarefas",
460460
"session.todo.collapse": "Recolher",
461461
"session.todo.expand": "Expandir",
462+
"session.new.title": "Crie qualquer coisa",
462463
"session.new.worktree.main": "Branch principal",
463464
"session.new.worktree.mainWithBranch": "Branch principal ({{branch}})",
464465
"session.new.worktree.create": "Criar novo worktree",

packages/app/src/i18n/bs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ export const dict = {
515515
"session.todo.collapse": "Sažmi",
516516
"session.todo.expand": "Proširi",
517517

518+
"session.new.title": "Napravi bilo šta",
518519
"session.new.worktree.main": "Glavna grana",
519520
"session.new.worktree.mainWithBranch": "Glavna grana ({{branch}})",
520521
"session.new.worktree.create": "Kreiraj novi worktree",

packages/app/src/i18n/da.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ export const dict = {
510510
"session.todo.collapse": "Skjul",
511511
"session.todo.expand": "Udvid",
512512

513+
"session.new.title": "Byg hvad som helst",
513514
"session.new.worktree.main": "Hovedgren",
514515
"session.new.worktree.mainWithBranch": "Hovedgren ({{branch}})",
515516
"session.new.worktree.create": "Opret nyt worktree",

packages/app/src/i18n/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ export const dict = {
467467
"session.todo.title": "Aufgaben",
468468
"session.todo.collapse": "Einklappen",
469469
"session.todo.expand": "Ausklappen",
470+
"session.new.title": "Baue, was du willst",
470471
"session.new.worktree.main": "Haupt-Branch",
471472
"session.new.worktree.mainWithBranch": "Haupt-Branch ({{branch}})",
472473
"session.new.worktree.create": "Neuen Worktree erstellen",

packages/app/src/i18n/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ export const dict = {
531531
"session.todo.collapse": "Collapse",
532532
"session.todo.expand": "Expand",
533533

534+
"session.new.title": "Build anything",
534535
"session.new.worktree.main": "Main branch",
535536
"session.new.worktree.mainWithBranch": "Main branch ({{branch}})",
536537
"session.new.worktree.create": "Create new worktree",

packages/app/src/i18n/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ export const dict = {
516516
"session.todo.collapse": "Contraer",
517517
"session.todo.expand": "Expandir",
518518

519+
"session.new.title": "Construye lo que quieras",
519520
"session.new.worktree.main": "Rama principal",
520521
"session.new.worktree.mainWithBranch": "Rama principal ({{branch}})",
521522
"session.new.worktree.create": "Crear nuevo árbol de trabajo",

packages/app/src/i18n/fr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ export const dict = {
463463
"session.todo.title": "Tâches",
464464
"session.todo.collapse": "Réduire",
465465
"session.todo.expand": "Développer",
466+
"session.new.title": "Créez ce que vous voulez",
466467
"session.new.worktree.main": "Branche principale",
467468
"session.new.worktree.mainWithBranch": "Branche principale ({{branch}})",
468469
"session.new.worktree.create": "Créer un nouvel arbre de travail",

packages/app/src/i18n/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ export const dict = {
457457
"session.todo.title": "ToDo",
458458
"session.todo.collapse": "折りたたむ",
459459
"session.todo.expand": "展開",
460+
"session.new.title": "何でも作る",
460461
"session.new.worktree.main": "メインブランチ",
461462
"session.new.worktree.mainWithBranch": "メインブランチ ({{branch}})",
462463
"session.new.worktree.create": "新しいワークツリーを作成",

0 commit comments

Comments
 (0)