Skip to content

feat: #1992 - Context-wide search - #3056

Open
krugar wants to merge 6 commits into
nextcloud:mainfrom
krugar:feat/1992-context-wide-search
Open

krugar wants to merge 6 commits into
nextcloud:mainfrom
krugar:feat/1992-context-wide-search

Conversation

@krugar

@krugar krugar commented Oct 2, 2026 •

Copy link
Copy Markdown

This is a follow-up to PR #3055 and adds a Context-wide search box under the Context description, in reaction to issue #1992

If you prefer a different placement/UX of the search input box, let me know?

🖼️ Screenshots

image
🏚️ Before 🏡 After
no Context-wide search option Context-wide search input box added under the Context's description

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

krugar added 4 commits October 2, 2026 10:46
Previously all resources of an application (context) shared a single
viewSetting object. Because the per-view localViewSetting chain ends up
referencing that same object, entering a search term above one view
mutated the shared object and thereby filtered every view in the
application at once. Clearing the search once decoupled only that one
view (the deep clone in setSearchString), which made the behavior
inconsistent depending on interaction order.

View settings (search string, filters, hidden columns, sorting) are now
kept per resource, keyed by the resource key, and reset when the
application is reloaded.

Fixes: nextcloud#3008

Assisted-by: pi:glm-5.3-flash
Signed-off-by: Alexander R. Krug <krug@coll.mpg.de>
Add a Cypress spec asserting that a search term entered above one view
of an application filters only that view while the other views of the
application stay uninterrupted, and that clearing the search un-filters
it. Guards against a regression of the shared viewSetting object that
previously leaked the search across all views (fixes nextcloud#3008).

To make the fixture buildable and the assertions robust:

- extend the createContext command with optional resource titles,
  driven through the creation modal's contextResourceForm typeahead
- add stable data-cy hooks: contextTableNode / contextViewNode on the
  context page's per-resource wrappers and elementSearchInput on the
  shared per-element search input, so the tests can scope to one
  resource's search input without depending on markup or class order
- add the spec to the committed e2e test list
- collapse two pre-existing double blank lines in commands.js flagged
  by lint

Signed-off-by: Alexander R. Krug <krug@coll.mpg.de>
Add a search field at the application (context) level that filters all
resources of the application at once, as requested in nextcloud#1992.

The search term is debounced (500ms, same as the per-view search) and
passed down to every resource as a contextSearchString prop. NcTable
applies it as the effective search string when the view itself has no
search string set, so per-view search restrictions keep working
independently and keep precedence when both are set. The filtered state
is also reflected in the 'Export filtered rows' action.

Assisted-by: pi:glm-5.3-flash
Signed-off-by: Alexander R. Krug <krug@coll.mpg.de>
Assert that the application-level search field filters all resources of
the application at once and that clearing it restores them, covering
the context-wide search introduced with nextcloud#1992.

The context search input is exposed as data-cy="contextSearchInput".

Assisted-by: pi:glm-5.3-flash
Signed-off-by: Alexander R. Krug <krug@coll.mpg.de>
@krugar
krugar requested review from blizzz and enjeck as code owners October 2, 2026 09:27
@krugar krugar changed the title Feat/1992 context wide search feat: #1992 - Context-wide search Oct 2, 2026
Replace the Cypress regression test for the per-view search scope
(nextcloud#3008) with a Playwright spec, addressing the review feedback on the
PR:

- Playwright instead of Cypress
- no wait(): the debounced search is synchronized with retrying
  toHaveCount assertions instead of waitForTimeout
- no inter-test reliance: every test builds its own fixture through the
  per-test userPage fixture (own random user per test), and the suite
  runs fully parallel

The createContext helper in the Playwright support code gains optional
resource titles, driven through the creation modal's
contextResourceForm typeahead. The data-cy hooks
(contextTableNode/contextViewNode/elementSearchInput) are unchanged.

The Cypress spec, its createContext extension and the spec-list entry
are removed again.

Assisted-by: pi:glm-5.3-flash
Signed-off-by: Alexander R. Krug <krug@coll.mpg.de>
Assert that the application-level search field filters all resources of
the application at once and that clearing it restores them, covering
the context-wide search introduced with nextcloud#1992. Runs as an independent
Playwright test with its own fixture, no waits and no reliance on other
tests.

The context search input is exposed as data-cy="contextSearchInput".

Assisted-by: pi:glm-5.3-flash
Signed-off-by: Alexander R. Krug <krug@coll.mpg.de>
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