feat(workspace): the home's context card follows the scroll; no scrollbar
On the workspace home the Instructions / Memory / Context / Folder card is sticky inside the home's scroller (scrolling itself, barless, when taller than the window), and the home column hides its scrollbar — wheel and touch still scroll it.
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
* @file WorkspaceContext — a workspace's context: Instructions, Memory
|
||||
* (read-only), Context files and Folders (`GET/PUT/POST/DELETE
|
||||
* /api/lanes/:id/sources…`, see server/lib/lane-sources.js). Shown as the
|
||||
* workspace home's right column and, `compact`, folded at the bottom of the
|
||||
* workspace home's right column (sticky: it follows the home's scroll) and,
|
||||
* `compact`, folded at the bottom of the
|
||||
* session view's Changes panel. Folder suggestions are the repo's untracked
|
||||
* worktrees from `GET /api/projects`, filtered by Settings → Worktrees; the
|
||||
* same form clones related repos beside the workspace (`CloneSourcesForm`).
|
||||
@@ -157,7 +158,13 @@ function ContextBody({
|
||||
<aside
|
||||
data-testid="workspace-context"
|
||||
aria-label={t("home.contextPanel")}
|
||||
className={compact ? "" : "card w-80 shrink-0 self-start p-0"}
|
||||
// On the home it follows the scroll (sticky in the home's scroller),
|
||||
// scrolling itself — without a bar — when taller than the window.
|
||||
className={
|
||||
compact
|
||||
? ""
|
||||
: "card no-scrollbar sticky top-2 max-h-[calc(100vh-7rem)] w-80 shrink-0 self-start overflow-y-auto p-0"
|
||||
}
|
||||
>
|
||||
{view && !view.supported && (
|
||||
<p className="border-b border-border px-4 py-3 text-xs text-status-warning">
|
||||
|
||||
@@ -1358,7 +1358,8 @@ export function Workspace() {
|
||||
// `relative`: the home's absolutely placed bits (a row's sr-only
|
||||
// label) must be clipped by THIS scroller — placed against the
|
||||
// row outside it they stretched the page into an empty scroll.
|
||||
className={`relative min-h-0 min-w-0 flex-1 overflow-y-auto${
|
||||
// No visible scrollbar: the wheel and touch still scroll it.
|
||||
className={`no-scrollbar relative min-h-0 min-w-0 flex-1 overflow-y-auto${
|
||||
changesOpen && changesFull ? " hidden" : ""
|
||||
}${changesOpen && !changesFull ? " pr-5" : ""}`}
|
||||
>
|
||||
|
||||
@@ -1208,7 +1208,11 @@ describe("Workspace — home and session view", () => {
|
||||
expect(screen.getByTestId("workspace-home-column").parentElement).not.toHaveClass("hidden");
|
||||
// Its own scroller contains its absolutely placed bits (sr-only labels),
|
||||
// or they stretch the page past the viewport.
|
||||
expect(screen.getByTestId("workspace-home-column")).toHaveClass("relative", "overflow-y-auto");
|
||||
expect(screen.getByTestId("workspace-home-column")).toHaveClass(
|
||||
"relative",
|
||||
"overflow-y-auto",
|
||||
"no-scrollbar"
|
||||
);
|
||||
expect(
|
||||
screen.queryByTestId("lane-changes-card") ?? screen.queryByTestId("lane-changes-expand")
|
||||
).not.toBeNull();
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user