Repository navigation
feat(web): add copy buttons to frontmatter and metadata headings - #215
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is focused, consistent with existing behavior, and has appropriate serializer coverage.
0 open findings
What changed in this PR
Adds copy-to-clipboard controls for frontmatter and metadata in the memory reading view.
Changes:
- Adds reusable summary copy buttons with toast feedback.
- Shares frontmatter serialization between viewing and editing.
- Centralizes the copy icon and adds serializer tests.
| File | Description |
|---|---|
packages/​web/​src/​lib/​frontmatter.ts |
Extracts frontmatter serialization. |
packages/​web/​src/​lib/​frontmatter.test.ts |
Tests frontmatter block formatting. |
packages/​web/​src/​components/​viewer/​SummaryCopyButton.tsx |
Adds the reusable copy control. |
packages/​web/​src/​components/​viewer/​FrontmatterBlock.tsx |
Adds frontmatter copying. |
packages/​web/​src/​components/​viewer/​MetadataPanel.tsx |
Adds YAML metadata copying. |
packages/​web/​src/​components/​icons.tsx |
Exports the shared copy icon. |
packages/​web/​src/​components/​editor/​EditorPane.tsx |
Uses the shared copy icon. |
🧠Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jgpruitt
approved these changes
Oct 13, 2026
murrayju
added a commit
that referenced
this pull request
Oct 13, 2026
…leDB 2.30 (#216) ## Summary Fix the memory history and revert functions on TimescaleDB 2.30+. `has_tree_access` now uses `operator(public.@>)` instead of an unqualified `@>`. ## Problem CI started to fail on `main`-equivalent code (seen first on #215) in two space-migration integration tests: ``` operator does not exist: public.ltree @> public.ltree where: SQL function "has_tree_access" during inlining SQL function "resolve_memory_id_from_history" statement 1 ``` The CI Postgres image (`docker/Dockerfile.postgres`) installs `timescaledb-2-postgresql-18` without a version pin, so it now gets 2.30.2. I bisected with a minimal repro against the TimescaleDB versions in the image: | TimescaleDB | result | |---|---| | 2.28.3, 2.29.0, 2.29.2 | pass | | 2.30.0, 2.30.2 | `operator does not exist` | The failing pattern: an inlinable SQL function (no `set search_path`) that uses an extension operator, in the `WHERE` clause of a hypertable query with `ORDER BY <time> LIMIT 1`. From 2.30.0, the inlined body does not resolve the operator, although the calling function sets `search_path` to include `public`. The same query on a plain table works. In this schema, that hits `resolve_memory_id_from_history` and the snapshot lookup in `revert_memory` (both on the `memory_event` hypertable). `get_memory_history` already used `operator(public.<@)` for its own subtree filter. ## Fix Schema-qualify the operator in `has_tree_access`. The function stays inlinable (no `set search_path`), which is why it must not depend on the caller's `search_path`. Extensions are always installed `with schema public` (`ensureExtension`), so the qualifier is safe. `has_tree_access` and `tree_access` are the only inlinable SQL functions in the space schema, and `tree_access` uses no operators. Idempotent migrations re-run on every boot, so existing spaces get the new body without a schema version bump. The signature does not change. ## Production impact If production moves to TimescaleDB 2.30+, `memory.history` by path and `memory.revert` would fail without this fix. ## Testing - The previously failing tests pass against TimescaleDB 2.30.2: `packages/database/space/migrate/migrate.integration.test.ts` and `packages/server/rpc/memory/memory.integration.test.ts`. - Full suite (1648 pass, 0 fail), e2e, and lint pass locally.
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.
Summary
Add a copy-to-clipboard button to the
frontmatterandmetadatasection headings in the memory reading view.---…---) with the set fields (name,tree,meta,temporal). This is the same block the editor shows.id,hasEmbedding, andcreatedBy(if set), with the API field names.A click on the button does not open or close the section. A toast reports success or failure.
Changes
viewer/SummaryCopyButton.tsx: the button. It prevents the default<summary>toggle.lib/frontmatter.ts: extractformatFrontmatterBlock()frommemoryToEditorText(), so the editor and the copy button produce the same text. Unit tests added.icons.tsx: moveCopyIconhere fromEditorPane.tsx, because three places now use it.Testing
./bun run lint,./bun run web:typecheck, web unit tests, and the e2e suite pass../bun run typecheckreports 26 errors and 4 memory history/revert integration tests fail locally. Both also happen onmainwithout this change.