ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

Union query mode #360

Open kirillt opened 1 year ago

kirillt commented 1 year ago

In addition to intersection and focus query modes, union mode should be added. When union mode is enabled, we display all resources marked with at least one of specified tags.

"Intersection" mode is called "normal" in ARK-Builders/ark-components-android#17. "Focus" mode was implemented in scope of ARK-Builders/ark-components-android#23.

New icons for query modes should remind the following: query-modes

How union query mode works

Suppose, we have the following resources:

┌────────────────┐
│ # |  tags      │
├────────────────┤
│ 1 |  a         │
│ 2 |  b         │
│ 3 |  c         │
│ 4 |  a, b      │
│ 5 |  b, c      │
│ 6 |  a, c      │
│ 7 |  a, b, c   │
│ 8 |  <none>    │
└────────────────┘

This is how queries will work in union mode:

┌─────────────────────────────────┐
│ query     | resources           │
├─────────────────────────────────┤
│ {}        │ <none>              │
│ {a}       │ 1, 4, 6, 7          |
│ {a,b}     │ 1, 2, 4, 5, 6, 7    │
│ {a, b, c} │ 1, 2, 3, 4, 5, 6, 7 |
└─────────────────────────────────┘