feat(ux): add mobile catalog filter edge affordance
Deploy Canina / deploy (push) Successful in 2m15s
Deploy Canina / deploy (push) Successful in 2m15s
This commit is contained in:
1 parent
87ad359e60
commit
8672d4bcac
3 files changed
+18
-1
No files matched your search
@@ -140,6 +140,11 @@
|
||||
background: var(--color-canina-blue);
|
||||
}
|
||||
|
||||
/* Mobile catalog filter edge affordances */
|
||||
.catalog-filter-fade { position:absolute; top:0; bottom:2.5rem; width:1.75rem; z-index:1; pointer-events:none; }
|
||||
.catalog-filter-fade-start { inset-inline-start:0; background:linear-gradient(to right, rgba(248,250,252,.96), transparent); }
|
||||
.catalog-filter-fade-end { inset-inline-end:0; background:linear-gradient(to left, rgba(248,250,252,.96), transparent); }
|
||||
|
||||
/* Micro horizontal scrollbar for dark backgrounds (catalog etc.) */
|
||||
.micro-hscroll-dark {
|
||||
scrollbar-width: thin;
|
||||
|
||||
@@ -828,7 +828,8 @@ export default function ArchivePage({
|
||||
|
||||
|
||||
{/* Horizontal Scrollable Row for Sort, Pet Type, Solutions & Symptoms Filter */}
|
||||
<div className="flex items-center gap-2 overflow-x-auto pb-2.5 pt-0.5 micro-hscroll -mx-4 px-4 select-none touch-pan-x mt-2 mb-4">
|
||||
<div className="relative -mx-4 mt-2 mb-4" data-testid="mobile-catalog-filters-edge">
|
||||
<div data-testid="mobile-catalog-filters" aria-label="فیلترهای محصولات" className="flex items-center gap-2 overflow-x-auto pb-2.5 pt-0.5 micro-hscroll px-4 select-none touch-pan-x">
|
||||
|
||||
{/* 1. View Mode Switch: 2 Buttons (List / Card) */}
|
||||
<div className="flex-shrink-0 inline-flex items-center bg-white border border-medical-gray-200 rounded-xl p-0.5 shadow-2xs mr-auto">
|
||||
@@ -1050,6 +1051,9 @@ export default function ArchivePage({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<span aria-hidden="true" className="catalog-filter-fade catalog-filter-fade-start" />
|
||||
<span aria-hidden="true" className="catalog-filter-fade catalog-filter-fade-end" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -164,6 +164,14 @@ describe("ArchivePage Component", () => {
|
||||
expect(screen.getByLabelText("مرتبسازی محصولات")).toBeTruthy();
|
||||
});
|
||||
|
||||
it("exposes a scroll affordance for the mobile filter row", () => {
|
||||
render(<ArchivePage initialProducts={mockProducts as any} />);
|
||||
|
||||
const filterRow = screen.getByTestId("mobile-catalog-filters");
|
||||
expect(filterRow).toHaveAttribute("aria-label", "فیلترهای محصولات");
|
||||
expect(screen.getByTestId("mobile-catalog-filters-edge")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
|
||||
Reference in new issue
Block a user