Skip to content

UI for advanced search operators: multi columns with AND/OR logic, regex#843

Open
sbamin wants to merge 45 commits into
sosedoff:mainfrom
sbamin:main
Open

UI for advanced search operators: multi columns with AND/OR logic, regex#843
sbamin wants to merge 45 commits into
sosedoff:mainfrom
sbamin:main

Conversation

@sbamin
Copy link
Copy Markdown

@sbamin sbamin commented Mar 3, 2026

A few more fixes and tested OK on our end.

Context: #842 (comment)

Screenshot 2026-03-03 at 9 44 51 AM

sbamin and others added 7 commits March 2, 2026 16:16
Advanced Search panel** (`Advanced` toggle button next to the existing filter bar):

- **Multiple conditions** — add unlimited filter rows with `+ Add Condition`
- **Per-row AND/OR connectors** — each row after the first has AND/OR toggle pills, enabling mixed logic like `(A AND B) OR (C AND D)`
- **18 filter operators** grouped by category:
  - Comparison: `=`, `<>`, `<`, `>`, `<=`, `>=`
  - List: `IN`, `NOT IN` (comma-separated values)
  - Null: `IS NULL`, `IS NOT NULL`
  - Range: `BETWEEN`, `NOT BETWEEN` (From / To inputs)
  - Pattern: Contains, Not contains, Has prefix, Has suffix — plus case-insensitive (ILIKE) variants for all four
- **Show Query** — previews the full `SELECT * FROM ... WHERE ...;` SQL inline, with a Copy button
- **"Advanced Filter Active"** badge in the pagination row when a multi-condition filter is applied
- **Right-click → Filter Rows By Value** adds a pre-filled condition row when the panel is open
- Filter state resets automatically on table switch or clicking the basic `×` reset button
- No backend changes — uses the existing `where` parameter on `GET /api/tables/:table/rows`

**Files changed:** `static/index.html`, `static/js/app.js`, `static/css/app.css
sync from main to local
sbamin and others added 22 commits March 5, 2026 13:38
Bug fix (v5): LIST, RANGE, NULL operators not working
- **Root cause 1**: `.adv-val-range` shown via `.toggle(true)` renders as `display:block`, breaking the flex From/To layout — fixed by using `.css("display","flex")` in new `updateAdvRowInputs()` helper
- **Root cause 2**: `buildAdvancedWhereClause()` read from `.adv-val-list` / `.adv-val-from/to` but if user typed in the always-visible `.adv-val` fallback was missing — added fallback: LIST reads `.adv-val` if `.adv-val-list` is empty; RANGE parses `"val1, val2"` or `"val1 and val2"` from `.adv-val` if From/To are empty
- Extracted `updateAdvRowInputs(row, op)` from inline `change` handler for reuse
Add three new UI elements to support the aggregate panel:
1. Aggregate toggle button next to Advanced search toggle
2. Aggregate panel div with GROUP BY, AGGREGATES, and HAVING sections
3. Aggregate active badge in the current-page display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sbamin and others added 16 commits April 2, 2026 15:18
- Wrap buildTable() in try/finally in runQuery, runExplain, runAnalyze
  so hideQueryProgressMessage() always runs even if buildTable throws,
  preventing Run Query button from staying permanently disabled
- Guard content modal window-click handler to only fire when modal is
  visible, and restore editor focus afterward so keyboard input works
  immediately after dismissing a cell value modal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PostgreSQL does not allow referencing SELECT aliases in HAVING.
HAVING now emits COUNT(*), SUM("col"), etc. instead of the alias name,
while the dropdown still displays the human-readable alias to the user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Warns users to review the generated SQL via Show Query before relying
on output from Advanced and Aggregate filters in the Rows tab. Uses
flexbox on the nav ul so the note fills remaining space and truncates
with ellipsis rather than overflowing the menu bar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
**Symptom:** After using the Rows tab (Advanced/Aggregate filters), switching to the Query tab leaves Run Query and Explain Query buttons unclickable. Cursor stays as arrow, clicks don't register. Refresh restores them.

**Root cause:** `adjustOutputTop()` sets `#output` top CSS to the pagination panel height when on the Rows tab. `showQueryPanel()` never resets it, so `#output` (position:absolute) sits over the `.actions` buttons inside `#input`, invisibly intercepting all mouse events.

**Fix:** Added to `showQueryPanel()` in `static/js/app.js`:
```javascript
$("#output").css("top", $("#input").height() + "px");
```

**How to apply:** When debugging click/cursor failures on the Query tab after Rows tab use — check `#output` top CSS value first.
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.

1 participant