feat(web): show project name on pinned running session rows

This commit is contained in:
2026-08-02 22:56:23 +08:00
parent 35dc65afa6
commit 7aeb4dbb38
2 changed files with 12 additions and 2 deletions
+4 -1
View File
@@ -765,9 +765,10 @@ function SessionItem(props: {
selected?: boolean
showDetailedStatus?: boolean
inRunningSection?: boolean
projectLabel?: string
}) {
const { t } = useTranslation()
const { session: s, onSelect, showPath = true, api, selected = false, showDetailedStatus = false, inRunningSection = false } = props
const { session: s, onSelect, showPath = true, api, selected = false, showDetailedStatus = false, inRunningSection = false, projectLabel } = props
const { haptic } = usePlatform()
const [menuOpen, setMenuOpen] = useState(false)
const [menuAnchorPoint, setMenuAnchorPoint] = useState<{ x: number; y: number }>({ x: 0, y: 0 })
@@ -861,6 +862,7 @@ function SessionItem(props: {
attentionTooltipId={attentionId}
scheduleTooltipId={scheduleId}
inRunningSection={inRunningSection}
projectLabel={projectLabel}
/>
</button>
@@ -1431,6 +1433,7 @@ export function SessionList(props: {
selected={s.id === selectedSessionId}
showDetailedStatus={showDetailedStatus}
inRunningSection
projectLabel={getGroupDisplayName(s.metadata?.worktree?.basePath ?? s.metadata?.path ?? 'Other')}
/>
))}
</div>
+8 -1
View File
@@ -113,6 +113,8 @@ export function SessionRowSummary(props: {
className?: string
/** Rows inside the pinned "in progress" section skip the text label (dot only). */
inRunningSection?: boolean
/** Short project name shown under the title (pinned "in progress" rows). */
projectLabel?: string
}) {
const {
session: s,
@@ -124,6 +126,7 @@ export function SessionRowSummary(props: {
scheduleTooltipId: scheduleTooltipIdProp,
className,
inRunningSection = false,
projectLabel,
} = props
const { t } = useTranslation()
const sessionName = getSessionTitle(s)
@@ -242,7 +245,11 @@ export function SessionRowSummary(props: {
) : null}
</div>
</div>
{showPath || worktreeLabel ? (
{projectLabel ? (
<div className="truncate text-xs text-[var(--app-hint)]" title={projectLabel}>
{projectLabel}
</div>
) : showPath || worktreeLabel ? (
<div
className="truncate text-xs text-[var(--app-hint)]"
title={worktreeLabel