Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
87b813c to
51c5974
Compare
| миграцией V8 (V7 занята версионированием #109). Реализация начинается после него; если этот change окажется | ||
| первым, миграция колонки переходит сюда вместе с учётом признака в начальных значениях новых тем, журнале и | ||
| откате. | ||
| - [Сессия редактора восстанавливает записи общими маршрутами] → `PUT /tenants/{id}/token-values` и общие |
There was a problem hiding this comment.
Восстановление правок не сохраняет изменение overridden.
Восстановление поручено общей сессии через PUT token-values, которому предписано сохранять существующий overridden. Но в базе #109 локальная запись TokenChange содержит значения платформ без этого признака.
Если пользователь добавит своё значение Android и закроет страницу до сохранения, восстановление запишет число, но оставит overridden: false. Следующая правка веба затрёт Android. При удалении своего значения возможна обратная ситуация: останется true.
Нужно сохранять и повторять исходную команду size-tokens с platforms либо расширить общий формат восстановления явным изменением overridden. Нужны сценарии восстановления добавления и удаления своего значения до подтверждения сервером.
| - **WHEN** ответ создания не получен из-за сети или `5xx` | ||
| - **THEN** клиент MUST повторить запрос с тем же `Idempotency-Key` и тем же телом, чтобы токен не создался дважды | ||
|
|
||
| ### Requirement: Удаление токена размеров |
There was a problem hiding this comment.
Подтверждение удаления проверяет выбранную тень вместо всего размера.
Подтверждение требуется только при использовании выбранного токена, а API удаляет сразу четыре варианта размера. Например, выбранный up.soft.m может не использоваться, тогда как down.hard.m используется компонентами. По сценарию «Токен без связей» клиент удалит весь размер без подтверждения и сбросит ссылки компонентов.
Нужно определять необходимость подтверждения по объединению использований всех четырёх вариантов и показывать в окне полный список затронутых компонентов.
…isions Add token_value_revisions.overridden and token_value_creation_baselines.overridden (V8). The flag is a subject field of a value revision: the token-value journal handler shows it, the creation baseline and the field reverter restore it, new themes start with false, and every shared value write (token-values PUT, color tokens, palette rewrites, token value API, theme initializer) keeps the flag of the latest revision instead of resetting it.
Read radii, spacing and shadows from token_revisions and token_value_revisions on the transaction boundary with versionId (canEdit is false on a published version) and component usage and derived radii from the latest revisions of component configurations on the same boundary. A value change locks the design system and the token values, rereads them and writes draft revisions of the changed values only with the /value and /overridden paths and a per-platform base revision. Creation writes definitions and values in every theme under the name key lock with Idempotency-Key support; deletion writes tombstones in every theme and clears component references. The theme edit revision, its lock and TENANT_EDIT_CONFLICT are removed; mutations return X-DS-Mutation-Metadata. A shadow layer color may be a palette step reference [type.shade.step][opacity]: it is validated against the theme palette, stored in every platform value and resolved to #RRGGBBAA with colorRef on read.
Shadow layer colors that reference a palette step take part in the theme palette like color token references: the palette snapshot carries shadow tokens and the references of their layers, ramp links and linked counts include them (group by the name rule, not in color token assignments), ramp removal rewrites the layer color in place, and the revert dependency check rejects restoring a layer reference to a removed ramp. GET token-values returns the resolved sourceValue.
…ting model The size-tokens read refers to VersionId; value change, creation and deletion refer to OptionalBaseRevision (creation also to OptionalIdempotencyKey) and describe the X-DS-Mutation-Metadata headers. Bodies and responses drop editRevision and TENANT_EDIT_CONFLICT, deletion takes no body, value changes take per-platform baseRevisions, shadow layers carry colorRef and accept a palette step reference, and tenant token values document sourceValue.
…visions Read the base theme with the derived round.l -2 and a published version with versionId, edit radii and shadows with and without own platform values, edit one value concurrently (warning in the mutation metadata) and different tokens independently, keep the own flag through the shared token-values save, revert an own platform value from the journal, repeat a creation with the same Idempotency-Key, delete with component references reset while the published version keeps the token, delete a token created in the draft without a journal entry, and link a shadow layer color to the palette: validation, resolution in size-tokens and token-values with sourceValue, ramp links, ramp removal and the revert dependency conflict.
Size token operations follow contract v2: no editRevision, base revisions of the web, iOS and Android values from subjectRevisions taken when the command is sent, an Idempotency-Key on creation, mutations through subjectMutation with X-DS-Mutation-Metadata and errors with details.field. The queue keeps the 400 ms quiet window and generations, retries network and 5xx errors after 1 s doubling up to 30 s and reports its state as the size-tokens autosave source. Every unconfirmed operation is kept in the theme localStorage as the original size-tokens command (method, path, body with platforms, base revisions, idempotency key) and is replayed by the same command when the theme editor session starts, even if the section is not open; it is never turned into a ds_draft TokenChange. The section reads with versionId and is read-only for a published version, selects ?tokenId through useAddressedToken and reports an unavailable source, rereads after local queues when the theme model is replaced, and size-tokens truncated metadata refreshes theme tokens. Shadow size deletion is confirmed by the union of usage of its four variants with the new dialog texts. The legacy draft banner and legacyDraft are removed.
The swatch inside the layer color field opens the ColorPickerPopover of the colors section with Custom and Library tabs. A Library step is sent as the [type.shade.step][opacity] reference, and the field shows the step name (Gray 900) by colorRef with the reference opacity; HEX input or a Custom color replaces the reference. The picker rules move into size-tokens.css under the section root, the popover opens left of the inspector.
The + of a tree section appears on hover and focus of the section heading row, as for groups in the colors section, instead of anywhere over the section.
d1119b5 to
73aad34
Compare
Что это
OpenSpec change
add-sizes-tokens-editor. В PR только артефакты change: реализация будет после согласования.PR перебазирован на #109 (версии, журнал и многопользовательское редактирование): база —
feature/ds-versions.Радиусы, отступы и тени темы переводятся на прототип SDDS Portal и на операции
ds-service, как «Палитра», «Цвета» и «Типографика» (#121). Прежний экран «Формы» убирается.Ключевые решения
[type.shade.step][opacity]хранится как у стопов градиента в feat(ds): градиент как вид значения цветового токена #122 и раскрывается в HEX для потребителей.ds-serviceпереводит его в формат каждой платформы: на вебеremпри базе 16, тень — CSS-строка на слой.overridden.baseу Button и IconButton радиус задан какround.l−2. Они показываются на борде и в инспекторе источника и доступны только для чтения.{down|up}.{soft|hard}.<размер>). Создаётся и удаляется размер целиком.round.circle— полное скругление: значение не правится. В темах оно записано по-разному.ds-service
GET /api/ds/tenants/{tenantId}/size-tokensотдаёт радиусы, отступы и тени в px. У каждого токена:PUT …/size-tokens/{tokenId}/valueпишет значение в текущую тему.POST …/size-tokensиDELETE …/size-tokens/{tokenId}создают и удаляют токены во всех темах дизайн-системы.Модель #109
editRevisionи409 TENANT_EDIT_CONFLICTнет. Операции пишут предметныередакции: базовая редакция —
X-DS-Base-RevisionилиbaseRevisionsпо платформам, метаданные — вX-DS-Mutation-Metadata. Правки разных токенов не конфликтуют, при правке одного значения побеждает последняязапись с предупреждением.
versionId: опубликованная версия открывается только для чтения. Использованиеи вычисляемые радиусы читаются из конфигураций компонентов на той же границе.
Idempotency-Keyи уникальностью имени под блокировкой.shape, spacing и shadow уже покрыты общими обработчиками feat(ds): версии, журнал изменений и версионная палитра #109.
?tokenId. Баннера прежнегочерновика нет: неподтверждённые записи отправляет сессия редактора.
Зависимость
token_value_revisions.overridden. Её вводитadd-color-token-gradients(feat(ds): градиент как вид значения цветового токена #122) миграцией V8: V7 занята feat(ds): версии, журнал изменений и версионная палитра #109. Если этот change реализуется раньше,миграция колонки переходит в него.
Артефакты
openspec/changes/add-sizes-tokens-editor/proposal.mdopenspec/changes/add-sizes-tokens-editor/design.md— решения, контракты, таблица расхождений с прототипом, рискиopenspec/changes/add-sizes-tokens-editor/specs/sizes-tokens-api/spec.mdopenspec/changes/add-sizes-tokens-editor/specs/sizes-tokens-editor/spec.mdopenspec/changes/add-sizes-tokens-editor/tasks.mdПроверки
openspec validate add-sizes-tokens-editor --type change --strict— PASS на 1.6.0 и 1.4.1.openspec validate --specs --strict— PASS (78).