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
6 changes: 4 additions & 2 deletions apps/desktop/src/renderer/styles/workbar/shell.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@
}

.maka-session-workbar-panel[data-overlay][data-placement="right"] {
/* One stretched track, like the frame: the face fills the height and the
column can be aligned as a whole. */
/* One minmax track keeps the active face inside the overlay's available
height. An implicit auto track grows to the face's full content height,
leaving its own overflow scroller with nothing to scroll. */
display: grid;
grid-template-rows: minmax(0, 1fr);
padding-top: var(--maka-plate-titlebar-clearance);
}

Expand Down
19 changes: 17 additions & 2 deletions apps/desktop/stories/session-workbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ const fileLineCapGitReviewSnapshot: GitReviewSnapshot = {
// Source-level truncation: a large changeset whose file list the source capped,
// so `truncated` is set and the panel shows its 变化过多 banner. Each file is
// ordinary — no single file trips the per-file cap here.
const sourceTruncatedFiles: GitReviewSnapshot['files'] = Array.from({ length: 24 }, (_, index) => {
const sourceTruncatedFiles: GitReviewSnapshot['files'] = Array.from({ length: 40 }, (_, index) => {
const path = `src/feature-${String(index).padStart(2, '0')}.ts`;
return {
path,
Expand Down Expand Up @@ -1162,7 +1162,22 @@ export const ChangesTruncated: Story = {
decorators: [bridge({ review: { ok: true, snapshot: sourceTruncatedGitReviewSnapshot } })],
render: () => <Workbar tab="review" />,
play: async ({ canvasElement }) => {
await within(canvasElement).findByText('变化过多,仅显示前一部分文件');
const canvas = within(canvasElement);
await canvas.findByText('变化过多,仅显示前一部分文件');
await userEvent.click(await canvas.findByRole('button', { name: '再显示 20 个文件' }));

const panel = canvasElement.querySelector<HTMLElement>('.maka-session-review-panel');
if (!panel) throw new Error('the changes panel is missing');
await waitFor(() => {
expect(
canvasElement.querySelectorAll('.maka-session-review-file').length,
).toBe(40);
expect(panel.scrollHeight).toBeGreaterThan(panel.clientHeight);
});

panel.scrollTop = panel.scrollHeight;
await waitFor(() => expect(panel.scrollTop).toBeGreaterThan(0));
panel.scrollTop = 0;
},
};

Expand Down