Skip to content

Refactor/restrictions#86

Merged
mkram17 merged 13 commits intov1.0.0from
refactor/restrictions
Mar 21, 2026
Merged

Refactor/restrictions#86
mkram17 merged 13 commits intov1.0.0from
refactor/restrictions

Conversation

@0xar-ds
Copy link
Collaborator

@0xar-ds 0xar-ds commented Mar 9, 2026

depends on #85

Current sell restrictions is now a concrete of RestrictionHelper, a InputHelper-alike class which is generic enough as to also allow a SellSacksRestriction by barely providing the to-order-parsing api. The RestrictionHelper could be further utilized to implement Buy Order/Sell Order restrictions if deemed a wanted feature.

The configuration was refactored to encompass the generalization of restrictors: the "instant sell toggle" has become a global toggle for the API¹; and a enum was added to select which concretes are enabled, whereas each rule² may also select whether it is applied to that restrictor target/concrete.

image VErPd2CD9eqhBAUx

I don't like how the config resulted but I would like to wait until ResourcefulConfig finally merges and releases the List support before merging this PR: each rule's "enabled" toggle will be dropped (its mere existence on the list will be considered as validity) and that of selecting/toggle whether a rule targets a restrictor should be of less clutter. Also we can move the toggle/separated group of options into that category then, for each type of rule will be a simple list. We can also then consider whether a "restrictor" is enabled by simply having rules scoped & the global toggle so we drop the concrete selection on the main screen as well.

@mkram17 mkram17 mentioned this pull request Mar 15, 2026
5 tasks
@0xar-ds 0xar-ds force-pushed the refactor/restrictions branch from 9ceeda5 to bf74ec6 Compare March 18, 2026 19:01
@0xar-ds
Copy link
Collaborator Author

0xar-ds commented Mar 18, 2026

Adopting lists

@0xar-ds
Copy link
Collaborator Author

0xar-ds commented Mar 18, 2026

@mkram17 rendered:
image

In restrictions config:
image

In ruleset config:
image
image

@0xar-ds
Copy link
Collaborator Author

0xar-ds commented Mar 18, 2026

Also, now that I think about it... If we adopt #73, rather than to have a user type-in the item to-be restricted, they could choose it from the picker

@0xar-ds
Copy link
Collaborator Author

0xar-ds commented Mar 18, 2026

also lmk if you prefer the config to be like this
image

@0xar-ds 0xar-ds requested a review from mkram17 March 18, 2026 20:56
0xar-ds added 5 commits March 21, 2026 15:15
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Each SlotHighlight is now to own its cache (there was no shared
computation nor shared api; to have a central cache was an abstraction
which leveraged to nothing) and apply a simple interface which we could
further elevate to require a annotated method, in that of to
automatically handle this type of highlights on our mixin.

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
@0xar-ds 0xar-ds force-pushed the refactor/restrictions branch 2 times, most recently from ce1d470 to 0c4e5f8 Compare March 21, 2026 18:42
0xar-ds added 8 commits March 21, 2026 16:09
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Each SlotHighlight is now to own its cache (there was no shared
computation nor shared api; to have a central cache was an abstraction
which leveraged to nothing) and apply a simple interface which we could
further elevate to require a annotated method, in that of to
automatically handle this type of highlights on our mixin.

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…rictors

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Interface consumed by the library's ListScreen to render the title and,
optionally, comment, of a entry of the rendered list.

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
@0xar-ds 0xar-ds force-pushed the refactor/restrictions branch from 0c4e5f8 to fd232b0 Compare March 21, 2026 19:12
@mkram17 mkram17 merged commit b01a8bc into v1.0.0 Mar 21, 2026
5 checks passed
@mkram17 mkram17 deleted the refactor/restrictions branch March 21, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants