From 09969d622efcbbd5ee7ee92669c6a186f4ac1f57 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 24 Nov 2026 09:29:37 +0000 Subject: [PATCH] :books: Clarify shared text guidance Give shared text rules a direct name and distinguish derived position data from whether it can be persisted on a shape. AI-assisted-by: gpt-6.1-terra --- .serena/memories/common/core.md | 2 +- .serena/memories/common/{text-subtleties.md => text.md} | 6 +++--- .serena/memories/common/tokens.md | 2 +- .serena/memories/frontend/text-editor.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename .serena/memories/common/{text-subtleties.md => text.md} (77%) diff --git a/.serena/memories/common/core.md b/.serena/memories/common/core.md index 931c15ade2..6d7c67df07 100644 --- a/.serena/memories/common/core.md +++ b/.serena/memories/common/core.md @@ -37,6 +37,6 @@ Components, variants, and debugging: - Components, variants, referential integrity, repair and diagnosis: `mem:common/components`. Text and tests: -- Shared text data conversion, DraftJS compatibility, modern text content, and derived position data: `mem:common/text-subtleties`. +- Shared text data conversion, DraftJS compatibility, modern text content, and derived position data: `mem:common/text`. - Common test commands, helper conventions, production-path test mutations, and runtime coverage choices: `mem:common/testing`. - Cross-cutting testing principles, anti-patterns, and verification checklist: `mem:testing`. diff --git a/.serena/memories/common/text-subtleties.md b/.serena/memories/common/text.md similarity index 77% rename from .serena/memories/common/text-subtleties.md rename to .serena/memories/common/text.md index 96b7de8195..5ed669cd0c 100644 --- a/.serena/memories/common/text-subtleties.md +++ b/.serena/memories/common/text.md @@ -1,4 +1,4 @@ -# Common Text Subtleties +# Common text ## DraftJS compatibility @@ -10,5 +10,5 @@ ## Modern text content - Modern text content schema is narrow: root -> paragraph-set -> paragraph -> text nodes. -- `position-data` is derived layout/geometry/font fragment data and should be treated as generated state, not source-of-truth file data. -- Token propagation and some non-current-page text updates drop `:position-data` so it can be regenerated in the right runtime context. \ No newline at end of file +- `position-data` is derived layout/geometry/font fragment data. It can be committed to the shape, but is generated state rather than the source of truth and must be regenerable from the content and runtime context. +- Token propagation and some non-current-page text updates drop `:position-data` so it can be regenerated in the right runtime context. diff --git a/.serena/memories/common/tokens.md b/.serena/memories/common/tokens.md index 73c724aead..cf6d90f1d8 100644 --- a/.serena/memories/common/tokens.md +++ b/.serena/memories/common/tokens.md @@ -10,4 +10,4 @@ - Applying a token is blocked while a text shape is being edited. Otherwise the workspace records its name, resolves active tokens through Style Dictionary or tokenscript according to feature flags, updates concrete attrs and groups the operation in an undo transaction. - Composite and atomic typography token attrs replace one another. Spacing application targets gap/padding on layout containers and margins on immediate layout children. - Propagation resolves active tokens and buffers `update-shapes` commits, processing the current page before other pages. It clears affected frame/component thumbnails and drops text `:position-data` on non-current pages so it can be regenerated. -- For workspace state and undo see `mem:frontend/workspace-store` and `mem:frontend/workspace-commits`; for geometry and text data see `mem:common/geometry` and `mem:common/text-subtleties`. +- For workspace state and undo see `mem:frontend/workspace-store` and `mem:frontend/workspace-commits`; for geometry and text data see `mem:common/geometry` and `mem:common/text`. diff --git a/.serena/memories/frontend/text-editor.md b/.serena/memories/frontend/text-editor.md index 07124d29bb..c2f49b1f0d 100644 --- a/.serena/memories/frontend/text-editor.md +++ b/.serena/memories/frontend/text-editor.md @@ -1,6 +1,6 @@ # Frontend text editor -- `frontend/text-editor` is the JS/Vite `@penpot/text-editor` package, with its own Vitest and browser-test setup. Its entry point is `src/editor/TextEditor.js`; shared text data rules are in `mem:common/text-subtleties`. +- `frontend/text-editor` is the JS/Vite `@penpot/text-editor` package, with its own Vitest and browser-test setup. Its entry point is `src/editor/TextEditor.js`; shared text data rules are in `mem:common/text`. - It copies render-wasm artifacts from `frontend/resources/public/js` to `src/wasm`. After rebuilding render-wasm, run `pnpm run wasm:update` from `frontend/text-editor` when local development or tests need updated artifacts. - From `frontend/text-editor`, `pnpm run dev` starts Vite, `pnpm run test` runs tests, `pnpm run coverage` collects coverage, and `pnpm run test:watch:e2e` starts browser tests. `pnpm run fmt:js` checks formatting. Frontend root JS formatting also covers text-editor sources, but does not replace package tests. - Text behavior can cross this package, render-wasm and CLJS integration; verify the runtime that owns the changed behavior. For the separate shared UI package see `mem:frontend/ui-package`.