Refactor publication filtering to use ILexEntry.PublishIn virtual property#2153
Draft
Refactor publication filtering to use ILexEntry.PublishIn virtual property#2153
Conversation
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
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
Contributor
Contributor
Collaborator
Author
|
@copilot Fix this branch:
The failing GHA integration tests are just flaky. Ignore them. |
Contributor
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
This PR refactors the publication filtering logic to use the
ILexEntry.PublishInvirtual property instead of manually inverting theDoNotPublishInRCfield. 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
FromLexEntry()to useentry.PublishIndirectly instead of filtering againstDoNotPublishInRCCreateEntry(),AddPublication(), andRemovePublication()to manipulatePublishIndirectly rather thanDoNotPublishInRCPublishInandPublishIn.Idfilter mappings to bothLexEntryFilterMapProviderandEntryFilterMapProviderto enable filtering by publicationPublicationSelectcomponent and integrated publication filtering into the search filter UIImplementation Details
ILexEntry.PublishInproperty is a virtual property that invertsDoNotPublishInRCagainst all available publications in the projectEmptyToNullnormalization for consistency with other optional filtershttps://claude.ai/code/session_019iMvqpFik7T4qiUBPLrCw6