Commit 19828f0
committed
refactor(linux): filter goes inline + raw SQL escape hatch
UX shape change: AdwDialog → inline GtkRevealer slid in above the
grid. The user filters data they can see; obscuring the grid with a
modal added a round-trip every rule tweak. Strip stays open while
they edit, applies on demand, collapses with Esc / Close (×).
Matches GtkSearchBar's slide-in pattern (the native idiom for
"transient editor above content"), not AdwDialog's
"form-with-validate-then-apply" flow.
Layout (replaces the dialog):
Filter rows Clear all │ Apply │ ×
Combine rules with: [ All ▾ ]
┌─ boxed-list ──────────────────────────────────────┐
│ [Column ▾] [Op ▾] [Value …] [✕] │
│ [+ Add rule] │
└────────────────────────────────────────────────────┘
▸ Advanced (raw SQL)
Module rename: filter_dialog.rs → filter_strip.rs. Public surface
swaps `present(parent, ...)` for `build(columns, initial, on_apply)
-> FilterStrip` returning a holder with the revealer + state +
methods to toggle / update_columns / update_filter so BrowseTab can
react to ColumnsLoaded and external FilterApplied without rebuilding
from scratch.
Raw SQL escape hatch:
- FilterSet gains extra_sql: Option<String>. Appended to the
structured rules with the chosen combinator, wrapped in parens so
user OR / NOT precedence stays scoped to their fragment.
- Emitted verbatim — no quoting, no parameterisation. Same security
model as the SQL editor: the user owns the connection. Power
feature, not an injection vector.
- Whitespace-only extra_sql treated as None so blank entries don't
emit `WHERE ()`.
- 5 new core tests covering extra_sql alone / combined with rules /
with OR combinator / blank handling / is_empty + len semantics.
BrowseTab integration:
- Owns Option<FilterStrip>. Built once at init, added as a top bar
above grid_search_bar.
- ToggleFilterStrip input wired to win.open-filter / Ctrl+R.
- FilterApplied still persists + refetches; now also calls
strip.update_filter(set) so the editor reflects the committed
state.
- ColumnsLoaded calls strip.update_columns so operator allowlists
re-narrow on schema changes.
- Esc inside the strip collapses without applying (Local-scope
shortcut on the strip's outer Box; doesn't compete with
cell-editor / search-bar Esc handlers).
Test counts: app 92 (unchanged), core 108 (was 103, +5 extra_sql).
Clippy clean.1 parent 0109ffb commit 19828f0
6 files changed
Lines changed: 370 additions & 111 deletions
File tree
- linux/crates
- app/src
- services
- ui
- app
- core/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
336 | 333 | | |
337 | 334 | | |
338 | 335 | | |
339 | 336 | | |
340 | 337 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 338 | + | |
363 | 339 | | |
364 | 340 | | |
365 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| |||
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| |||
1262 | 1269 | | |
1263 | 1270 | | |
1264 | 1271 | | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1265 | 1280 | | |
1266 | 1281 | | |
1267 | 1282 | | |
| |||
1327 | 1342 | | |
1328 | 1343 | | |
1329 | 1344 | | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
1330 | 1356 | | |
1331 | 1357 | | |
1332 | 1358 | | |
| |||
1558 | 1584 | | |
1559 | 1585 | | |
1560 | 1586 | | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | 1587 | | |
1571 | 1588 | | |
1572 | 1589 | | |
| |||
1600 | 1617 | | |
1601 | 1618 | | |
1602 | 1619 | | |
| 1620 | + | |
1603 | 1621 | | |
1604 | 1622 | | |
1605 | 1623 | | |
| |||
1659 | 1677 | | |
1660 | 1678 | | |
1661 | 1679 | | |
1662 | | - | |
| 1680 | + | |
1663 | 1681 | | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
1664 | 1689 | | |
1665 | 1690 | | |
1666 | 1691 | | |
| |||
1729 | 1754 | | |
1730 | 1755 | | |
1731 | 1756 | | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
1732 | 1762 | | |
1733 | 1763 | | |
1734 | 1764 | | |
| |||
1739 | 1769 | | |
1740 | 1770 | | |
1741 | 1771 | | |
1742 | | - | |
| 1772 | + | |
1743 | 1773 | | |
1744 | 1774 | | |
1745 | 1775 | | |
1746 | 1776 | | |
1747 | 1777 | | |
1748 | 1778 | | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
1749 | 1782 | | |
1750 | 1783 | | |
1751 | 1784 | | |
| |||
0 commit comments