From e4d0806d6c565b33072dc7328fdb76dea351fc0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=A0=C4=87eki=C4=87?= Date: Thu, 12 Feb 2026 11:50:42 +0100 Subject: [PATCH 1/3] =?UTF-8?q?fix(kilo-vscode):=20address=20PR=20#255=20p?= =?UTF-8?q?ost-merge=20review=20=E2=80=94=20i18n=20date=20groups=20and=20d?= =?UTF-8?q?ialog=20CSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Internationalize date group headings in SessionList (Today, Yesterday, This Week, This Month, Older) using time.* translation keys across all 16 locale files instead of hardcoded English strings - Replace inline styles in delete confirmation dialog with CSS classes (dialog-confirm-body, dialog-confirm-actions) in chat.css - Remove duplicate session.search.placeholder, session.empty, and session.untitled keys that were accidentally duplicated in locale files --- .../docs/ui-implementation-plan.md | 2 +- .../src/components/history/SessionList.tsx | 33 +++++++++---------- .../kilo-vscode/webview-ui/src/i18n/ar.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/br.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/bs.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/da.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/de.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/en.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/es.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/fr.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/ja.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/ko.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/no.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/pl.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/ru.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/th.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/zh.ts | 9 ++--- .../kilo-vscode/webview-ui/src/i18n/zht.ts | 9 ++--- .../webview-ui/src/styles/chat.css | 14 ++++++++ 19 files changed, 110 insertions(+), 83 deletions(-) diff --git a/packages/kilo-vscode/docs/ui-implementation-plan.md b/packages/kilo-vscode/docs/ui-implementation-plan.md index 747d73ccda1..b4ff20671e0 100644 --- a/packages/kilo-vscode/docs/ui-implementation-plan.md +++ b/packages/kilo-vscode/docs/ui-implementation-plan.md @@ -737,7 +737,7 @@ Each phase has specific acceptance criteria (listed above). The general verifica | Session history | List renders, selection works, navigation back to chat | | Login flow | Device auth card renders, QR code displays, success/error states | | Theme switching | Change VS Code theme → webview updates automatically | -| Sidebar ↔ tab | Both webview hosts render identically | +| Sidebar ↔ tab | Both webview hosts render identically | | Markdown content | Headers, lists, code blocks, links render correctly | | Long conversations | Auto-scroll works, performance is acceptable | diff --git a/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx b/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx index 862999edc67..147b16f14d1 100644 --- a/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx @@ -16,7 +16,9 @@ import { useLanguage } from "../../context/language" import { formatRelativeDate } from "../../utils/date" import type { SessionInfo } from "../../types/messages" -function dateGroup(iso: string): string { +const DATE_GROUP_KEYS = ["time.today", "time.yesterday", "time.thisWeek", "time.thisMonth", "time.older"] as const + +function dateGroupKey(iso: string): string { const now = new Date() const then = new Date(iso) @@ -25,19 +27,11 @@ function dateGroup(iso: string): string { const weekAgo = new Date(today.getTime() - 7 * 86400000) const monthAgo = new Date(today.getTime() - 30 * 86400000) - if (then >= today) return "Today" - if (then >= yesterday) return "Yesterday" - if (then >= weekAgo) return "This Week" - if (then >= monthAgo) return "This Month" - return "Older" -} - -const GROUP_ORDER: Record = { - Today: 0, - Yesterday: 1, - "This Week": 2, - "This Month": 3, - Older: 4, + if (then >= today) return DATE_GROUP_KEYS[0] + if (then >= yesterday) return DATE_GROUP_KEYS[1] + if (then >= weekAgo) return DATE_GROUP_KEYS[2] + if (then >= monthAgo) return DATE_GROUP_KEYS[3] + return DATE_GROUP_KEYS[4] } interface SessionListProps { @@ -90,9 +84,9 @@ const SessionList: Component = (props) => { function confirmDelete(s: SessionInfo) { dialog.show(() => ( -
+
{language.t("session.delete.confirm", { name: s.title || language.t("session.untitled") })} -
+
@@ -147,8 +141,11 @@ const SessionList: Component = (props) => { }} search={{ placeholder: language.t("session.search.placeholder"), autofocus: false }} emptyMessage={language.t("session.empty")} - groupBy={(s) => dateGroup(s.updatedAt)} - sortGroupsBy={(a, b) => (GROUP_ORDER[a.category] ?? 99) - (GROUP_ORDER[b.category] ?? 99)} + groupBy={(s) => language.t(dateGroupKey(s.updatedAt))} + sortGroupsBy={(a, b) => { + const order = DATE_GROUP_KEYS.map((k) => language.t(k)) + return (order.indexOf(a.category) ?? 99) - (order.indexOf(b.category) ?? 99) + }} itemWrapper={wrapItem} > {(s) => ( diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ar.ts b/packages/kilo-vscode/webview-ui/src/i18n/ar.ts index d567d1b5450..8f980982e96 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ar.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ar.ts @@ -773,10 +773,11 @@ export const dict = { "time.hoursAgo": "قبل {{count}} ساعة", "time.daysAgo": "قبل {{count}} يوم", "time.monthsAgo": "قبل {{count}} شهر", - - "session.search.placeholder": "البحث في الجلسات...", - "session.empty": "لا توجد جلسات بعد. انقر على + لبدء محادثة جديدة.", - "session.untitled": "بدون عنوان", + "time.today": "اليوم", + "time.yesterday": "أمس", + "time.thisWeek": "هذا الأسبوع", + "time.thisMonth": "هذا الشهر", + "time.older": "أقدم", "settings.aboutKiloCode.status.connected": "متصل", "settings.aboutKiloCode.status.connecting": "جارٍ الاتصال...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/br.ts b/packages/kilo-vscode/webview-ui/src/i18n/br.ts index cf5824e62eb..add19efa029 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/br.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/br.ts @@ -780,10 +780,11 @@ export const dict = { "time.hoursAgo": "{{count}}h atrás", "time.daysAgo": "{{count}}d atrás", "time.monthsAgo": "{{count}} meses atrás", - - "session.search.placeholder": "Pesquisar sessões...", - "session.empty": "Nenhuma sessão ainda. Clique em + para iniciar uma nova conversa.", - "session.untitled": "Sem título", + "time.today": "Hoje", + "time.yesterday": "Ontem", + "time.thisWeek": "Esta semana", + "time.thisMonth": "Este mês", + "time.older": "Mais antigo", "settings.aboutKiloCode.status.connected": "Conectado", "settings.aboutKiloCode.status.connecting": "Conectando...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/bs.ts b/packages/kilo-vscode/webview-ui/src/i18n/bs.ts index bc2d9371533..8eec6595500 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/bs.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/bs.ts @@ -807,10 +807,11 @@ export const dict = { "time.hoursAgo": "prije {{count}}h", "time.daysAgo": "prije {{count}}d", "time.monthsAgo": "prije {{count}} mj.", - - "session.search.placeholder": "Pretraži sesije...", - "session.empty": "Još nema sesija. Kliknite + za pokretanje novog razgovora.", - "session.untitled": "Bez naslova", + "time.today": "Danas", + "time.yesterday": "Jučer", + "time.thisWeek": "Ove sedmice", + "time.thisMonth": "Ovog mjeseca", + "time.older": "Starije", "settings.aboutKiloCode.status.connected": "Povezano", "settings.aboutKiloCode.status.connecting": "Povezivanje...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/da.ts b/packages/kilo-vscode/webview-ui/src/i18n/da.ts index 0cfaf03b5f3..3ec55e49c74 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/da.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/da.ts @@ -779,10 +779,11 @@ export const dict = { "time.hoursAgo": "{{count}}t siden", "time.daysAgo": "{{count}}d siden", "time.monthsAgo": "{{count}} mdr. siden", - - "session.search.placeholder": "Søg i sessioner...", - "session.empty": "Ingen sessioner endnu. Klik + for at starte en ny samtale.", - "session.untitled": "Uden titel", + "time.today": "I dag", + "time.yesterday": "I går", + "time.thisWeek": "Denne uge", + "time.thisMonth": "Denne måned", + "time.older": "Ældre", "settings.aboutKiloCode.status.connected": "Forbundet", "settings.aboutKiloCode.status.connecting": "Forbinder...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/de.ts b/packages/kilo-vscode/webview-ui/src/i18n/de.ts index 511a21db9bf..88d10cff64d 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/de.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/de.ts @@ -785,10 +785,11 @@ export const dict = { "time.hoursAgo": "vor {{count}} Std.", "time.daysAgo": "vor {{count}} T.", "time.monthsAgo": "vor {{count}} Mon.", - - "session.search.placeholder": "Sitzungen durchsuchen...", - "session.empty": "Noch keine Sitzungen. Klicken Sie auf +, um eine neue Unterhaltung zu starten.", - "session.untitled": "Ohne Titel", + "time.today": "Heute", + "time.yesterday": "Gestern", + "time.thisWeek": "Diese Woche", + "time.thisMonth": "Diesen Monat", + "time.older": "Älter", "settings.aboutKiloCode.status.connected": "Verbunden", "settings.aboutKiloCode.status.connecting": "Verbindung wird hergestellt...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/en.ts b/packages/kilo-vscode/webview-ui/src/i18n/en.ts index 3e26d8c2544..356f624f42a 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/en.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/en.ts @@ -812,10 +812,11 @@ export const dict = { "time.hoursAgo": "{{count}}h ago", "time.daysAgo": "{{count}}d ago", "time.monthsAgo": "{{count}}mo ago", - - "session.search.placeholder": "Search sessions...", - "session.empty": "No sessions yet. Click + to start a new conversation.", - "session.untitled": "Untitled", + "time.today": "Today", + "time.yesterday": "Yesterday", + "time.thisWeek": "This Week", + "time.thisMonth": "This Month", + "time.older": "Older", "settings.aboutKiloCode.status.connected": "Connected", "settings.aboutKiloCode.status.connecting": "Connecting...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/es.ts b/packages/kilo-vscode/webview-ui/src/i18n/es.ts index 364fcadfbdf..1e48bddd334 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/es.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/es.ts @@ -785,10 +785,11 @@ export const dict = { "time.hoursAgo": "hace {{count}}h", "time.daysAgo": "hace {{count}}d", "time.monthsAgo": "hace {{count}} meses", - - "session.search.placeholder": "Buscar sesiones...", - "session.empty": "Aún no hay sesiones. Haz clic en + para iniciar una nueva conversación.", - "session.untitled": "Sin título", + "time.today": "Hoy", + "time.yesterday": "Ayer", + "time.thisWeek": "Esta semana", + "time.thisMonth": "Este mes", + "time.older": "Anterior", "settings.aboutKiloCode.status.connected": "Conectado", "settings.aboutKiloCode.status.connecting": "Conectando...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/fr.ts b/packages/kilo-vscode/webview-ui/src/i18n/fr.ts index bcce62ab735..1848f1f19bd 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/fr.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/fr.ts @@ -789,10 +789,11 @@ export const dict = { "time.hoursAgo": "il y a {{count}}h", "time.daysAgo": "il y a {{count}}j", "time.monthsAgo": "il y a {{count}} mois", - - "session.search.placeholder": "Rechercher des sessions...", - "session.empty": "Aucune session pour l'instant. Cliquez sur + pour démarrer une nouvelle conversation.", - "session.untitled": "Sans titre", + "time.today": "Aujourd'hui", + "time.yesterday": "Hier", + "time.thisWeek": "Cette semaine", + "time.thisMonth": "Ce mois-ci", + "time.older": "Plus ancien", "settings.aboutKiloCode.status.connected": "Connecté", "settings.aboutKiloCode.status.connecting": "Connexion en cours...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ja.ts b/packages/kilo-vscode/webview-ui/src/i18n/ja.ts index 2d3f59978fa..f26a99aed0f 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ja.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ja.ts @@ -773,10 +773,11 @@ export const dict = { "time.hoursAgo": "{{count}}時間前", "time.daysAgo": "{{count}}日前", "time.monthsAgo": "{{count}}ヶ月前", - - "session.search.placeholder": "セッションを検索...", - "session.empty": "セッションはまだありません。+をクリックして新しい会話を始めましょう。", - "session.untitled": "無題", + "time.today": "今日", + "time.yesterday": "昨日", + "time.thisWeek": "今週", + "time.thisMonth": "今月", + "time.older": "それ以前", "settings.aboutKiloCode.status.connected": "接続済み", "settings.aboutKiloCode.status.connecting": "接続中...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ko.ts b/packages/kilo-vscode/webview-ui/src/i18n/ko.ts index 82d028140b6..f56ac7fd5e9 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ko.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ko.ts @@ -778,10 +778,11 @@ export const dict = { "time.hoursAgo": "{{count}}시간 전", "time.daysAgo": "{{count}}일 전", "time.monthsAgo": "{{count}}개월 전", - - "session.search.placeholder": "세션 검색...", - "session.empty": "아직 세션이 없습니다. +를 클릭하여 새 대화를 시작하세요.", - "session.untitled": "제목 없음", + "time.today": "오늘", + "time.yesterday": "어제", + "time.thisWeek": "이번 주", + "time.thisMonth": "이번 달", + "time.older": "이전", "settings.aboutKiloCode.status.connected": "연결됨", "settings.aboutKiloCode.status.connecting": "연결 중...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/no.ts b/packages/kilo-vscode/webview-ui/src/i18n/no.ts index 6c82060f70f..90629284383 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/no.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/no.ts @@ -782,10 +782,11 @@ export const dict = { "time.hoursAgo": "{{count}}t siden", "time.daysAgo": "{{count}}d siden", "time.monthsAgo": "{{count}} mnd. siden", - - "session.search.placeholder": "Søk i sesjoner...", - "session.empty": "Ingen sesjoner ennå. Klikk + for å starte en ny samtale.", - "session.untitled": "Uten tittel", + "time.today": "I dag", + "time.yesterday": "I går", + "time.thisWeek": "Denne uken", + "time.thisMonth": "Denne måneden", + "time.older": "Eldre", "settings.aboutKiloCode.status.connected": "Tilkoblet", "settings.aboutKiloCode.status.connecting": "Kobler til...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/pl.ts b/packages/kilo-vscode/webview-ui/src/i18n/pl.ts index 6aac2004f5e..7a37e80fc6e 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/pl.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/pl.ts @@ -781,10 +781,11 @@ export const dict = { "time.hoursAgo": "{{count}} godz. temu", "time.daysAgo": "{{count}} dn. temu", "time.monthsAgo": "{{count}} mies. temu", - - "session.search.placeholder": "Szukaj sesji...", - "session.empty": "Brak sesji. Kliknij +, aby rozpocząć nową rozmowę.", - "session.untitled": "Bez tytułu", + "time.today": "Dzisiaj", + "time.yesterday": "Wczoraj", + "time.thisWeek": "Ten tydzień", + "time.thisMonth": "Ten miesiąc", + "time.older": "Starsze", "settings.aboutKiloCode.status.connected": "Połączono", "settings.aboutKiloCode.status.connecting": "Łączenie...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ru.ts b/packages/kilo-vscode/webview-ui/src/i18n/ru.ts index 0d4cd33fa87..b8e55a45408 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ru.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ru.ts @@ -785,10 +785,11 @@ export const dict = { "time.hoursAgo": "{{count}} ч. назад", "time.daysAgo": "{{count}} дн. назад", "time.monthsAgo": "{{count}} мес. назад", - - "session.search.placeholder": "Поиск сессий...", - "session.empty": "Пока нет сессий. Нажмите +, чтобы начать новую беседу.", - "session.untitled": "Без названия", + "time.today": "Сегодня", + "time.yesterday": "Вчера", + "time.thisWeek": "На этой неделе", + "time.thisMonth": "В этом месяце", + "time.older": "Ранее", "settings.aboutKiloCode.status.connected": "Подключено", "settings.aboutKiloCode.status.connecting": "Подключение...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/th.ts b/packages/kilo-vscode/webview-ui/src/i18n/th.ts index cdaef215b92..e0230f33ee0 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/th.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/th.ts @@ -771,10 +771,11 @@ export const dict = { "time.hoursAgo": "{{count}} ชม. ที่แล้ว", "time.daysAgo": "{{count}} วันที่แล้ว", "time.monthsAgo": "{{count}} เดือนที่แล้ว", - - "session.search.placeholder": "ค้นหาเซสชัน...", - "session.empty": "ยังไม่มีเซสชัน คลิก + เพื่อเริ่มการสนทนาใหม่", - "session.untitled": "ไม่มีชื่อ", + "time.today": "วันนี้", + "time.yesterday": "เมื่อวาน", + "time.thisWeek": "สัปดาห์นี้", + "time.thisMonth": "เดือนนี้", + "time.older": "เก่ากว่า", "settings.aboutKiloCode.status.connected": "เชื่อมต่อแล้ว", "settings.aboutKiloCode.status.connecting": "กำลังเชื่อมต่อ...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/zh.ts b/packages/kilo-vscode/webview-ui/src/i18n/zh.ts index ede994aa7ab..774a8159cf0 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/zh.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/zh.ts @@ -774,10 +774,11 @@ export const dict = { "time.hoursAgo": "{{count}} 小时前", "time.daysAgo": "{{count}} 天前", "time.monthsAgo": "{{count}} 个月前", - - "session.search.placeholder": "搜索会话...", - "session.empty": "暂无会话。点击 + 开始新对话。", - "session.untitled": "无标题", + "time.today": "今天", + "time.yesterday": "昨天", + "time.thisWeek": "本周", + "time.thisMonth": "本月", + "time.older": "更早", "settings.aboutKiloCode.status.connected": "已连接", "settings.aboutKiloCode.status.connecting": "连接中...", diff --git a/packages/kilo-vscode/webview-ui/src/i18n/zht.ts b/packages/kilo-vscode/webview-ui/src/i18n/zht.ts index 0fc07284ca3..c70e815ef4f 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/zht.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/zht.ts @@ -771,10 +771,11 @@ export const dict = { "time.hoursAgo": "{{count}} 小時前", "time.daysAgo": "{{count}} 天前", "time.monthsAgo": "{{count}} 個月前", - - "session.search.placeholder": "搜尋工作階段...", - "session.empty": "尚無工作階段。按 + 開始新的對話。", - "session.untitled": "未命名", + "time.today": "今天", + "time.yesterday": "昨天", + "time.thisWeek": "本週", + "time.thisMonth": "本月", + "time.older": "更早", "settings.aboutKiloCode.status.connected": "已連線", "settings.aboutKiloCode.status.connecting": "連線中...", diff --git a/packages/kilo-vscode/webview-ui/src/styles/chat.css b/packages/kilo-vscode/webview-ui/src/styles/chat.css index d36d16c46f8..fcde044701e 100644 --- a/packages/kilo-vscode/webview-ui/src/styles/chat.css +++ b/packages/kilo-vscode/webview-ui/src/styles/chat.css @@ -346,6 +346,20 @@ white-space: nowrap; } +/* Dialog Confirmation */ +.dialog-confirm-body { + display: flex; + flex-direction: column; + gap: 16px; + padding: 0 24px 12px 24px; +} + +.dialog-confirm-actions { + display: flex; + justify-content: flex-end; + gap: 8px; +} + /* Session List Items */ .session-list [data-slot="list-item-title"] { flex: 1; From f100aa2d4844a3943044506d2b39e92b54d0fff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=A0=C4=87eki=C4=87?= Date: Thu, 12 Feb 2026 12:00:00 +0100 Subject: [PATCH 2/3] =?UTF-8?q?fix(kilo-vscode):=20fix=20indexOf=20fallbac?= =?UTF-8?q?k=20in=20sortGroupsBy=20=E2=80=94=20use=20rank=20map=20with=20?= =?UTF-8?q?=3F=3F=2099?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit indexOf returns -1 (not undefined) for missing values, so ?? 99 never triggered. Switch to Object.fromEntries rank map where missing keys return undefined, making the ?? 99 fallback work correctly. --- .../webview-ui/src/components/history/SessionList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx b/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx index 147b16f14d1..be90c9d1d1c 100644 --- a/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx @@ -143,8 +143,8 @@ const SessionList: Component = (props) => { emptyMessage={language.t("session.empty")} groupBy={(s) => language.t(dateGroupKey(s.updatedAt))} sortGroupsBy={(a, b) => { - const order = DATE_GROUP_KEYS.map((k) => language.t(k)) - return (order.indexOf(a.category) ?? 99) - (order.indexOf(b.category) ?? 99) + const rank = Object.fromEntries(DATE_GROUP_KEYS.map((k, i) => [language.t(k), i])) + return (rank[a.category] ?? 99) - (rank[b.category] ?? 99) }} itemWrapper={wrapItem} > From f1d0258d804c582ef972002f9cb77d94ceca8b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20=C5=A0=C4=87eki=C4=87?= Date: Thu, 12 Feb 2026 12:09:57 +0100 Subject: [PATCH 3/3] fix(kilo-vscode): narrow dateGroupKey return type for type-safe i18n keys --- .../webview-ui/src/components/history/SessionList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx b/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx index be90c9d1d1c..3d9fc61109c 100644 --- a/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx @@ -18,7 +18,7 @@ import type { SessionInfo } from "../../types/messages" const DATE_GROUP_KEYS = ["time.today", "time.yesterday", "time.thisWeek", "time.thisMonth", "time.older"] as const -function dateGroupKey(iso: string): string { +function dateGroupKey(iso: string): (typeof DATE_GROUP_KEYS)[number] { const now = new Date() const then = new Date(iso)