Skip to content

Add publication filter#2153

Open
myieye wants to merge 6 commits intodevelopfrom
claude/add-publish-in-filter-x8r5P
Open

Add publication filter#2153
myieye wants to merge 6 commits intodevelopfrom
claude/add-publish-in-filter-x8r5P

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Feb 5, 2026

This pull request introduces a new "Publication" filter for entries, allowing users to filter entries by their associated publication(s) both in backend APIs and frontend UI.

It also refactors how publications are tracked on entries, adds full filtering support for publication fields, and updates tests and translations to reflect the new feature.

image

And filtering for "missing":
image

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

Warning

Rate limit exceeded

@myieye has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 6 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

This PR refactors how publications are managed and filtered, shifting from a DoNotPublishInRC-based subtraction model to direct PublishIn usage. It extends filtering and mapping support across multiple backend layers and adds frontend UI components and localization for publication-based entry filtering.

Changes

Cohort / File(s) Summary
Backend API Logic
backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs
Changed PublishIn mapping and synchronization logic from using DoNotPublishInRC subtraction to directly using entry.PublishIn; updated AddPublication and RemovePublication paths accordingly.
Backend Filter Mapping Providers
backend/FwLite/FwDataMiniLcmBridge/LexEntryFilterMapProvider.cs, backend/FwLite/LcmCrdt/EntryFilterMapProvider.cs, backend/FwLite/MiniLcm/Filtering/EntryFilterMapProvider.cs
Added three new public override/abstract properties (EntryPublishIn, EntryPublishInId, EntryPublishInConverter) across filter map provider implementations to support PublishIn filtering and serialization.
Backend Filter Configuration
backend/FwLite/MiniLcm/Filtering/EntryFilter.cs
Added mappings for Entry.PublishIn and nested PublishIn.Id fields to enable filtering support.
Backend Expression and Query Support
backend/FwLite/LcmCrdt/Json.cs, backend/FwLite/LcmCrdt/LcmCrdtKernel.cs
Extended expression path building to handle UnaryExpression and Convert nodes; introduced ToString(Guid?) helper function; added LinqToDB mapping for Entry.PublishIn via EntryPublishInExpression.
Backend Configuration and Tests
backend/FwLite/FwDataMiniLcmBridge/FwDataBridgeConfig.cs, backend/FwLite/MiniLcm.Tests/QueryEntryTestsBase.cs
Removed unused using directives; added new test cases for PublishIn filtering (by null, by publication ID, combined scenarios).
Frontend Localization
frontend/viewer/src/locales/*.po
Added translation entries for "Any publication" and "Publication" labels across eight locale files (en, es, fr, id, ko, ms, sw, vi); removed obsolete translation entry.
Frontend UI Components and Integration
frontend/viewer/src/project/browse/SearchFilter.svelte, frontend/viewer/src/project/browse/filter/PublicationSelect.svelte, frontend/viewer/src/project/browse/filter/MissingSelect.svelte
Created new PublicationSelect component for rendering publication options; integrated into SearchFilter with bound publication state and filter clause generation; added publication to MissingSelect options.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • hahn-kev

Poem

🐰 whiskers twitch with joy and care
Publications now float through the air,
No more DoNotPublish to subtract,
Just PublishIn keeps the facts intact!
Filter dropdowns shine so bright,
From backend deep to frontend light! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add publication filter' clearly summarizes the main change: introducing a publication filter feature for entries in both backend and frontend.
Description check ✅ Passed The pull request description clearly describes introducing a new 'Publication' filter for entries, refactoring publication tracking, adding filtering support, and updating tests and translations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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   24s ⏱️ ±0s
138 tests ±0  138 ✅ ±0  0 💤 ±0  0 ❌ ±0 
203 runs  ±0  203 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 990f1b1. ± 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 990f1b1. ± Comparison against base commit f37f947.

♻️ This comment has been updated with latest results.

@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.

@myieye myieye changed the title Refactor publication filtering to use ILexEntry.PublishIn virtual property Add publication filter Feb 6, 2026
@argos-ci
Copy link

argos-ci bot commented Feb 6, 2026

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Feb 6, 2026, 2:46 PM

@myieye myieye marked this pull request as ready for review February 6, 2026 15:41
@myieye
Copy link
Collaborator Author

myieye commented Feb 6, 2026

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

✅ Actions performed

Full review triggered.

#. Publication = dictionary/publication type for distributing entries
#: src/project/browse/filter/PublicationSelect.svelte
msgid "Any publication"
msgstr ""
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor

Choose a reason for hiding this comment

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

All these blank message strings seem suspect to me.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Other than the question about the localization strings LGTM

#. Publication = dictionary/publication type for distributing entries
#: src/project/browse/filter/PublicationSelect.svelte
msgid "Any publication"
msgstr ""
Copy link
Contributor

Choose a reason for hiding this comment

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

All these blank message strings seem suspect to me.

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.

4 participants