Skip to content

Conversation

@serh11d
Copy link
Contributor

@serh11d serh11d commented Jun 11, 2025

Description

Backend
Introduced a new operator CHECKLIST, it expects JSON array of objects

[{
 "c": 1,
 "v": "value",
 "d": "desc"
}]

c - checked, used 0, 1 to reduce payload
v - string value
d - description, if not present then it has 0 value to reduce payload

The idea is to filter such array of objects with c == 1 and map values to array with overriding operator to IN.

I wasn't able to determine is value only stored in text format and cached in memory as object instance or it's parsed every time a flag is requested. Also I wasn't able to get any stable performance results on my laptop they fuzzy from time to time, guess this should be done on a dedicated device, possibly I will do that on one of my old (it's even better as sensitive for performance) SBCs. So format is discussible, it could be plain text like 1value,desc\n (first checked, then value until comma[, desc] and \n as element separator) or even base64 encoded binary linked list.

UI
Added new operator type CHECKLIST
Added new (...) buttons on the right of value inputs.
image

Added edit collection dialog that supports IN, NOTIN, CHECKLIST operators.
image
image

Implemented basic validation.
Additional sugar should not be difficult like all check/uncheck, open IN, NOTIN in CHECKLIST mode.

I also want to add that I don’t have significant knowledge of either Golang or Vue, and changes in the code may differ greatly from your expectations 😜

Motivation and Context

Very often you have to work with lists of IDs like GUID or hash that cannot be identified simply by reading. Sometimes there are dozens of them. Sometimes it is necessary to briefly exclude certain elements from the list. All of the above together introduces certain inconveniences when working directly with the JSON representation of the list (array of elements).

How Has This Been Tested?

Backend Unit test + local env.
UI Local environment

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.42%. Comparing base (770461b) to head (052177b).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
pkg/entity/constraint.go 73.91% 4 Missing and 2 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #621      +/-   ##
==========================================
- Coverage   81.19%   76.42%   -4.78%     
==========================================
  Files          28       30       +2     
  Lines        2271     2435     +164     
==========================================
+ Hits         1844     1861      +17     
- Misses        337      482     +145     
- Partials       90       92       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhouzhuojie
Copy link
Collaborator

I like the direction, it's basically a sugar for an array of OR constraints.

One thing we need to be clear about the UX, is that for example, in your case, how does the CHECKLIST match the context?

  1. What's the name of the property in the context to match the checklist?
  2. Assuming we have the property, what's the logic and order of the checklist? If it matches the deny, does it always deny? If it matches allow in the checklist, does it always allow?
  3. I feel more like a UX/UI change and use the primitive constraints that's already defined in the backend, wdyt?
image

@sergiyd
Copy link

sergiyd commented Aug 6, 2025

@zhouzhuojie If I correctly understood the question, CHECKLIST is only for OR where checked/unchecked stays included this value into result IN constraint or not. To have an opposite effect, there should be implementation of NOTCHECKLIST that will be transformed into NOTIN in back-end. I started with IN because it is more in demand according to my observations.

@github-actions
Copy link

github-actions bot commented Oct 5, 2025

Stale pull request message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants