Compare commits
3 Commits
pr-162
...
codenomad/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70f692c5df | ||
|
|
67a530a83b | ||
|
|
612ec6af1b |
@@ -11,11 +11,20 @@ interface InstanceTabProps {
|
|||||||
onClose: () => void
|
onClose: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPathBasename(path: string): string {
|
function formatFolderName(path: string, instances: Instance[], currentInstance: Instance): string {
|
||||||
// Instance folders can be POSIX-like (/Users/...) on macOS/Linux or Windows-like (C:\Users\...).
|
const name = path.split("/").pop() || path
|
||||||
// Normalize by trimming trailing separators and then splitting on both '/' and '\\'.
|
|
||||||
const normalized = path.replace(/[\\/]+$/, "")
|
const duplicates = instances.filter((i) => {
|
||||||
return normalized.split(/[\\/]/).pop() || path
|
const iName = i.folder.split("/").pop() || i.folder
|
||||||
|
return iName === name
|
||||||
|
})
|
||||||
|
|
||||||
|
if (duplicates.length > 1) {
|
||||||
|
const index = duplicates.findIndex((i) => i.id === currentInstance.id)
|
||||||
|
return `~/${name} (${index + 1})`
|
||||||
|
}
|
||||||
|
|
||||||
|
return `~/${name}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const InstanceTab: Component<InstanceTabProps> = (props) => {
|
const InstanceTab: Component<InstanceTabProps> = (props) => {
|
||||||
@@ -49,7 +58,7 @@ const InstanceTab: Component<InstanceTabProps> = (props) => {
|
|||||||
>
|
>
|
||||||
<FolderOpen class="w-4 h-4 flex-shrink-0" />
|
<FolderOpen class="w-4 h-4 flex-shrink-0" />
|
||||||
<span class="tab-label">
|
<span class="tab-label">
|
||||||
{getPathBasename(props.instance.folder)}
|
{props.instance.folder.split("/").pop() || props.instance.folder}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class={`status-indicator session-status ml-auto ${statusClassName()}`}
|
class={`status-indicator session-status ml-auto ${statusClassName()}`}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { Session } from "../../../types/session"
|
|||||||
import type { KeyboardShortcut } from "../../../lib/keyboard-registry"
|
import type { KeyboardShortcut } from "../../../lib/keyboard-registry"
|
||||||
import type { DrawerViewState } from "./types"
|
import type { DrawerViewState } from "./types"
|
||||||
|
|
||||||
import { PlusSquare, Search } from "lucide-solid"
|
import { Search } from "lucide-solid"
|
||||||
import IconButton from "@suid/material/IconButton"
|
import IconButton from "@suid/material/IconButton"
|
||||||
import MenuOpenIcon from "@suid/icons-material/MenuOpen"
|
import MenuOpenIcon from "@suid/icons-material/MenuOpen"
|
||||||
import PushPinIcon from "@suid/icons-material/PushPin"
|
import PushPinIcon from "@suid/icons-material/PushPin"
|
||||||
@@ -56,20 +56,6 @@ const SessionSidebar: Component<SessionSidebarProps> = (props) => (
|
|||||||
{props.t("instanceShell.leftPanel.sessionsTitle")}
|
{props.t("instanceShell.leftPanel.sessionsTitle")}
|
||||||
</span>
|
</span>
|
||||||
<div class="flex items-center gap-2 text-primary">
|
<div class="flex items-center gap-2 text-primary">
|
||||||
<IconButton
|
|
||||||
size="small"
|
|
||||||
color="inherit"
|
|
||||||
aria-label={props.t("sessionList.actions.newSession.ariaLabel")}
|
|
||||||
title={props.t("sessionList.actions.newSession.title")}
|
|
||||||
onClick={() => {
|
|
||||||
const result = props.onNewSession()
|
|
||||||
if (result instanceof Promise) {
|
|
||||||
void result.catch((error) => log.error("Failed to create session:", error))
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<PlusSquare class="w-5 h-5" />
|
|
||||||
</IconButton>
|
|
||||||
<IconButton
|
<IconButton
|
||||||
size="small"
|
size="small"
|
||||||
color="inherit"
|
color="inherit"
|
||||||
@@ -85,7 +71,7 @@ const SessionSidebar: Component<SessionSidebarProps> = (props) => (
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Search class="w-5 h-5" />
|
<Search class={props.showSearch() ? "w-4 h-4" : "w-4 h-4 opacity-70"} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ export const sessionMessages = {
|
|||||||
"sessionList.expand.expandAriaLabel": "Expand session",
|
"sessionList.expand.expandAriaLabel": "Expand session",
|
||||||
"sessionList.expand.collapseTitle": "Collapse",
|
"sessionList.expand.collapseTitle": "Collapse",
|
||||||
"sessionList.expand.expandTitle": "Expand",
|
"sessionList.expand.expandTitle": "Expand",
|
||||||
"sessionList.actions.newSession.ariaLabel": "New session",
|
|
||||||
"sessionList.actions.newSession.title": "New session",
|
|
||||||
"sessionList.actions.copyId.ariaLabel": "Copy session ID",
|
"sessionList.actions.copyId.ariaLabel": "Copy session ID",
|
||||||
"sessionList.actions.copyId.title": "Copy session ID",
|
"sessionList.actions.copyId.title": "Copy session ID",
|
||||||
"sessionList.actions.rename.ariaLabel": "Rename session",
|
"sessionList.actions.rename.ariaLabel": "Rename session",
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ export const sessionMessages = {
|
|||||||
"sessionList.expand.expandAriaLabel": "Expandir sesión",
|
"sessionList.expand.expandAriaLabel": "Expandir sesión",
|
||||||
"sessionList.expand.collapseTitle": "Colapsar",
|
"sessionList.expand.collapseTitle": "Colapsar",
|
||||||
"sessionList.expand.expandTitle": "Expandir",
|
"sessionList.expand.expandTitle": "Expandir",
|
||||||
"sessionList.actions.newSession.ariaLabel": "Nueva sesión",
|
|
||||||
"sessionList.actions.newSession.title": "Nueva sesión",
|
|
||||||
"sessionList.actions.copyId.ariaLabel": "Copiar ID de sesión",
|
"sessionList.actions.copyId.ariaLabel": "Copiar ID de sesión",
|
||||||
"sessionList.actions.copyId.title": "Copiar ID de sesión",
|
"sessionList.actions.copyId.title": "Copiar ID de sesión",
|
||||||
"sessionList.actions.rename.ariaLabel": "Renombrar sesión",
|
"sessionList.actions.rename.ariaLabel": "Renombrar sesión",
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ export const sessionMessages = {
|
|||||||
"sessionList.expand.expandAriaLabel": "Développer la session",
|
"sessionList.expand.expandAriaLabel": "Développer la session",
|
||||||
"sessionList.expand.collapseTitle": "Réduire",
|
"sessionList.expand.collapseTitle": "Réduire",
|
||||||
"sessionList.expand.expandTitle": "Développer",
|
"sessionList.expand.expandTitle": "Développer",
|
||||||
"sessionList.actions.newSession.ariaLabel": "Nouvelle session",
|
|
||||||
"sessionList.actions.newSession.title": "Nouvelle session",
|
|
||||||
"sessionList.actions.copyId.ariaLabel": "Copier l'ID de session",
|
"sessionList.actions.copyId.ariaLabel": "Copier l'ID de session",
|
||||||
"sessionList.actions.copyId.title": "Copier l'ID de session",
|
"sessionList.actions.copyId.title": "Copier l'ID de session",
|
||||||
"sessionList.actions.rename.ariaLabel": "Renommer la session",
|
"sessionList.actions.rename.ariaLabel": "Renommer la session",
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ export const sessionMessages = {
|
|||||||
"sessionList.expand.expandAriaLabel": "セッションを展開",
|
"sessionList.expand.expandAriaLabel": "セッションを展開",
|
||||||
"sessionList.expand.collapseTitle": "折りたたむ",
|
"sessionList.expand.collapseTitle": "折りたたむ",
|
||||||
"sessionList.expand.expandTitle": "展開",
|
"sessionList.expand.expandTitle": "展開",
|
||||||
"sessionList.actions.newSession.ariaLabel": "新しいセッション",
|
|
||||||
"sessionList.actions.newSession.title": "新しいセッション",
|
|
||||||
"sessionList.actions.copyId.ariaLabel": "セッション ID をコピー",
|
"sessionList.actions.copyId.ariaLabel": "セッション ID をコピー",
|
||||||
"sessionList.actions.copyId.title": "セッション ID をコピー",
|
"sessionList.actions.copyId.title": "セッション ID をコピー",
|
||||||
"sessionList.actions.rename.ariaLabel": "セッション名を変更",
|
"sessionList.actions.rename.ariaLabel": "セッション名を変更",
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ export const sessionMessages = {
|
|||||||
"sessionList.expand.expandAriaLabel": "Развернуть сессию",
|
"sessionList.expand.expandAriaLabel": "Развернуть сессию",
|
||||||
"sessionList.expand.collapseTitle": "Свернуть",
|
"sessionList.expand.collapseTitle": "Свернуть",
|
||||||
"sessionList.expand.expandTitle": "Развернуть",
|
"sessionList.expand.expandTitle": "Развернуть",
|
||||||
"sessionList.actions.newSession.ariaLabel": "Новая сессия",
|
|
||||||
"sessionList.actions.newSession.title": "Новая сессия",
|
|
||||||
"sessionList.actions.copyId.ariaLabel": "Скопировать ID сессии",
|
"sessionList.actions.copyId.ariaLabel": "Скопировать ID сессии",
|
||||||
"sessionList.actions.copyId.title": "Скопировать ID сессии",
|
"sessionList.actions.copyId.title": "Скопировать ID сессии",
|
||||||
"sessionList.actions.rename.ariaLabel": "Переименовать сессию",
|
"sessionList.actions.rename.ariaLabel": "Переименовать сессию",
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ export const sessionMessages = {
|
|||||||
"sessionList.expand.expandAriaLabel": "展开会话",
|
"sessionList.expand.expandAriaLabel": "展开会话",
|
||||||
"sessionList.expand.collapseTitle": "折叠",
|
"sessionList.expand.collapseTitle": "折叠",
|
||||||
"sessionList.expand.expandTitle": "展开",
|
"sessionList.expand.expandTitle": "展开",
|
||||||
"sessionList.actions.newSession.ariaLabel": "新建会话",
|
|
||||||
"sessionList.actions.newSession.title": "新建会话",
|
|
||||||
"sessionList.actions.copyId.ariaLabel": "复制会话 ID",
|
"sessionList.actions.copyId.ariaLabel": "复制会话 ID",
|
||||||
"sessionList.actions.copyId.title": "复制会话 ID",
|
"sessionList.actions.copyId.title": "复制会话 ID",
|
||||||
"sessionList.actions.rename.ariaLabel": "重命名会话",
|
"sessionList.actions.rename.ariaLabel": "重命名会话",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@import "github-markdown-css/github-markdown-dark.css";
|
@import "github-markdown-css/github-markdown-light.css" layer(github-markdown-base);
|
||||||
|
|
||||||
@layer components {
|
@layer components {
|
||||||
.markdown-body {
|
.markdown-body {
|
||||||
@@ -96,6 +96,7 @@
|
|||||||
.markdown-body code {
|
.markdown-body code {
|
||||||
font-family: var(--font-family-mono);
|
font-family: var(--font-family-mono);
|
||||||
font-size: var(--font-size-sm);
|
font-size: var(--font-size-sm);
|
||||||
|
color: var(--text-primary);
|
||||||
background-color: var(--surface-muted);
|
background-color: var(--surface-muted);
|
||||||
border: 1px solid var(--border-base);
|
border: 1px solid var(--border-base);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@@ -108,17 +109,23 @@
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body pre {
|
.markdown-body pre:not(.shiki) {
|
||||||
font-family: var(--font-family-mono);
|
font-family: var(--font-family-mono);
|
||||||
font-size: var(--font-size-sm);
|
font-size: var(--font-size-sm);
|
||||||
line-height: var(--line-height-normal);
|
line-height: var(--line-height-normal);
|
||||||
background-color: var(--surface-code);
|
background-color: var(--surface-code);
|
||||||
|
color: var(--text-primary);
|
||||||
border: 1px solid var(--border-base);
|
border: 1px solid var(--border-base);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 0.75rem;
|
padding: 0.75rem;
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.markdown-body pre:not(.shiki) code,
|
||||||
|
.markdown-code-block pre:not(.shiki) code {
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
.markdown-body blockquote {
|
.markdown-body blockquote {
|
||||||
border-left: 3px solid var(--border-base);
|
border-left: 3px solid var(--border-base);
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
@@ -168,12 +175,18 @@
|
|||||||
border: 1px solid var(--border-base);
|
border: 1px solid var(--border-base);
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
color: var(--text-primary);
|
||||||
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body th {
|
.markdown-body th {
|
||||||
background-color: var(--surface-secondary);
|
background-color: var(--surface-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.markdown-body tbody tr:nth-child(2n) {
|
||||||
|
background-color: var(--surface-muted);
|
||||||
|
}
|
||||||
|
|
||||||
.markdown-code-block {
|
.markdown-code-block {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user