Skip to content

Fix glossary definition data loss when editing a newly-created term#30

Merged
juancobo merged 3 commits into
mainfrom
v1.3.3-beta
Jun 10, 2026
Merged

Fix glossary definition data loss when editing a newly-created term#30
juancobo merged 3 commits into
mainfrom
v1.3.3-beta

Conversation

@juancobo

Copy link
Copy Markdown
Member

Editing a newly-created glossary term's definition could lose everything after the first character or two: the snapshot backfills the term's _id a moment after creation, which changed the term's selection key and unmounted the open definition editor mid-edit, so only the text that reached the Y.Text before the backfill survived. The term key now derives from the immutable _temp_id when present, keeping the selection (and the editor) stable across the backfill. Adds a regression test pinning key-stability across the _id backfill.

Copilot AI review requested due to automatic review settings June 10, 2026 18:51
@juancobo juancobo merged commit b317280 into main Jun 10, 2026
1 check passed
@juancobo juancobo deleted the v1.3.3-beta branch June 10, 2026 18:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a glossary editor data-loss bug caused by React selection/editor identity changing when the collaboration snapshot backfills a newly-created term’s _id. It makes term identity derive from the immutable _temp_id when present, and adds a regression test to pin this behavior.

Changes:

  • Make termKey prefer _temp_id over _id to keep selection stable across _id backfill.
  • Add a Vitest regression test ensuring term key stability during the _id backfill.
  • Bump displayed version references to v1.3.3-beta and document the fix in the changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/routes/_app.glossary.tsx Exports TermItem/termKey and updates termKey to use _temp_id for stable identity across _id backfill.
tests/glossary-term-key.test.ts Adds regression coverage for termKey stability across _id backfill and key uniqueness expectations.
README.md Updates version badges and beta release callouts to v1.3.3-beta.
CHANGELOG.md Adds v1.3.3-beta entry describing the glossary definition data-loss fix.
app/components/layout/Footer.tsx Updates the footer version string to 1.3.3-beta.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

const VERSION = "1.3.2-beta";
const VERSION = "1.3.3-beta";
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