fix(registry): личный порядок колонок для всех ролей (#16, 2.4.3) - #21
Merged
Merged
Conversation
Reordering registry columns was admin-only: the order was stored tenant-wide (one shared layout, PUT /admin/preferences/column-order), so editors and viewers could only toggle columns on/off, not drag-reorder them. Per the product decision, column order becomes a personal view preference (like column visibility, which is already per-user in localStorage): - Every role can drag / ↑↓ reorder their own columns; the arrangement is saved per user in localStorage (`lotsman_column_order_<userId>`). - Effective order = personal (localStorage) → tenant-wide admin order (seed) → built-in default. No one changes anyone else's view. - Admin reorder still writes the tenant-wide default for users who haven't personalised; «По умолчанию» clears the personal order. - Pinning a column and renaming a column stay admin-only (they change the shared default) — gated by a new `canManageLayout` prop, split out from `canReorder` so non-admins never hit the admin-only endpoints (no 403). Frontend-only — backend, schema and contracts unchanged. tsc clean; biome shows only pre-existing version-drift noise; no test regressions (the 8 failing registry tests are the pre-existing useSearch-mock failures, confirmed via git stash). Built and deployed to PreProd (version.json 2.4.3, login 200). Closes #16 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Закрывает #16.
Проблема
Роль Редактор (и Наблюдатель) в панели «Колонки» могла только включать/выключать колонки, но не перетаскивать их — кнопок drag/стрелок не было. У администратора перетаскивание работало.
Причина (анализ)
Порядок колонок хранился общим на всю организацию (
registry.tenant_preferences, ключregistry.column_order; PUT/admin/preferences/column-order— только админ). То есть это была намеренно общая, курируемая админом настройка — поэтому drag был подcanReorder={isAdmin}, а у не-админа эндпоинт вернул бы 403. При этом видимость колонок — личная (localStorage).Решение (согласовано: личный порядок у каждого)
Порядок колонок становится личной настройкой вида (как и видимость):
localStorage(lotsman_column_order_<userId>).canManageLayout, отделённый отcanReorder, чтобы не-админ не дёргал admin-эндпоинты (никаких 403).Проверки
useSearch-mock, подтвержденоgit stash).version.json = 2.4.3, бандл содержит личный ключ порядка, login 200 / API 401.🤖 Generated with Claude Code