Skip to content

fix(web): Add m: to search query upon loading results. - #2954

Merged
alextran1502 merged 1 commit into
immich-app:mainfrom
aero31aero:01-clip-status
Jun 28, 2023
Merged

alextran1502 merged 1 commit into
immich-app:mainfrom
aero31aero:01-clip-status

Conversation

@aero31aero

Copy link
Copy Markdown
Contributor

Previously, we'd drop the m: from non-clip searches entirely. This behavior incorrectly represents the page's status (results from non-clip search but query implies a clip search). Also, any follow-up searches change to clip searches, which feels like a jarring UX if you have to add m: every time in a 'search-session'.

@vercel

vercel Bot commented Jun 25, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Jun 26, 2023 6:21pm

Comment thread web/src/routes/(user)/search/+page.svelte Outdated
@aero31aero
aero31aero force-pushed the 01-clip-status branch 2 times, most recently from 9f7e1d3 to fcfeedd Compare June 25, 2023 22:25
Comment thread web/src/routes/(user)/search/+page.svelte Outdated

$: term = $page.url.searchParams.get('q') || data.term || '';
$: is_metadata_search = $page.url.searchParams.get('clip') === 'false';
$: term = `${!is_metadata_search && term !== '' ? 'm:' : ''}${term}`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here is the error I got when trying to run this
image

@aero31aero aero31aero Jun 26, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see. This is my first time with reactive statements; I figured it was a false warning since the typescript compiled properly. I just switched to an anonymous function with better legibility.

Previously, we'd drop the m: from non-clip searches entirely. This
behavior incorrectly represents the page's status (results from
non-clip search but query implies a clip search). Also, any follow-up
searches change to clip searches, which feels like a jarring UX if you
have to add m: every time in a 'search-session'.
@alextran1502
alextran1502 enabled auto-merge (squash) June 28, 2023 17:48
@alextran1502
alextran1502 merged commit b4e6415 into immich-app:main Jun 28, 2023
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.

3 participants