Skip to content

[claude][vibe] Live possible-duplicates check in the new-entry dialog - #2457

Closed
myieye wants to merge 14 commits into
developfrom
claude/duplicate-entry-detection-sync-1bcb1f
Closed

[claude][vibe] Live possible-duplicates check in the new-entry dialog#2457
myieye wants to merge 14 commits into
developfrom
claude/duplicate-entry-detection-sync-1bcb1f

Conversation

@myieye

@myieye myieye commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

[Claude, autonomous]

Adds a live "possible duplicates" check to the new-entry dialog: as you type, it searches existing entries and flags same-word / similar-word / same-meaning matches, with an out-of-view jump pill and in-place row expansion.

  • Backend search is always run diacritic-stripped (it only matches accent-insensitively for a diacritic-free query); the client then classifies an exact diacritic match as same-word and an accent-only difference as similar-word.
  • Classification compares against the displayed headword (citation, or the morph-token-decorated lexeme) from the writing-system service.
  • Cross-field coincidences (a typed word that only hits some entry's gloss) are dropped rather than shown as vague matches.

Test plan: pnpm --filter viewer run test:unit (duplicate-check.test.ts, 33 cases) and svelte-check are clean; UI coverage in tests/ui/new-entry-duplicates.test.ts.

myieye and others added 13 commits July 4, 2026 22:05
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Spec-cited review against EntrySearchService/SqlHelpers found the client
fold diverged: host-locale lowercasing, unconditional accent-stripping
(backend keeps diacritics significant when the query has them), and no
morph-token handling (typed "-aji" vs suffix entry "aji" missed exact).
Also ranks each search by the writing system it was typed in, fixes the
mount-time "Checking" flash, singularizes the one-match banner, and
closes a pre-existing double-Enter double-create in the dialog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- match rows expand to reveal Add sense / Go to entry; DictionaryEntry gains an inline mode for the compact collapsed rows
- classification: attribute same-word matches to the field that hit (Same headword vs Same lexeme form), rank similar words closest-in-length first, drop cross-field coincidences instead of a vague 'related' kind
- classify in a $derived so the lazy morph-types resource warms at mount and re-classifies without re-searching
- dedupe queries per field kind: the same text typed as lexeme and gloss keeps its gloss query (same-meaning matches were lost)
- share the banner message/tint/Enter-trap between the strip and the extracted DuplicateSummaryPill
- scope backend-parity doc claims to the CRDT FTS path; drop unverified FLEx attribution
- adapt the Playwright suite to the new interaction model and cover the jump pill (7 tests); pin length-delta boundary, gloss containment direction, and closest-form ranking in unit tests (33; 8/8 targeted mutants killed)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…icates

# Conflicts:
#	frontend/viewer/src/locales/en.po
#	frontend/viewer/src/locales/es.po
#	frontend/viewer/src/locales/fr.po
#	frontend/viewer/src/locales/id.po
#	frontend/viewer/src/locales/ko.po
#	frontend/viewer/src/locales/ms.po
#	frontend/viewer/src/locales/sw.po
#	frontend/viewer/src/locales/vi.po
…fill test gaps

- Move new-entry-duplicates.test.ts to tests/ui/ and port it to the
  DemoProjectPage page object introduced by the E2E restructure (#1866)
- Cap the jump pill at 32rem so long headword previews don't stretch it
  across the whole dialog
- New tests: trapEnter unit test, Enter-inside-strip must not create the
  entry, pill dismiss persists, add-sense must not also create an entry

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R49zrCE7hPgm9QJ5bfugaV
A failed searchEntries call previously vanished into the unread
resource.error — no toast, no status line, the widget just went blank.
Show an inline status line instead of a toast: the search re-fires per
typing pause, and a toast per failure would bury the dialog.

Show-more now uses $plural so translators get per-language plural forms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R49zrCE7hPgm9QJ5bfugaV
…ntry-detection-sync-1bcb1f

# Conflicts:
#	frontend/viewer/src/locales/en.po
#	frontend/viewer/src/locales/es.po
#	frontend/viewer/src/locales/fr.po
#	frontend/viewer/src/locales/id.po
#	frontend/viewer/src/locales/ko.po
#	frontend/viewer/src/locales/ms.po
#	frontend/viewer/src/locales/sw.po
#	frontend/viewer/src/locales/vi.po
Always send the backend search with diacritics stripped (it only matches
accent-insensitively for a diacritic-free query), then classify an exact
diacritic match as same-word and an accent-only difference as similar-word.
Classification now runs against the displayed headword from the writing-system
service, dropping the client-side morph-token stripping. Extract the duplicate
pill/widget wiring into DuplicateCheckSection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 57d31992-7c76-4356-803d-413de54bf4b0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/duplicate-entry-detection-sync-1bcb1f

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@argos-ci

argos-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jul 17, 2026, 11:08 AM
e2e (Inspect) ✅ No changes detected - Jul 17, 2026, 11:16 AM

The entries for "Meaning added to {0}" and "This entry may already exist" were extracted without a msgstr line in all seven non-English locales, leaving the catalogs malformed. Add the empty msgstr so they parse as normal untranslated entries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@myieye

myieye commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

[Claude, autonomous]

Closing: this PR was a duplicate of #2433 (same feature, same branch history) and shouldn't have been opened — the AI session that created it branched off #2433's branch and opened a fresh PR instead of pushing to the existing one.

Nothing is lost: this branch was #2433's branch plus three commits (a develop merge and two fixes), and those have been fast-forwarded onto #2433's branch. Review continues on #2433.


Generated by Claude Code

@myieye myieye closed this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants