Skip to content

feat: open filter dropdowns upwards when there is no room below (#361) - #362

Merged
timdegroot1996 merged 2 commits into
mainfrom
feat/361-dropdown-open-upwards
Sep 26, 2026
Merged

timdegroot1996 merged 2 commits into
mainfrom
feat/361-dropdown-open-upwards

Conversation

@timdegroot1996

Copy link
Copy Markdown
Collaborator

Fixes #361

Problem

The checkbox dropdowns in the filter modal (Filter Profiles, Run Tags, Versions, custom filters like Pipeline/Release) and the settings modal (hidden custom filters) always opened below their select with a fixed max-height: 50vh. Opening one near the bottom of the modal stretched the modal, added a scrollbar and made the page jump.

Root cause

The .filterCheckBoxes panels are custom absolute-positioned elements (not Bootstrap dropdowns, so no Popper flip). Nothing checked the available viewport space when a panel opened.

Fix

  • New shared helper set_filter_dropdown_visible(select, panel, visible) in js/filter/controls.js. When a panel opens it measures the viewport space below and above the select:
    • opens below when the content (capped at 50vh) fits there;
    • otherwise opens above (.drop-up) when there is more room above;
    • caps the height to the space on the chosen side (minimum 120px). Long lists keep scrolling inside the panel with the search box pinned.
  • The placement decision is a pure function, get_filter_dropdown_placement.
  • CSS: the select + panel wrapper is the positioning anchor. .drop-up uses bottom: 100%, so an upward panel stays attached to its select and shrinks towards it while searching.
  • The five duplicated open/close handlers (filter_modal.js ×3, modal_options.js, settings_modal.js) now use the helper.

Also included: scripts/example.py --test (and scripts\example.bat --test) builds the example dashboard in the repo root without overwriting the committed example/ files, useful for checking a change by eye. Documented in CLAUDE.md, CONTRIBUTING.md and the dev-workflow skill.

Tests

  • New JS unit test tests/javascript/filter_dropdown.test.js covers the placement decision: fits below, flips up, stays down, caps at the space above, very long lists, minimum height. JS suite: 18 files, 358 tests passed.
  • Checked by hand in headless Chromium at 1312×883 against the example dashboard:
    • Run Tags, Versions and Filter Profiles open down.
    • Pipeline and Release open up, and the modal scrollHeight stays the same (no new scrollbar).
    • Searching shrinks an upward panel towards its select.
    • Clicking inside a panel keeps it open; clicking outside closes it.
    • The settings-modal dropdowns still work.
    • No console errors.
  • No robot test (agreed with the maintainer).

🤖 Generated with Claude Code

timdegroot1996 and others added 2 commits September 26, 2026 16:15
The checkbox dropdowns in the filter and settings modals always opened
below their select with a fixed 50vh max-height. Near the bottom of the
modal the panel stretched the modal, a scrollbar appeared and the page
jumped.

A shared set_filter_dropdown_visible helper now measures the viewport
space above and below the select when a panel opens: it flips the panel
above the select when it does not fit below and there is more room
above, and caps its height to the space on the chosen side. The five
duplicated open/close handlers use it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Running the example build to eyeball a change overwrote the committed
example/ files. With --test the dashboard and database are only built in
the repo root (gitignored).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@timdegroot1996
timdegroot1996 merged commit e924a14 into main Sep 26, 2026
3 checks passed
timdegroot1996 added a commit that referenced this pull request Sep 26, 2026
Changelog entry for #362 and example dashboard/database regenerated so
the committed example carries the upward-opening filter dropdowns.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@timdegroot1996 timdegroot1996 mentioned this pull request Sep 26, 2026
timdegroot1996 added a commit that referenced this pull request Sep 26, 2026
* Release 2.4.0

Bump version.py, setup.py and the CLI version fixture to 2.4.0, regenerate
example/robot_dashboard.html and example/robot_results.db from the current
source, and add the 2.4.0 CHANGELOG section.

* Release 2.4.0: include filter dropdown flip (#362)

Changelog entry for #362 and example dashboard/database regenerated so
the committed example carries the upward-opening filter dropdowns.

* docs(skills): release skill — tag after merge, GitHub Release, manual docs deploy

deploy.yml no longer runs on tag pushes, so the docs build started by the
release merge usually runs before the tag exists. Document the order:
tag the merge commit, create the GitHub Release, then re-run the deploy
with workflow_dispatch.
@timdegroot1996
timdegroot1996 deleted the feat/361-dropdown-open-upwards branch September 26, 2026 15:58
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.

[Improvement] Filter dropdowns should open upwards when there's not enough space below

1 participant