체크박스가 있는 태그 검색 시 모바일에서 결과가 표시되지 않음

:warning: 2023년 8월 참고사항: 이 주제의 이전 예시에는 더 이상 존재하지 않는 태그에 대한 참조가 포함되어 있지만, 빈 검색 결과 문제는 여전히 지속되고 있습니다.

https://meta.discourse.org/tags/c/theme/61/theme-component 주소를 모바일로 방문하여 확대경 아이콘을 탭하고, 예를 들어 "topic"을 검색한 다음 “Customization > Theme component 태그로 검색” 체크박스를 탭하면 두 가지 문제가 발생합니다.
한편으로는 박스가 체크되도록 체크박스를 두 번 탭해야 합니다. 다른 한편으로는 체크박스를 한 번 또는 두 번 탭해도 검색 결과가 없는데, 데스크톱 검색을 사용하면 많은 결과가 나옵니다.

체크박스 없이 모바일에서 검색


https://meta.discourse.org/search?context=tag&context_id=theme-component&q=Topic&skip_context=true

모바일에서 검색 & 체크박스 한 번 탭


https://meta.discourse.org/search?context=tag&context_id=theme-component&q=Topic&skip_context=false

모바일에서 검색 & 체크박스 두 번 탭


https://meta.discourse.org/search?context=tag&context_id=theme-component&q=Topic&skip_context=false

데스크톱 보기로 검색


https://meta.discourse.org/search?q=topic%20%23theme-component

검색창에 #customization:theme-component를 직접 입력하면 모바일에서도 결과를 얻을 수 있다는 것은 알고 있지만, 체크박스를 제공하는 의도가 그것이라고는 생각하지 않습니다.

3개의 좋아요

Hey, good catch @moin. I think you may have found two bugs. :slight_smile:

  1. The checkbox doesn’t work immediately, and
  2. Scoping search to a tag creates a route that Discourse serves with a 403

Checkbox isn’t checking

In the mobile the search link adds “context” to the URL, which reveals the checkbox to be toggled in question. In this case, the URL we are looking at is https://meta.discourse.org/search?context=tag&context_id=theme-component&skip_context=true.

When we toggle the checkbox, we are changing the search query where skip_context changes from true to false and back again. It also means you may craft a URL where the box is checked by default, such as https://meta.discourse.org/search?context=category&context_id=1&skip_context=false. This is important, because I’ve noticed different behaviour between the two states when they load.

skip_context=true

The default on mobile view, and the box will not be checked. Interacting with the checkbox, with touch or keyboard, changes the URL to skip_context=false, but does not check the checkbox. Clicking once more will check it, keeping “false” in the URL.

Afterward it may be toggled back and forth, with corresponding URL changes as expected.

skip_context=false

When the search is loaded the checkbox is checked, and interacting with it works as expected: each interaction changes the checkbox and the URL.


I’ve noticed separately that using those checkboxes also causes me to lose focus on the page, regardless of the skip_context value; hopefully it’s the same thing causing our double-click issue. :slight_smile:

I’ve reproduced this behavior in safe-mode and on mobile devices.

Okay, I’ll see what I can explain about the tags not scoping in a follow up reply, so it’s easier to split off it needed.

4개의 좋아요

검색 결과에서 태그 스코핑 시 403 반환

이 문제는 제가 당황하게 만들었습니다. 메타 사이트 밖에서 재현을 시도하다가 검색 컨텍스트에서 태그 대신 카테고리를 잘못 로드했기 때문입니다. 오히려 다행인 점은, 제 실수를 깨달았을 때 해당 컨텍스트에서 검색 쿼리가 어떻게 생성되는지 알게 되었다는 것입니다.

#customization:theme와 #customization:theme-component를 예로 들어 설명하겠습니다.

태그에 대한 검색 컨텍스트를 사용할 때, 요청은 https://meta.discourse.org/search?q=topic&page=1&search_context[type]=tag&search_context[id]=theme-component와 같이 보이며, 403이 반환됩니다.

카테고리에 대한 검색 컨텍스트를 사용할 때, 요청은 https://meta.discourse.org/search?q=topic&page=1&search_context[type]=category&search_context[id]=61와 같이 보이며, 예상대로 결과가 반환됩니다.

또한, 고급 검색 필터에서 태그를 선택하면 요청은 https://meta.discourse.org/search?q=tags:theme-component&page=1와 같이 보이며, 해당 태그가 포함된 결과가 반환됩니다.

안전 모드에서도 &search_context[type]=tag&search_context[id]=theme-component 경로가 403을 반환하는 것을 재현할 수 있습니다.

다른 search_context 유형이 있나요? 코드를 잠깐 살펴봤지만 파악하지 못했습니다. 있다면 그것들도 테스트해 볼 수 있습니다.

3개의 좋아요

Continuing the discussion from Discourse Subscriptions - allow subscription of predetermined length:

I was going to link to posts I created with the subscriptions tag, so I went to the tag listing page, and searched from there. No results – see below. When I search from the main page it works all right. It might be the tickbox is the problem, as that is a difference.

1개의 좋아요

I can confirm this. Just tried searching from the post-voting tag with the option ticked, and it couldn’t find any results (@mention or other regular keyword)

Android/Chrome

(not checked desktop yet) I checked on Desktop and it works fine.

Is that one of the issues I reported here?

2개의 좋아요

I didn’t have a problem ticking the box, but the lack of results seems to be the same problem.

I have merged the topics. :+1: (and tweaked the OP a tiny bit).

Just to make a note here as well; the example tags in the OP no longer exist, though the issue with the blank search results on mobile they demonstrated still does.

My pretty basic step-by-step:

  • On mobile, go to the post-voting topic list
  • Open Search and check the Search the #post_voting tag checkbox
  • Enter something that would definitely give a hit (eg. ‘comment’ or ‘@JammyDodger’)
  • Press ‘Search’

Result: ‘No results found

Expected Result: It finds me things

2개의 좋아요

This is indeed a bug, thanks for the report, folks. It should be fixed when this PR is merged: FIX: Search by tag context was broken by pmusaraj · Pull Request #23006 · discourse/discourse · GitHub

2개의 좋아요

This has now been merged :partying_face:

https://github.com/discourse/discourse/pull/23006

3개의 좋아요

This topic was automatically closed after 2 days. New replies are no longer allowed.