Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions packages/app/src/components/session/session-preview-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,37 @@ export function SessionPreviewTab(props: {
const seen = new Set<string>()
const entries: PreviewFileEntry[] = []

// Build a suffix→absolute map from touchedFiles so we can resolve ~/... paths from diffs
const touched = props.touchedFiles?.() ?? []
const suffixToAbsolute = new Map<string, string>()
for (const t of touched) {
// For "/Users/jj/.julia/dev/X", try progressively shorter suffixes
const parts = t.file.split("/")
for (let i = 1; i < parts.length; i++) {
suffixToAbsolute.set(parts.slice(i).join("/"), t.file)
}
}

// Resolve ~/... to absolute using the suffix map
const resolveFile = (file: string): string => {
if (!file.startsWith("~/")) return file
const suffix = file.slice(2) // strip ~/
const absolute = suffixToAbsolute.get(suffix)
return absolute ?? file
}

const toEntry = (file: string, status: string): PreviewFileEntry | null => {
if (!file.endsWith(".md")) return null
if (seen.has(file)) return null
seen.add(file)
const parts = file.split("/")
// Use the resolved absolute path as the canonical key
const resolved = resolveFile(file)
if (seen.has(resolved)) return null
seen.add(resolved)
const parts = resolved.split("/")
const basename = parts[parts.length - 1]
const relativePath = file.startsWith("~/") ? file.slice(2) : file
// Show a short relative path: strip common leading segments until we hit a recognizable dir
const relativePath = resolved.replace(/^\/Users\/[^/]+\//, "")
return {
path: file,
path: resolved,
relativePath,
basename,
extension: ".md" as const,
Expand All @@ -74,12 +96,9 @@ export function SessionPreviewTab(props: {
}

// Primary: all files touched by edit tools in this session
const touched = props.touchedFiles?.()
if (touched) {
for (const t of touched) {
const entry = toEntry(t.file, t.status)
if (entry) entries.push(entry)
}
for (const t of touched) {
const entry = toEntry(t.file, t.status)
if (entry) entries.push(entry)
}

// Supplement: any diff files not already in touchedFiles
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc للخروج",
"session.child.promptDisabled": "لا يمكن إرسال موجّهات إلى جلسات الوكلاء الفرعيين.",
"session.child.backToParent": "العودة إلى الجلسة الرئيسية.",
"session.archived.readOnly": "هذه الجلسة مؤرشفة وللقراءة فقط.",
"session.archived.unarchive": "إلغاء الأرشفة للاستئناف.",
"prompt.example.1": "إصلاح TODO في قاعدة التعليمات البرمجية",
"prompt.example.2": "ما هو المكدس التقني لهذا المشروع؟",
"prompt.example.3": "إصلاح الاختبارات المعطلة",
Expand Down Expand Up @@ -658,6 +660,7 @@ export const dict = {
"common.rename": "إعادة تسمية",
"common.reset": "إعادة تعيين",
"common.archive": "أرشفة",
"common.unarchive": "إلغاء الأرشفة",
"common.delete": "حذف",
"common.close": "إغلاق",
"common.edit": "تحرير",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc para sair",
"session.child.promptDisabled": "Não é possível enviar prompts em sessões de subagentes.",
"session.child.backToParent": "Voltar à sessão principal.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",
"prompt.example.1": "Corrigir um TODO no código",
"prompt.example.2": "Qual é a stack tecnológica deste projeto?",
"prompt.example.3": "Corrigir testes quebrados",
Expand Down Expand Up @@ -667,6 +669,7 @@ export const dict = {
"common.rename": "Renomear",
"common.reset": "Redefinir",
"common.archive": "Arquivar",
"common.unarchive": "Unarchive",
"common.delete": "Excluir",
"common.close": "Fechar",
"common.edit": "Editar",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/bs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc za izlaz",
"session.child.promptDisabled": "Sesijama podagenta nije moguće slati upite.",
"session.child.backToParent": "Nazad na glavnu sesiju.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "Popravi TODO u bazi koda",
"prompt.example.2": "Koji je tehnološki stack ovog projekta?",
Expand Down Expand Up @@ -727,6 +729,7 @@ export const dict = {
"common.rename": "Preimenuj",
"common.reset": "Resetuj",
"common.archive": "Arhiviraj",
"common.unarchive": "Unarchive",
"common.delete": "Izbriši",
"common.close": "Zatvori",
"common.edit": "Uredi",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc for at afslutte",
"session.child.promptDisabled": "Der kan ikke sendes prompts til underagentsessioner.",
"session.child.backToParent": "Tilbage til hovedsessionen.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "Ret en TODO i koden",
"prompt.example.2": "Hvad er teknologistakken for dette projekt?",
Expand Down Expand Up @@ -723,6 +725,7 @@ export const dict = {
"common.rename": "Omdøb",
"common.reset": "Nulstil",
"common.archive": "Arkivér",
"common.unarchive": "Unarchive",
"common.delete": "Slet",
"common.close": "Luk",
"common.edit": "Rediger",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc zum Verlassen",
"session.child.promptDisabled": "Unteragenten-Sitzungen können keine Prompts erhalten.",
"session.child.backToParent": "Zurück zur Hauptsitzung.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",
"prompt.example.1": "Ein TODO in der Codebasis beheben",
"prompt.example.2": "Was ist der Tech-Stack dieses Projekts?",
"prompt.example.3": "Fehlerhafte Tests beheben",
Expand Down Expand Up @@ -676,6 +678,7 @@ export const dict = {
"common.rename": "Umbenennen",
"common.reset": "Zurücksetzen",
"common.archive": "Archivieren",
"common.unarchive": "Unarchive",
"common.delete": "Löschen",
"common.close": "Schließen",
"common.edit": "Bearbeiten",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc para salir",
"session.child.promptDisabled": "No se pueden enviar prompts a las sesiones de subagentes.",
"session.child.backToParent": "Volver a la sesión principal.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "Arreglar un TODO en el código",
"prompt.example.2": "¿Cuál es el stack tecnológico de este proyecto?",
Expand Down Expand Up @@ -730,6 +732,7 @@ export const dict = {
"common.rename": "Renombrar",
"common.reset": "Restablecer",
"common.archive": "Archivar",
"common.unarchive": "Unarchive",
"common.delete": "Eliminar",
"common.close": "Cerrar",
"common.edit": "Editar",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc pour quitter",
"session.child.promptDisabled": "Les sessions de sous-agents ne peuvent pas recevoir de messages.",
"session.child.backToParent": "Revenir à la session principale.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",
"prompt.example.1": "Corriger un TODO dans la base de code",
"prompt.example.2": "Quelle est la pile technique de ce projet ?",
"prompt.example.3": "Réparer les tests échoués",
Expand Down Expand Up @@ -672,6 +674,7 @@ export const dict = {
"common.rename": "Renommer",
"common.reset": "Réinitialiser",
"common.archive": "Archiver",
"common.unarchive": "Unarchive",
"common.delete": "Supprimer",
"common.close": "Fermer",
"common.edit": "Modifier",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ export const dict = {
"prompt.mode.shell.exit": "escで終了",
"session.child.promptDisabled": "サブエージェントのセッションにはプロンプトを送信できません。",
"session.child.backToParent": "メインセッションに戻る。",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",
"prompt.example.1": "コードベースのTODOを修正",
"prompt.example.2": "このプロジェクトの技術スタックは何ですか?",
"prompt.example.3": "壊れたテストを修正",
Expand Down Expand Up @@ -663,6 +665,7 @@ export const dict = {
"common.rename": "名前変更",
"common.reset": "リセット",
"common.archive": "アーカイブ",
"common.unarchive": "Unarchive",
"common.delete": "削除",
"common.close": "閉じる",
"common.edit": "編集",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ export const dict = {
"common.rename": "이름 바꾸기",
"common.reset": "초기화",
"common.archive": "보관",
"common.unarchive": "Unarchive",
"common.delete": "삭제",
"common.close": "닫기",
"common.edit": "편집",
Expand Down Expand Up @@ -870,6 +871,8 @@ export const dict = {
"common.clear": "지우기",
"session.child.promptDisabled": "하위 에이전트 세션에는 프롬프트를 입력할 수 없습니다.",
"session.child.backToParent": "메인 세션으로 돌아가기.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"wsl.server.add": "WSL 서버 추가",
"wsl.server.addShort": "WSL 추가",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/no.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ export const dict = {
"common.rename": "Gi nytt navn",
"common.reset": "Tilbakestill",
"common.archive": "Arkiver",
"common.unarchive": "Unarchive",
"common.delete": "Slett",
"common.close": "Lukk",
"common.edit": "Rediger",
Expand Down Expand Up @@ -961,6 +962,8 @@ export const dict = {

"session.child.promptDisabled": "Underagentsesjoner kan ikke motta forespørsler.",
"session.child.backToParent": "Tilbake til hovedsesjonen.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"wsl.server.add": "Legg til WSL-server",
"wsl.server.addShort": "Legg til WSL",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc aby wyjść",
"session.child.promptDisabled": "Nie można wysyłać promptów w sesjach podagentów.",
"session.child.backToParent": "Wróć do głównej sesji.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",
"prompt.example.1": "Napraw TODO w bazie kodu",
"prompt.example.2": "Jaki jest stos technologiczny tego projektu?",
"prompt.example.3": "Napraw zepsute testy",
Expand Down Expand Up @@ -667,6 +669,7 @@ export const dict = {
"common.rename": "Zmień nazwę",
"common.reset": "Resetuj",
"common.archive": "Archiwizuj",
"common.unarchive": "Unarchive",
"common.delete": "Usuń",
"common.close": "Zamknij",
"common.edit": "Edytuj",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc для выхода",
"session.child.promptDisabled": "В сессиях субагентов нельзя отправлять запросы.",
"session.child.backToParent": "Вернуться к основной сессии.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "Исправить TODO в коде",
"prompt.example.2": "Какой технологический стек этого проекта?",
Expand Down Expand Up @@ -727,6 +729,7 @@ export const dict = {
"common.rename": "Переименовать",
"common.reset": "Сбросить",
"common.archive": "Архивировать",
"common.unarchive": "Unarchive",
"common.delete": "Удалить",
"common.close": "Закрыть",
"common.edit": "Редактировать",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/th.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ export const dict = {
"prompt.mode.shell.exit": "กด esc เพื่อออก",
"session.child.promptDisabled": "ไม่สามารถส่งพรอมต์ในเซสชันเอเจนต์ย่อยได้.",
"session.child.backToParent": "กลับไปยังเซสชันหลัก.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "แก้ไข TODO ในโค้ดเบส",
"prompt.example.2": "เทคโนโลยีของโปรเจกต์นี้คืออะไร?",
Expand Down Expand Up @@ -720,6 +722,7 @@ export const dict = {
"common.rename": "เปลี่ยนชื่อ",
"common.reset": "รีเซ็ต",
"common.archive": "จัดเก็บ",
"common.unarchive": "Unarchive",
"common.delete": "ลบ",
"common.close": "ปิด",
"common.edit": "แก้ไข",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ export const dict = {
"prompt.mode.shell.exit": "çıkmak için esc",
"session.child.promptDisabled": "Alt ajan oturumlarına istem gönderilemez.",
"session.child.backToParent": "Ana oturuma dön.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "Kod tabanındaki bir TODO'yu düzelt",
"prompt.example.2": "Bu projenin teknoloji yığını nedir?",
Expand Down Expand Up @@ -732,6 +734,7 @@ export const dict = {
"common.rename": "Yeniden adlandır",
"common.reset": "Sıfırla",
"common.archive": "Arşivle",
"common.unarchive": "Unarchive",
"common.delete": "Sil",
"common.close": "Kapat",
"common.edit": "Düzenle",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ export const dict = {
"prompt.mode.shell.exit": "esc для виходу",
"session.child.promptDisabled": "Сесії підагентів не можна надсилати запити.",
"session.child.backToParent": "Назад до основної сесії.",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "Виправити TODO у коді",
"prompt.example.2": "Який технологічний стек цього проєкту?",
Expand Down Expand Up @@ -777,6 +779,7 @@ export const dict = {
"common.rename": "Перейменувати",
"common.reset": "Скинути",
"common.archive": "Архівувати",
"common.unarchive": "Unarchive",
"common.delete": "Видалити",
"common.close": "Закрити",
"common.edit": "Редагувати",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ export const dict = {
"prompt.mode.shell.exit": "按 esc 退出",
"session.child.promptDisabled": "无法向子智能体会话发送提示词。",
"session.child.backToParent": "返回主会话。",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",
"prompt.example.1": "修复代码库中的一个 TODO",
"prompt.example.2": "这个项目的技术栈是什么?",
"prompt.example.3": "修复失败的测试",
Expand Down Expand Up @@ -717,6 +719,7 @@ export const dict = {
"common.rename": "重命名",
"common.reset": "重置",
"common.archive": "归档",
"common.unarchive": "Unarchive",
"common.delete": "删除",
"common.close": "关闭",
"common.edit": "编辑",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/i18n/zht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ export const dict = {
"prompt.mode.shell.exit": "按 esc 退出",
"session.child.promptDisabled": "無法在子代理程式工作階段中輸入提示詞。",
"session.child.backToParent": "返回主要工作階段。",
"session.archived.readOnly": "This session is archived and read-only.",
"session.archived.unarchive": "Unarchive to resume.",

"prompt.example.1": "修復程式碼庫中的一個 TODO",
"prompt.example.2": "這個專案的技術堆疊是什麼?",
Expand Down Expand Up @@ -714,6 +716,7 @@ export const dict = {
"common.rename": "重新命名",
"common.reset": "重設",
"common.archive": "封存",
"common.unarchive": "Unarchive",
"common.delete": "刪除",
"common.close": "關閉",
"common.edit": "編輯",
Expand Down
Loading
Loading