Skip to content

Refactor publication filtering to use ILexEntry.PublishIn virtual property#2153

Draft
myieye wants to merge 3 commits intodevelopfrom
claude/add-publish-in-filter-x8r5P
Draft

Refactor publication filtering to use ILexEntry.PublishIn virtual property#2153
myieye wants to merge 3 commits intodevelopfrom
claude/add-publish-in-filter-x8r5P

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Feb 5, 2026

Summary

This PR refactors the publication filtering logic to use the ILexEntry.PublishIn virtual property instead of manually inverting the DoNotPublishInRC field. This simplifies the codebase and makes the API more intuitive by working directly with publications an entry is published in, rather than those it's excluded from.

Key Changes

  • API Layer: Updated FromLexEntry() to use entry.PublishIn directly instead of filtering against DoNotPublishInRC
  • Entry Creation/Modification: Changed CreateEntry(), AddPublication(), and RemovePublication() to manipulate PublishIn directly rather than DoNotPublishInRC
  • Filtering Support: Added PublishIn and PublishIn.Id filter mappings to both LexEntryFilterMapProvider and EntryFilterMapProvider to enable filtering by publication
  • Frontend: Added PublicationSelect component and integrated publication filtering into the search filter UI
  • Tests: Added comprehensive test coverage for filtering by publication (missing publications, by publication ID, with search)

Implementation Details

  • The ILexEntry.PublishIn property is a virtual property that inverts DoNotPublishInRC against all available publications in the project
  • Filter mappings use EmptyToNull normalization for consistency with other optional filters
  • Publication filtering supports both null checks (entries with no publications) and ID-based filtering (entries in specific publications)
  • Frontend filter integrates with existing filter architecture and supports clearing the selection

https://claude.ai/code/session_019iMvqpFik7T4qiUBPLrCw6

This adds the ability to filter entries by their "Publish In" field,
which is used to categorize entries for different publications/dictionaries.

Backend changes:
- Add PublishIn and PublishIn.Id filter mappings to EntryFilterMapProvider
- Implement in LcmCrdt using JSON column queries
- Implement in FwDataBridge by inverting DoNotPublishInRC
- Create mapper lazily in FwDataMiniLcmApi with access to publications list
- Add tests for filtering by publication ID and missing publications

Frontend changes:
- Add PublicationSelect.svelte component
- Add publication filter to SearchFilter.svelte
- Add "Publication" option to MissingSelect for incomplete entries

https://claude.ai/code/session_019iMvqpFik7T4qiUBPLrCw6
ILexEntry already has a PublishIn virtual property that inverts
DoNotPublishInRC against all publications, so we don't need to
inject publication GUIDs into the filter provider.

Changes:
- LexEntryFilterMapProvider: Remove constructor, use entry.PublishIn
- FwDataMiniLcmApi: Use entry.PublishIn in ToEntry(), remove lazy mapper
- FwDataBridgeConfig: Restore simple static mapper
- Frontend: Use PublishIn=null for consistency with other filters

https://claude.ai/code/session_019iMvqpFik7T4qiUBPLrCw6
LcmInvertSet supports Add/Remove operations that automatically
update the underlying DoNotPublishInRC, so we can work with
PublishIn directly for clearer semantics.

Changes:
- AddPublication: entry.PublishIn.Add() instead of DoNotPublishInRC.Remove()
- RemovePublication: entry.PublishIn.Remove() instead of DoNotPublishInRC.Add()
- CreateEntry: use PublishIn.Remove() for excluded publications

https://claude.ai/code/session_019iMvqpFik7T4qiUBPLrCw6
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

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.

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

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/add-publish-in-filter-x8r5P

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 and usage tips.

@github-actions github-actions bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

UI unit Tests

  1 files  ±0   50 suites  ±0   23s ⏱️ -1s
138 tests ±0  138 ✅ ±0  0 💤 ±0  0 ❌ ±0 
203 runs  ±0  203 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit b61a920. ± Comparison against base commit f37f947.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

C# Unit Tests

146 tests  ±0   146 ✅ ±0   19s ⏱️ ±0s
 22 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit b61a920. ± Comparison against base commit f37f947.

@myieye
Copy link
Collaborator Author

myieye commented Feb 5, 2026

@copilot Fix this branch:

  • extract strings
  • figure out and fix failing CanFilterByPublicationId tests
  • fix: ERROR "../src/project/browse/filter/PublicationSelect.svelte" 15:31 "Property 'label' does not exist on type '_ReadonlyObjectDeep'."

The failing GHA integration tests are just flaky. Ignore them.

Copy link
Contributor

Copilot AI commented Feb 5, 2026

@myieye I've opened a new pull request, #2155, to work on those changes. Once the pull request is ready, I'll request review from you.

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.

3 participants