diff --git a/.gitignore b/.gitignore index 7cf105f..e62efc9 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,28 @@ testem.log # System files .DS_Store Thumbs.db + + +.context-state/ +.context-cache/ +.barry-cache/ + +AGENTS.md +CLAUDE.md +GEMINI.md +llms.txt +.cursor/rules/barry-cache.mdc +.github/copilot-instructions.md +docs/context/INDEX.md +docs/context/LOG.md +docs/context/MAINTENANCE.md +docs/context/README.md +docs/context/adrs/README.md +docs/context/concepts/project-context-model.md +docs/context/schema/adr.schema.json +docs/context/schema/fact.schema.json +docs/context/schema/failure.schema.json +docs/context/schema/route.schema.json +docs/context/schema/strategy.schema.json +docs/context/schema/work-state.schema.json +docs/context/schema/workspace.schema.json diff --git a/docs/Catalog-UX-Architecture.md b/docs/Catalog-UX-Architecture.md new file mode 100644 index 0000000..3f0a17b --- /dev/null +++ b/docs/Catalog-UX-Architecture.md @@ -0,0 +1,104 @@ +# Catalog UX, Navigation and Loading Strategies - Sprint 16 + +## Scope + +Sprint 16 improves catalog UX without introducing marketplace-specific logic. + +Areas covered: +- empty category behavior +- root navigation consistency +- multiple loading strategies +- grid selector completion +- mobile catalog behavior +- future slug routing preparation +- reusable catalog states +- centralized feature flags +- project skills documentation + +## Empty Category Behavior + +Catalog now distinguishes three category outcomes: +- subcategories exist: show category browser +- products exist: show product list +- neither exist: show dedicated catalog empty state + +Empty category state belongs to catalog surface, not product grid. + +## Root Navigation + +`All Categories` always routes to `/catalog` and shows category browser. + +Continue-browsing restoration no longer hijacks this root navigation path. + +## Loading Strategies + +Configured via `catalog.loadingStrategy`: +- `pagination` +- `loadMore` +- `infiniteScroll` + +Single product list component remains source of truth. Strategy changes only affect controls and page-windowing. + +## Grid System + +Supported layouts: +- `grid-2` +- `grid-3` +- `grid-4` +- `list` +- `compact` + +User preference persists locally. Bootstrap default still seeds first render. + +Legacy layout aliases normalize to new modes for backward compatibility. + +## Mobile Behavior + +Mobile catalog uses: +- filter drawer +- sort popup sheet +- grid popup sheet + +Inline filter density is avoided. + +## Breadcrumb and Slug Preparation + +Current URLs remain ID-based. + +Routing layer now tolerates future slug-like category tokens by resolving them to internal IDs without changing current public contract. + +## Centralized Features + +`bootstrap.features` is new central toggle surface for UI features such as: +- wishlist +- compare +- reviews +- comments +- questions +- recommendations +- recentlyViewed +- searchHistory +- recentlySearched +- ratings +- share +- brands +- manufacturers +- availability +- discounts +- badges + +Feature resolver falls back to older config surfaces to preserve behavior. + +## Project Skills + +Added repo skills: +- `.agents/skills/marketplace-architecture/SKILL.md` +- `.agents/skills/ui-standards/SKILL.md` +- `.agents/skills/backend-contract/SKILL.md` + +## Future Work + +- true backend paging for load-more/infinite strategies +- offline-aware cached catalog data +- explicit slug field on categories +- admin editing surface for centralized feature toggles diff --git a/docs/platform/08-catalog-domain.md b/docs/platform/08-catalog-domain.md index 1b8c025..eb3b0d3 100644 --- a/docs/platform/08-catalog-domain.md +++ b/docs/platform/08-catalog-domain.md @@ -16,6 +16,7 @@ ## Опциональные свойства - catalog.navigationMode +- catalog.loadingStrategy - catalog.showBreadcrumbs - catalog.showCategoryBanner - catalog.showSubcategoryChips @@ -24,12 +25,16 @@ - catalog.showAvailability - catalog.suggestionsEnabled - catalog.searchHistoryEnabled +- catalog.features (via bootstrap.features) - catalog.facets (future backend-driven) ## Строгие правила - Каталог не содержит tenant-specific условий в frontend-коде. - Сортировка и фильтры должны быть согласованы между frontend и backend. - Видимость товаров контролируется данными backend, а не frontend-хардкодом. +- Пустая категория рендерит отдельный catalog empty-state, а не product grid empty-state. +- Корневой переход `All Categories` всегда возвращает category browser `/catalog`. +- Loading strategy выбирается конфигурацией без дублирования list logic. ## Reusable Domain Models - SearchCriteria @@ -43,7 +48,8 @@ ```json { "catalog": { - "layout": "grid", + "layout": "grid-4", + "loadingStrategy": "pagination", "defaultSort": "relevance", "availableSorts": ["relevance", "latest", "price_asc", "price_desc", "rating", "popular", "discount"], "enabledFilters": ["price", "availability", "rating", "brand", "category", "subcategory", "discount", "new", "color", "size", "attributes"], @@ -54,6 +60,23 @@ } ``` +## Loading Strategies +- `pagination` +- `loadMore` +- `infiniteScroll` + +## Grid Modes +- `grid-2` +- `grid-3` +- `grid-4` +- `list` +- `compact` + +Legacy aliases still normalize safely: +- `grid` +- `large-grid` +- `compact-grid` + ## Ответственность Frontend - Отобразить листинг, фильтры, сортировки и пагинацию. - Синхронизировать состояние каталога с URL. diff --git a/docs/platform/11-navigation-system.md b/docs/platform/11-navigation-system.md index 652bafd..e882c77 100644 --- a/docs/platform/11-navigation-system.md +++ b/docs/platform/11-navigation-system.md @@ -3,6 +3,11 @@ - Static pages with `showInFooter: true` may be grouped into footer sections using `footerGroup`. - Social links remain footer-config driven and can coexist with CMS page groups. - Navigation stays configuration-driven; no marketplace-specific page names are hardcoded in frontend. + +## Catalog Routing Preparation +- Catalog root `/catalog` renders category browser. +- Category detail keeps current ID routes while resolving future slug tokens in routing layer. +- Breadcrumb root action must always navigate to `/catalog`, not all-products grid. # 11. Система навигации ## Назначение diff --git a/package.json b/package.json index f9ff004..7c1416c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,12 @@ "watch": "ng build --watch --configuration development", "arch:check:boundaries": "node tools/architecture/check-boundaries.mjs", "arch:check:cycles": "npx --yes madge --circular --extensions ts src/app --ts-config tsconfig.app.json", - "arch:check": "npm run arch:check:boundaries ; npm run arch:check:cycles" + "arch:check": "npm run arch:check:boundaries ; npm run arch:check:cycles", + "barry": "barry-cache", + "barry:validate": "barry-cache validate", + "barry:resume": "barry-cache resume", + "barry:finalize": "barry-cache finalize", + "barry:failure": "barry-cache failure" }, "private": true, "dependencies": { @@ -34,6 +39,7 @@ "@angular/build": "21.1.5", "@angular/cli": "21.1.5", "@angular/compiler-cli": "21.1.5", - "typescript": "~5.9.3" + "typescript": "~5.9.3", + "barry-cache": "^0.1.0" } } diff --git a/src/app/components/header/header.component.html b/src/app/components/header/header.component.html index a81ad1c..6a9491c 100644 --- a/src/app/components/header/header.component.html +++ b/src/app/components/header/header.component.html @@ -53,7 +53,7 @@