-
Notifications
You must be signed in to change notification settings - Fork 120
Align plugin browse cards and filters #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
brsbl
merged 2 commits into
bb/capability-name-typography-thr_cxz5rwzns3
from
bb/plugin-browse-card-filter-polish-thr_cxz5rwzns3
Aug 4, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 77 additions & 16 deletions
93
apps/app/src/components/secondary-panel/SecondaryPanelTabStrip.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,90 @@ | ||
| // @vitest-environment jsdom | ||
|
|
||
| import { act, cleanup, render } from "@testing-library/react"; | ||
| import { createElement } from "react"; | ||
| import { afterEach, vi } from "vitest"; | ||
| import { describe, expect, it } from "vitest"; | ||
| import { | ||
| getTabStripChevronEdgeClass, | ||
| getTabStripChevronVisibilityClass, | ||
| SecondaryPanelTabStrip, | ||
| SECONDARY_PANEL_TAB_STRIP_FADE_TONE, | ||
| } from "./SecondaryPanelTabStrip"; | ||
|
|
||
| afterEach(() => { | ||
| cleanup(); | ||
| vi.unstubAllGlobals(); | ||
| }); | ||
|
|
||
| describe("secondary panel tab-strip edge fades", () => { | ||
| it("uses one opaque themed edge fade and no second caret gradient", () => { | ||
| it("uses the themed edge fade without overlay scroll controls", () => { | ||
| expect(SECONDARY_PANEL_TAB_STRIP_FADE_TONE).toBe("sidebar"); | ||
| expect(getTabStripChevronEdgeClass("left")).toBe( | ||
| "left-0 justify-start", | ||
| ); | ||
| expect(getTabStripChevronEdgeClass("right")).toBe( | ||
| "right-0 justify-end", | ||
| ); | ||
| }); | ||
|
|
||
| it("keeps an available scroll control visible without requiring hover", () => { | ||
| const visibleClass = getTabStripChevronVisibilityClass(true); | ||
| it("observes the intrinsic tab row so async title changes refresh overflow", () => { | ||
| const observed: Element[] = []; | ||
| let resizeCallback: ResizeObserverCallback | undefined; | ||
| vi.stubGlobal( | ||
| "ResizeObserver", | ||
| class { | ||
| constructor(callback: ResizeObserverCallback) { | ||
| resizeCallback = callback; | ||
| } | ||
| observe(element: Element) { | ||
| observed.push(element); | ||
| } | ||
| disconnect() {} | ||
| }, | ||
| ); | ||
|
|
||
| const { container } = render( | ||
| createElement(SecondaryPanelTabStrip, { | ||
| fileTabs: [ | ||
| { | ||
| id: "browser", | ||
| filename: "Browser", | ||
| isActive: true, | ||
| isPinned: false, | ||
| leadingVisual: null, | ||
| statusLabel: null, | ||
| onSelect: vi.fn(), | ||
| onClose: vi.fn(), | ||
| }, | ||
| ], | ||
| onReorderTab: vi.fn(), | ||
| usesDesktopChrome: false, | ||
| }), | ||
| ); | ||
|
|
||
| expect(visibleClass).toContain("pointer-events-auto"); | ||
| expect(visibleClass).toContain("opacity-100"); | ||
| expect(visibleClass).not.toContain("hover:"); | ||
| expect(getTabStripChevronVisibilityClass(false)).toBe( | ||
| "pointer-events-none opacity-0", | ||
| const viewport = container.querySelector(".no-scrollbar"); | ||
| const content = container.querySelector( | ||
| "[data-secondary-panel-tab-content]", | ||
| ); | ||
| expect(content).not.toBeNull(); | ||
| expect(observed).toContain(viewport); | ||
| expect(observed).toContain(content); | ||
| expect(resizeCallback).toBeDefined(); | ||
| expect(container.querySelectorAll("[data-overflow-fade]")).toHaveLength(2); | ||
| expect( | ||
| container | ||
| .querySelector("[data-overflow-fade='left']") | ||
| ?.classList.contains("w-6"), | ||
| ).toBe(true); | ||
| expect( | ||
| container.querySelector('[aria-label="Scroll tabs left"]'), | ||
| ).toBeNull(); | ||
| expect( | ||
| container.querySelector('[aria-label="Scroll tabs right"]'), | ||
| ).toBeNull(); | ||
|
|
||
| const rightFade = container.querySelector("[data-overflow-fade='right']"); | ||
| expect(rightFade?.classList.contains("opacity-0")).toBe(true); | ||
| Object.defineProperties(viewport!, { | ||
| clientWidth: { configurable: true, value: 120 }, | ||
| scrollWidth: { configurable: true, value: 240 }, | ||
| scrollLeft: { configurable: true, value: 0, writable: true }, | ||
| }); | ||
| act(() => { | ||
| resizeCallback?.([], {} as ResizeObserver); | ||
| }); | ||
| expect(rightFade?.classList.contains("opacity-100")).toBe(true); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨
slopcop/review— Keep the description height in the shared browse card.ResourceBrowseCardalready ownsdescriptionLinesand its line clamp. This local wrapper aligns only plugin cards.Add the minimum height beside the shared clamp. This keeps plugin, skill, and template cards consistent.