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
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,45 @@ afterEach(() => {
});

describe('WebShellSidebar collapsed session group persistence', () => {
it('shows the complete session name in a native tooltip', async () => {
renderSidebar();
await flushSidebar();

const sessionName = container.querySelector<HTMLElement>(
'[title="API review"]',
);
expect(sessionName?.textContent).toContain('API review');
});

it('shows the complete archived session name in a native tooltip', async () => {
connection.capabilities = {
qwenCodeVersion: '1.2.3',
features: ['session_organization', 'session_archive'],
};
archived.sessions = [
makeSession('session-archived', {
displayName: 'Archived task',
isArchived: true,
}),
];
archived.data = archived.sessions;

renderSidebar();
await flushSidebar();

const archivedHeader = Array.from(
container.querySelectorAll<HTMLButtonElement>('button[aria-expanded]'),
).find((btn) => btn.textContent?.includes('Archived'));
expect(archivedHeader).not.toBeNull();
act(() => click(archivedHeader!));
await flushSidebar();

const sessionName = container.querySelector<HTMLElement>(
'[title="Archived task"]',
);
expect(sessionName?.textContent).toContain('Archived task');
});

it('writes collapsed section ids with the qwen-code-web-shell-* key', async () => {
renderSidebar();
await flushSidebar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2808,7 +2808,9 @@ export function WebShellSidebar({
busy && styles.busySession,
)}
>
<span className={styles.sessionText}>{label}</span>
<span className={styles.sessionText} title={label}>
{label}
</span>
<div className={styles.sessionMetaSlot}>
Comment thread
qwen-code-dev-bot marked this conversation as resolved.
<span className={styles.sessionTime}>{time}</span>
{hasArchivedActions && (
Expand Down Expand Up @@ -2966,7 +2968,7 @@ export function WebShellSidebar({
</form>
) : (
<>
<span className={styles.sessionText}>
<span className={styles.sessionText} title={label}>
{session.worktree && (
<GitForkIcon
size={11}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function renderSection(
onOpenGitDiff: (cwd: string) => void;
client: DaemonClient;
reloadToken: number;
expanded: boolean;
}> = {},
): void {
act(() => {
Expand All @@ -79,6 +80,7 @@ function renderSection(
workspace={overrides.workspace ?? trustedWorkspace}
client={overrides.client ?? makeClient()}
reloadToken={overrides.reloadToken ?? 0}
expanded={overrides.expanded}
untrustedLabel="Untrusted"
readOnlyLabel="Read-only"
trustToOpenLabel="Trust to open"
Expand Down Expand Up @@ -132,6 +134,34 @@ describe('WorkspaceSection label', () => {
expect(container.textContent).toContain('Payments API');
expect(container.textContent).not.toContain('project');
});

it('shows the complete read-only session name in a native tooltip', async () => {
const listWorkspaceSessions = vi.fn().mockResolvedValue([
{
sessionId: 'session-1',
displayName: 'A very long session name',
createdAt: '2026-01-01T00:00:00.000Z',
} as DaemonSessionSummary,
]);
const client = {
workspaceByCwd: vi.fn(() => ({
workspaceGit,
listWorkspaceSessions,
listSessionGroups: vi.fn().mockResolvedValue({ groups: [] }),
})),
} as unknown as DaemonClient;

renderSection({
workspace: untrustedWorkspace,
client,
expanded: true,
});
await flush();

expect(
container.querySelector('[title="A very long session name"]'),
).not.toBeNull();
});
});

describe('WorkspaceSection git chip', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,9 @@ export function WorkspaceSection({
role="note"
aria-label={`${label}${time ? `, ${time}` : ''}. ${trustToOpenLabel}`}
>
<span className={styles.sessionName}>{label}</span>
<span className={styles.sessionName} title={label}>
{label}
</span>
{time && <span className={styles.sessionTime}>{time}</span>}
</div>
);
Expand Down
Loading