Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Create filter-plugin architecture for unified search #43189

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

nfebe
Copy link
Contributor

@nfebe nfebe commented Jan 29, 2024

Description

This commit introduces the mechanism for apps out of the call, to add search filters to the unified search "Places" filter selector.
Resolves : #42914

TODO

Manual Testing

Set spreed/talk branch to : nextcloud/spreed#11575

@nfebe nfebe force-pushed the 42914-search-in-single-talk-room branch 7 times, most recently from dd46a77 to 82cbdb7 Compare February 6, 2024 09:51
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, 2 details:

  • As @marcoambrosini said: Rename the current "Conversations" filter to "Talk" for better clarity
  • The "In conversation" should be moved further up so it is grouped with the other Talk-related filters

@nfebe
Copy link
Contributor Author

nfebe commented Feb 6, 2024

As @marcoambrosini said: Rename the current "Conversations" filter to "Talk" for better clarity

The reason this was not done straight way is because the providers (come from the backend) but it's possible to loop and find specific filters and rename them, don't know if this route would be okay.

@marcoambrosini
Copy link
Member

The reason this was not done straight way is because the providers

I think it's better to do it properly in the backend no?

Copy link
Member

@marcoambrosini marcoambrosini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The only thing that I would add is a search box on top of the places filter too. These can be a lot (see our company instance) and it might also get confusing.
It would be also great to set up search aliases, for example if someone searches "Chat", they're also presented with the "talk" and "conversation" filters.

@nfebe nfebe force-pushed the 42914-search-in-single-talk-room branch 4 times, most recently from c5920f4 to 33a4fb5 Compare February 12, 2024 16:31
@nfebe nfebe changed the title Feat: Narrow search to single conversation in unified search Feat: Create filter-plugin architecture for unified search Feb 12, 2024
@nfebe
Copy link
Contributor Author

nfebe commented Feb 12, 2024

The context of the PR has changed and actual UI changes that his PR initially contained are now in : nextcloud/spreed#11575

@nfebe nfebe force-pushed the 42914-search-in-single-talk-room branch 4 times, most recently from e25f0ff to 71da116 Compare February 12, 2024 22:14
@nfebe nfebe marked this pull request as ready for review February 12, 2024 22:22
@nfebe nfebe force-pushed the 42914-search-in-single-talk-room branch 6 times, most recently from 81a824e to 857477c Compare March 4, 2024 08:30
@nfebe
Copy link
Contributor Author

nfebe commented Mar 4, 2024

/compile

core/src/store/unified-search-external-filters.js Outdated Show resolved Hide resolved
core/src/views/UnifiedSearchModal.vue Outdated Show resolved Hide resolved
core/src/unified-search.js Outdated Show resolved Hide resolved
@ChristophWurst ChristophWurst added the pending documentation This pull request needs an associated documentation update label Mar 4, 2024
@nfebe nfebe force-pushed the 42914-search-in-single-talk-room branch from 6754a8c to 0c38e89 Compare March 4, 2024 16:01
@emoral435 emoral435 self-requested a review March 4, 2024 16:11
core/src/unified-search.js Outdated Show resolved Hide resolved
@@ -258,8 +263,13 @@ export default {

},
mounted() {
subscribe('nextcloud:unified-search:add-filter', this.handlePluginFilter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a no from me, using an event to actually handle this registrations are not a stable way to do so.

I'd suggest using a proper registration like the event bus or the file actions is doing.

@@ -412,12 +423,27 @@ export default {
},
addProviderFilter(providerFilter, loadMoreResultsForProvider = false) {
if (!providerFilter.id) return
if (providerFilter.isPluginFilter) {
providerFilter.callback()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a callback? What does it do?
A callback that is called without any parameters is odd to me.

Copy link
Contributor

@emoral435 emoral435 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, good PR!

There are a few places where it gets confusing between the name and label attributes, and I agree with the API choices that the other reviewers have mentioned. Perhaps for tomorrows team call / Thursday PR chat's, you can schedule something to be aligned with the team, because I understand the time conflicts are not easy ahaha :)

core/src/unified-search.js Outdated Show resolved Hide resolved
core/src/views/UnifiedSearchModal.vue Show resolved Hide resolved
@nfebe nfebe force-pushed the 42914-search-in-single-talk-room branch from 0c38e89 to f61aee4 Compare March 5, 2024 10:54
@nickvergessen nickvergessen dismissed their stale review March 5, 2024 11:00

Dismissing my review as the code/UI parts of Talk are not here anymore

@nfebe nfebe requested a review from skjnldsv March 5, 2024 11:12
@nickvergessen nickvergessen removed their request for review March 5, 2024 11:34
@Antreesy
Copy link
Contributor

Antreesy commented Mar 5, 2024

Clicking on Load more results changes the filtering method (or drops some query params at least). Is it expected?

Screencast.from.05.03.2024.17.29.31.webm

Copy link
Contributor

@emoral435 emoral435 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of cases where to make the code clearer and more maintainable for the future, good PR :) Discussed with others, and the API deprecation can be handled later, just make sure to address #43189 (comment) and its all good to me!

nfebe added 2 commits March 6, 2024 02:05
This commit introduces the mechanism for apps out of the call,
to add search filters to the unified search "Places" filter selector.

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
@nfebe nfebe force-pushed the 42914-search-in-single-talk-room branch from f61aee4 to 647f4bc Compare March 6, 2024 01:06
@nfebe
Copy link
Contributor Author

nfebe commented Mar 6, 2024

/compile /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@nfebe
Copy link
Contributor Author

nfebe commented Mar 6, 2024

Outside of cases where to make the code clearer and more maintainable for the future, good PR :) Discussed with others, and the API deprecation can be handled later, just make sure to address #43189 (comment) and its all good to me!

Sure thanks, would address that in follow up #43963 which is on its way in, I think it's best this goes in now so at the very least the spreed filter is working by feature freeze.

@skjnldsv skjnldsv dismissed their stale review March 6, 2024 09:55

addressed

@nfebe nfebe merged commit 0a64b69 into master Mar 6, 2024
98 checks passed
@nfebe nfebe deleted the 42914-search-in-single-talk-room branch March 6, 2024 10:07
@blizzz blizzz mentioned this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement feature: search pending documentation This pull request needs an associated documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🔍🗨️ Unified Search in individual Talk room
9 participants