Skip to content

feat(Filter): new component (revived from dev-plan-checklist) - #481

Draft
IgorShevchik wants to merge 7 commits into
mainfrom
revive/filter-component
Draft

feat(Filter): new component (revived from dev-plan-checklist)#481
IgorShevchik wants to merge 7 commits into
mainfrom
revive/filter-component

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Frozen — draft on purpose, and red on purpose. Opened to preserve a large stranded component and to record exactly what standing between it and main is. Do not merge as-is: CI fails 10 guard assertions, listed below. Un-freezing means doing that adaptation work first.

Linked issue

Revives claude/dev-plan-checklist-RrfmF — seven commits, 2026-05-11/12. The original branch is untouched.

Why this exists

main was re-rooted at b55bd3e7 (2026-07-10) and now holds 173 commits. This branch shares no merge base with it, so a PR from it reads as deleting most of the repo. The seven authored commits are cherry-picked onto current main instead.

Two cherry-pick conflicts came up and were resolved toward current main, not the May version — these are the only edits on top of the originals:

  • useComponentProps.tsmain has since moved ThemeDefaults/ThemeUI out of this file; kept main's version.
  • the filter? theme-defaults entry moved from useComponentProps.ts to its current home, src/runtime/types/theme.ts.

Type of change

  • New feature (a non-breaking change that adds functionality)

What it adds

A Filter component and its parts — FilterBar, FilterField, FilterPanel, FilterPresets, FilterFieldsEditor, FilterSortableList — plus types, op guards, theme, a locale strings bundle, docs, playground pages, a skill entry and planning docs under docs/plans/. 13 source files, ~2000 lines.

The component itself is intact: test/components/Filter.spec.ts passes (28 tests) and build succeeds. What fails is four families of cross-cutting guards that this fork adopted after May, and which the branch necessarily predates.

What blocks it — the 10 red assertions

guard count what it wants why the branch trips it
icon-dictionary 4 glyphs read from dictionary/icons by role FilterBar/FilterField/FilterPresets import Search1Icon, CrossLIcon, PlusIcon, DragLIcon directly, each duplicating a role the dictionary already owns (search, close, plus, drag)
locale 2 (nuxt+vue) every file in src/runtime/locale/ is a UI locale exported from the index locale/filter.ts is not a language file — it is the component's Russian strings bundle, misfiled there; it needs a different home
docs-component-registries 2 every component page listed in docs/nuxt.config.ts pages filter.md was added before that registry guard existed, so it is unregistered
skill-manifest 2 each skill index row resolves to a doc the B24Filter row and its filter.md badge/link need reconciling

None of these is a defect in the feature; each is a convention that did not exist when the branch was written. Fixing them is real adaptation — dictionary-icon swaps, relocating the strings bundle out of the locale system, registering the page, and the skill row — and touches the component's design, so it is left for whoever un-freezes this, not smuggled in here.

Verification

Run as recorded, CI=true: dev:prepare · lint (clean) · typecheck (clean) · build (clean) · test10 failed, 7146 passed, 6 skipped across the four guard specs above; the component's own suite is green.

Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Generated by Claude Code

claude added 7 commits August 24, 2026 06:01
Plan, spec, and morning checklist for the upcoming Filter component.
No code yet — implementation starts after review.

https://claude.ai/code/session_012S8FTBQd7v2E5nG868nxLh
Adds FilterFieldType, FilterOperator, FilterFieldConfig,
FilterFieldCondition (discriminated union), FilterValue,
FilterDateValue, FilterPreset, FilterBarTag, and FilterLocale
in src/runtime/types/filter.ts, plus operator type-guard helpers
in src/runtime/utils/filter.ts.

https://claude.ai/code/session_012S8FTBQd7v2E5nG868nxLh
Adds the composite Filter component modelled after the native Bitrix24 filter:

- Filter.vue: public root, orchestrates state, adaptive Popover/Drawer via
  useDevice, auto-applies a pinned preset on first load.
- FilterBar.vue: search input + chips (preset / condition / counter +N),
  trailing search/clear/settings buttons, debounced search.
- FilterPanel.vue: layout container.
- FilterPresets.vue: list with active state, system-preset gating,
  inline rename/save, DnD reordering, keyboard reorder via menu.
- FilterFieldsEditor.vue: active field list, add via CommandPalette popover,
  reset defaults, Find / Reset actions.
- FilterField.vue: per-type controls (string, number, money, date, time,
  select, multiselect, boolean) + custom-type slot, filled/empty operator
  hides the value control.
- FilterSortableList.vue: thin wrapper over @vueuse/integrations/useSortable.
- Theme src/theme/filter.ts with slots for the full anatomy.
- defaultFilterLocale in src/runtime/locale/filter.ts (Russian defaults).
- Utility helpers in utils/filter-format.ts (conditionLabel).
- Registered in ThemeDefaults and theme index.

https://claude.ai/code/session_012S8FTBQd7v2E5nG868nxLh
- test/components/Filter.spec.ts: 14 cases — renderEach snapshot grid + emit
  apply payload, reset semantics, unknown-field filtering, unknown-operator
  drop, auto-pin on first mount, imperative API.
- docs/content/docs/2.components/filter.md: usage, presets, field types,
  custom-type slot, adaptive layout, operators, date values, DnD, locale,
  imperative API, props/emits/slots reference, security notes.
- playgrounds/nuxt/app/pages/components/filter.vue: interactive demo with
  6 fields (incl. custom user picker via slot), 3 system presets, all main
  controls.
- skills/b24-ui-nuxt/references/components.md: B24Filter entry.

Lint and typecheck included. Tightens emit typings to tuple form to satisfy
@typescript-eslint/unified-signatures, swaps a few inline `as T | undefined`
casts in templates for computeds to avoid vue/no-deprecated-filter parse,
and replaces dynamic `delete` with object-rebuild for no-dynamic-delete.

https://claude.ai/code/session_012S8FTBQd7v2E5nG868nxLh
- Merge filter-component-spec.md + filter-component-plan.md into a single
  filter-component.md (Russian, spec → plan order).
- Replace the morning checklist with filter-implementation-notes.md
  (English, internal companion document).
- Drop the three original files.

https://claude.ai/code/session_012S8FTBQd7v2E5nG868nxLh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants