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

Feature 1338: Suche anpassen #1401

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

daniel-va
Copy link
Contributor

Resolves #1338.

@daniel-va daniel-va requested a review from TIL-EBP December 3, 2024 08:03
@TIL-EBP
Copy link
Contributor

TIL-EBP commented Dec 5, 2024

Some things I have found while testing, before looking at any code:

  • When navigating the search results, you are zooming straight to the search result. As far as i can tell from the ticket description, this was not required. It should only go there on click or enter.
  • You are zooming the the wrong result: When navigating with arrow keys, you are zooming to the previously selected result and not the newly selected one. (Search für "zü")
    image
    The first arrow-navigation does not do anything, the second pans to zürich, instead of zürichsee. However, sind the zooming and paning is not a requirement in the first place, I would just remove it altogether (They mention they want the same behavior as map.geo.admin, where the selected result only gets highlighted without any zoom. Only on click does the map pan there.
  • When navigating with the arrow keys over datasets, they are immediately added to the map and stay there even after navigating away with the arrow keys. I believe it should only give a preview and then disappear again. Only on enter should the map be added to the Data displayed (Again, see map.geo.admin.ch)

ui/src/elements/ngm-side-bar.ts Show resolved Hide resolved
ui/src/ngm-app.ts Show resolved Hide resolved
ui/src/ngm-app.ts Outdated Show resolved Hide resolved
ui/src/ngm-app.ts Show resolved Hide resolved
ui/src/style/header.css Outdated Show resolved Hide resolved
ui/src/components/search/search-input.ts Outdated Show resolved Hide resolved
</ga-search>

<span class="icon is-close" @click="${this.clear}"></span>
<span class="icon is-search" @click="${this.toggleActive}"></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

what exactly is the desired behavior on this? When i click the search icon, the result list just flickers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for mobile only, where the search is only visible after clicking the search icon. On desktop, it should just focus the search input. Does something else happen for you (e.g. flickering)? I was not able to reproduce it as of yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe flickering is the wrong word, but when it is in focus already and i click it again, the results quickly disappear (while hodling the mouse) and then reappear. BUt this might just be browser behavior

ui/src/components/search/search-input.ts Outdated Show resolved Hide resolved
const target = this.findActiveResult();
if (target != null) {
const [item, _element] = target;
this.selectItem(item, {keepFocus: true});
Copy link
Contributor

Choose a reason for hiding this comment

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

i dont think we want to select the items on arrow keys, but only on click and enter. You can temporarily add the layers as preview, but they should not be added as permanent layers (see general comment)

ui/src/components/search/search-input.ts Show resolved Hide resolved
@daniel-va daniel-va force-pushed the feature/viewer-1338-suche-anpassen branch from c122c91 to 2ae8b39 Compare December 9, 2024 11:54
Copy link

sonarqubecloud bot commented Dec 9, 2024

Copy link
Contributor

@TIL-EBP TIL-EBP left a comment

Choose a reason for hiding this comment

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

Looks pretty good, most things are fixed now.
Waiting for Nils to confirm which behavior he wants and the fixes for the inputs with event listeners on them/ disappearing clear button

@@ -333,6 +338,7 @@ export class SearchInput extends LitElementI18n {
const child = results.children[i];
if (child.ariaSelected === 'true') {
const item = this.resultItems[i];
console.log(item, child);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

this.classList.add('is-active');
} else {
this.classList.remove('is-active');
console.log(changedProperties);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

<ul ${ref(this.resultsRef)}></ul>
</ga-search>

<span class="icon is-close" @click="${this.clear}"></span>
Copy link
Contributor

@TIL-EBP TIL-EBP Dec 9, 2024

Choose a reason for hiding this comment

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

this now disappears as soon as i start searching

Edit: this was introduced in faab0bd7

</ga-search>

<span class="icon is-close" @click="${this.clear}"></span>
<span class="icon is-search" @click="${this.toggleActive}"></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe flickering is the wrong word, but when it is in focus already and i click it again, the results quickly disappear (while hodling the mouse) and then reappear. BUt this might just be browser behavior

display: none;
}

:host:not(.is-active) .icon.is-close {
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be reomved, right?

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.

Suche anpassen
2 participants