mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat(session-manager): show source file name in session detail header (#4113)
* feat(session-manager): show source file name in session detail header Display the session log file name (with full path on hover) alongside the project directory, so users can locate and copy the underlying JSONL file directly from the UI. * fix(session-manager): truncate long source file name in detail header Long, space-less JSONL basenames (e.g. Codex rollout files at ~70 chars) overflowed the flex meta row and bled into the action-button area on narrow windows. Mirror the sibling project-dir span by capping the filename at max-w-[200px] with truncation; the full path stays available via the hover tooltip and click-to-copy. --------- Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
MessageSquare,
|
||||
Clock,
|
||||
FolderOpen,
|
||||
FileText,
|
||||
X,
|
||||
CheckSquare,
|
||||
} from "lucide-react";
|
||||
@@ -897,6 +898,38 @@ export function SessionManagerPage({ appId }: { appId: string }) {
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
{selectedSession.sourcePath && (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
void handleCopy(
|
||||
selectedSession.sourcePath!,
|
||||
t("sessionManager.sourcePathCopied"),
|
||||
)
|
||||
}
|
||||
className="flex items-center gap-1 hover:text-foreground transition-colors"
|
||||
>
|
||||
<FileText className="size-3 shrink-0" />
|
||||
<span className="font-mono truncate max-w-[200px]">
|
||||
{getBaseName(selectedSession.sourcePath)}
|
||||
</span>
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent
|
||||
side="bottom"
|
||||
className="max-w-xs"
|
||||
>
|
||||
<p className="font-mono text-xs break-all">
|
||||
{selectedSession.sourcePath}
|
||||
</p>
|
||||
<p className="text-muted-foreground mt-1">
|
||||
{t("sessionManager.clickToCopyPath")}
|
||||
</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user