Skip to content

Add YForm live search overlay to the YForm button (#187) - #209

Merged
skerbis merged 3 commits into
FriendsOfREDAXO:mainfrom
skerbis:feature/yform-live-search
Sep 17, 2026
Merged

skerbis merged 3 commits into
FriendsOfREDAXO:mainfrom
skerbis:feature/yform-live-search

Conversation

@skerbis

@skerbis skerbis commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

Extends the existing YForm table dropdown button with a Spotlight-style live search across datasets of all permitted YForm tables. This addresses the issues reported in #187 with the old yform_usability inline pjax search (destroyed addon-owned tab navigation via #rex-js-page-main replacement, and edit links always pointing to the YForm standard path even from addon-owned pages) by building the search natively into quick_navigation instead, reusing its existing table-permission and button infrastructure.

  • Global overlay opened from the header YForm button (custom database+magnifier icon, not the generic fa-database)
  • The table dropdown (bootstrap-select, container: 'body' so it's never clipped by the overlay) sits permanently next to the search field — it stays visible and changeable at any point, including mid-search, without losing the current search term
  • Field-type-aware, collapsible filters per table: select for choice/checkbox fields, date/datetime inputs, number input
  • Result preview reuses YForm's own getListValue() formatting instead of raw values:
    • choice/select values as label badges (using the field's own Label=value choices string, decoded exactly like rex_yform_value_abstract::getArrayFromString())
    • checkbox fields as colored yes/no badges
    • fields_tagging values as colored tag badges (not raw JSON)
    • yform_lang_fields JSON columns as per-language chips (not raw JSON/HTML), searched via JSON_TABLE
  • name/title/cat/category columns (plus admin-configurable extra columns via a new setting on the addon's config page) are shown first and highlighted as the result's title line
  • Edit links reuse the currently open addon page when it already shows the same table (via rex_be_controller::getCurrentPage()), otherwise fall back to rex_yform_manager::url() — correct CSRF handling either way, no more manually-built URLs missing CSRF params
  • Keyboard navigation: arrows/tab move between the search field and the table/result list, enter opens the focused entry
  • Table rows in the dropdown/list show the table's own configured icon (rex_yform_manager_table::getCustomIcon()) instead of a generic placeholder
  • Table access respects isGranted()-style permission checks but does not exclude isHidden() tables (hidden only means "no menu entry in YForm manager", not "no access" — excluding them broke exactly the scenario Mobile Darstellung #187 was about, e.g. rex_yrewrite_domain_settings)
  • All 8 REDAXO-core-supported languages shipped in full (de_de, en_gb, es_es, it_it, nl_nl, pt_br, ru_ru, sv_se)

Version bumped to 9.2.0, CHANGELOG and both READMEs updated.

Test plan

  • Manually tested end-to-end against a REDAXO 5.21 instance with ~15 YForm tables (permission checks, hidden-table inclusion, table switching mid-search, filters incl. multi-value-choice exclusion, be_manager_relation fields correctly excluded from LIKE search to avoid SQL errors, fields_tagging/yform_lang_fields/checkbox/choice preview rendering, keyboard navigation, dropdown clipping, dark mode)
  • Would appreciate a review of the rex_yform_manager_field API usage (isHiddenInList(), isSearchable(), getType()/getTypeName()) against other supported YForm versions, since this was tested against a single installed version

🤖 Generated with Claude Code

skerbis and others added 3 commits September 17, 2026 19:44
Extends the existing YForm table dropdown with a Spotlight-style
search across datasets of all permitted YForm tables, addressing
the inline pjax search issues reported in yform_usability#187
(broken addon-page tab navigation, wrong edit links).

- Global overlay opened from the header YForm button; the table
  dropdown stays visible next to the search field at all times
  (bootstrap-select, container: body so it isn't clipped) and can
  be changed mid-search without losing the current term
- Field-type-aware, collapsible filters per table (select for
  choice/checkbox, date/datetime inputs, number input)
- Result preview reuses YForm's own getListValue() formatting:
  choice values as label badges, checkboxes as colored yes/no
  badges, fields_tagging values as colored tag badges, and
  yform_lang_fields JSON columns as per-language chips instead of
  raw JSON/HTML
- name/title/cat/category (plus admin-configurable extra columns
  in the addon settings) are shown first and highlighted as the
  result title
- Edit links reuse the currently open addon page when it already
  shows the same table, otherwise fall back to
  rex_yform_manager::url() (correct CSRF handling either way)
- Keyboard navigation between the search field and the table/result
  list (arrows, tab, enter)
- Table rows show the table's configured icon
- Custom database+magnifier icon for the trigger button
- All 8 REDAXO-core-supported languages shipped in full

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Matches the search/table-select header bar to REDAXO's own
navbar color (#4b9ad9 / #246eaa dark) instead of a neutral gray,
so the overlay reads as part of the backend chrome rather than a
foreign widget.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Switch from scattered body.rex-theme-dark overrides to CSS custom
properties, mirroring the pattern already used by this addon's own
media-live-search.css: variables on :root (light default), redefined
under .rex-theme-dark, .rex-has-theme.rex-theme-dark (explicit dark),
and again under @media (prefers-color-scheme: dark) guarded to
.rex-has-theme:not(.rex-theme-light):not(.rex-theme-dark) for the
"Automatic" theme setting with no explicit choice.

Also raises the on/off badge text contrast in dark mode to meet
WCAG AA (4.5:1) against the dark panel background — both were
previously below it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@skerbis
skerbis merged commit 89892d7 into FriendsOfREDAXO:main Sep 17, 2026
1 check failed
skerbis added a commit to skerbis/quick_navigation that referenced this pull request Sep 17, 2026
Resolves conflicts in package.yml/CHANGELOG.md from FriendsOfREDAXO#209/FriendsOfREDAXO#210/FriendsOfREDAXO#212
having merged first: bumps the version to 9.2.1 (patch on top of
the now-released 9.2.0) and keeps both changelog entries.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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