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

cuelang.org: allow an author to pre-populate a search box with a specific tag #3394

Closed
jpluscplusm opened this issue Aug 23, 2024 · 7 comments
Labels
cuelang.org frontend cuelang.org frontend UI/UX related

Comments

@jpluscplusm
Copy link
Collaborator

jpluscplusm commented Aug 23, 2024

What page were you looking at?

https://cuelang.org/examples/shortcodes/search/

What version of the site were you looking at?

cue-lang/cuelang.org@b24925a

What did you do?

I wanted to place a search box at /docs/reference/modules/ to display a list of all pages tagged with modules.

What did you expect?

That the search shortcode would allow me to pre-populate a search query with a tag, or some specific term.

What did you see instead?

I could only pre-populate a content type.

@jpluscplusm jpluscplusm added NeedsInvestigation Triage Requires triage/attention cuelang.org frontend cuelang.org frontend UI/UX related labels Aug 23, 2024
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Aug 23, 2024
This re-restablishes the path /docs/reference/modules/ by using it to
present a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
selected to give a rounded impression of the modules-related resources
available to the reader.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. This is tracked in cue-lang/cue#3394.

Also: the modules reference guide is retitled slightly in order to
provide a clear user experience when linking to it by title from across
the site.

Preview-Path: /docs/reference/modules/
Preview-Path: /docs/reference/modules/manual/
Preview-Path: /docs/reference/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
Dispatch-Trailer: {"type":"trybot","CL":1199965,"patchset":2,"ref":"refs/changes/65/1199965/2","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Aug 23, 2024
This re-restablishes the path /docs/reference/modules/ by using it to
present a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
selected to give a rounded impression of the modules-related resources
available to the reader.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. This is tracked in cue-lang/cue#3394.

Also: the modules reference guide is retitled slightly in order to
provide a clear user experience when linking to it by title from across
the site.

Preview-Path: /docs/reference/modules/
Preview-Path: /docs/reference/modules/manual/
Preview-Path: /docs/reference/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Aug 27, 2024
This re-restablishes the path /docs/reference/modules/ by using it to
present a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
selected to give a rounded impression of the modules-related resources
available to the reader. The landing page is included in the set of
pages which will persist in the LH nav, no matter which Reference
sub-page is being viewed.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. This is tracked in cue-lang/cue#3394.

Also: the modules reference manual is retitled slightly in order to
provide a clear user experience when linking to it by title from across
the site, and has its "toc_hide: true" removed, so that it persists in
the reference/modules/ section's LH nav even when the guide itself isn't
open.

Preview-Path: /docs/reference/modules/
Preview-Path: /docs/reference/modules/manual/
Preview-Path: /docs/reference/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Aug 27, 2024
This re-restablishes the path /docs/reference/modules/ by using it to
present a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
selected to give a rounded impression of the modules-related resources
available to the reader. The landing page is included in the set of
pages which will persist in the LH nav, no matter which Reference
sub-page is being viewed.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. This is tracked in cue-lang/cue#3394.

Also: the modules reference manual is retitled slightly in order to
provide a clear user experience when linking to it by title from across
the site, and has its "toc_hide: true" removed, so that it persists in
the reference/modules/ section's LH nav even when the guide itself isn't
open.

Preview-Path: /docs/reference/modules/
Preview-Path: /docs/reference/modules/manual/
Preview-Path: /docs/reference/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
Dispatch-Trailer: {"type":"trybot","CL":1199965,"patchset":3,"ref":"refs/changes/65/1199965/3","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Aug 28, 2024
This re-restablishes the path /docs/reference/modules/ by using it to
present a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
selected to give a rounded impression of the modules-related resources
available to the reader. The landing page is included in the set of
pages which will persist in the LH nav, no matter which Reference
sub-page is being viewed.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. This is tracked in cue-lang/cue#3394.

Also: the modules reference manual is retitled slightly in order to
provide a clear user experience when linking to it by title from across
the site, and has its "toc_hide: true" removed, so that it persists in
the reference/modules/ section's LH nav even when the guide itself isn't
open.

Preview-Path: /docs/reference/modules/
Preview-Path: /docs/reference/modules/manual/
Preview-Path: /docs/reference/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Aug 29, 2024
This re-restablishes the path /docs/reference/modules/ by using it to
present a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
selected to give a rounded impression of the modules-related resources
available to the reader. The landing page is included in the set of
pages which will persist in the LH nav, no matter which Reference
sub-page is being viewed.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. This is tracked in cue-lang/cue#3394.

Also: the modules reference manual is retitled slightly in order to
provide a clear user experience when linking to it by title from across
the site, and has its "toc_hide: true" removed, so that it persists in
the reference/modules/ section's LH nav even when the guide itself isn't
open.

Preview-Path: /docs/reference/modules/
Preview-Path: /docs/reference/modules/manual/
Preview-Path: /docs/reference/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Sep 6, 2024
This establishes the path /docs/concept/modules/ and uses it to present
a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
presented as a set of cards, selected to give a rounded impression of
the modules-related resources available to the reader.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. (Tracked in cue-lang/cue#3394).

Also: this landing page takes the place of the "Modules, Packages, and
Instances" concept guide on /docs/concept/popular-guides, whose outdated
content being updated is tracked in cue-lang/docs-and-content#179. The
modules tag is added to the outdated guide, so that it's at least
discoverable whilst it's removed from the popular-guides page.

Preview-Path: /docs/concept/modules/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
Signed-off-by: Jonathan Matthews <[email protected]>
Dispatch-Trailer: {"type":"trybot","CL":1199965,"patchset":9,"ref":"refs/changes/65/1199965/9","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue Sep 9, 2024
This establishes the path /docs/concept/modules/ and uses it to present
a landing page for CUE modules.

A brief introduction provides some context, before leading on to 6 pages
presented as a set of cards, selected to give a rounded impression of
the modules-related resources available to the reader.

The "modules" tag is linked to, instead of providing a dynamic on-page
list of the tagged content, because the search shortcode can't
pre-populate a query with a tag. (Tracked in cue-lang/cue#3394).

Also: this landing page takes the place of the "Modules, Packages, and
Instances" concept guide on /docs/concept/popular-guides, whose outdated
content being updated is tracked in cue-lang/docs-and-content#179. The
modules tag is added to the outdated guide, so that it's at least
discoverable whilst it's removed from the popular-guides page.

Preview-Path: /docs/concept/modules/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Ia8dc6b1d6e4909469a34200d97ff4f0a2ea6e076
Signed-off-by: Jonathan Matthews <[email protected]>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1199965
Reviewed-by: Paul Jolly <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
@jpluscplusm jpluscplusm removed the Triage Requires triage/attention label Sep 25, 2024
@jpluscplusm jpluscplusm changed the title cuelang.org: allow an author to pre-populate a search box with a specific tag cuelang.org: allow an author to pre-populate a search box with a specific tag or search term Sep 25, 2024
@Wies-UsMedia
Copy link
Collaborator

@jpluscplusm For this feature, would you prefer to see the pre-selected tags as unchangeable by the user, similar to content type? Or would you prefer the user being able to modify the selected tags?

@jpluscplusm
Copy link
Collaborator Author

jpluscplusm commented Oct 1, 2024

@jpluscplusm For this feature, would you prefer to see the pre-selected tags as unchangeable by the user, similar to content type? Or would you prefer the user being able to modify the selected tags?

Summary

I'd opt for both the pre-selected search terms and tags to be modifiable by the user, with the only hard requirement being that they should be able to be added to. If the implementation is made significantly simpler by ruling out modification of pre-selected tags, then that option is also fine. I don't feel we want to block the modification of pre-selected search terms.


@Wies-UsMedia The rationale for a content type being unchangeable when set was that the search box was being presented inside a specific content hierarchy, and it would feel odd for a user to be presented with the "wrong" content type when its such a fundamental part of the hierarchy. Each page's URL has (more or less) the content type baked in, and if it were possible to copy and share a URL that clearly lived inside content-type A, but which displayed search results for content-type B, then we felt it would potentially be confusing.

I think this issue's use case is different. Or, at least, the risk of confusion is significantly reduced. Sure, we could have a search widget under a /docs/concept/all-about-foo/ hierarchy that initially presents tag foo, but if someone shares a URL with a q query-string that deselects foo and selects bar, then that feels like less of a problem.

My sense is that both a pre-set tag and search string should be editable by the user - unless that's much more complex to implement.

I think my only "must have" is that search terms and tags, when pre-set, should be able to be added to by the user. In other words, if a user is presented with a pre-set search widget for tag:foo "CUE bar baz" that displays 50 search results, we want them to be able to refine that list by adding more search terms and/or tags. If they can't remove the pre-set values that that's not a big problem - please be guided by the implementation challenges, there. I've just tested on the site, and tag:foo tag:bar contains an implicit logical AND (not OR) between the terms - which is compatible with this, to my mind.

@JorindeUsMedia
Copy link
Collaborator

JorindeUsMedia commented Oct 16, 2024

Thanks for clarifying @jpluscplusm

Todo Us Media:

  • Add option to add Tags (multiple I think to be flexible, so an array) to the search shortcode (optional field)
  • Get the tags from the shortcode in the layout and/or js and preselect them before sending the search request to algolia.
  • Algolia should now return results with the right content type & tags filters on. User can manually deselect tags after if they want to.

estimate: 2-3 hours

Wies-UsMedia added a commit to developer-usmedia/cuelang.org that referenced this issue Nov 1, 2024
Adds a feature to allow tags to added to the search widget. These
will be preselected tags, but can be manually removed after by the
user.

To test and compare, see:
https://cuelang.org/examples/shortcodes/search/

Fixes cue-lang/cue#3394
Wies-UsMedia added a commit to developer-usmedia/cuelang.org that referenced this issue Nov 1, 2024
Adds a feature to allow tags to added to the search widget. These
will be preselected tags, but can be manually removed after by the
user.

To test and compare, see:
https://cuelang.org/examples/shortcodes/search/

Fixes cue-lang/cue#3394

Signed-off-by: Wies de Graaf <[email protected]>
Wies-UsMedia added a commit to developer-usmedia/cuelang.org that referenced this issue Nov 5, 2024
Adds a feature to allow tags to added to the search widget. These
will be preselected tags, but can be manually removed after by the
user.

To test and compare, see:
https://cuelang.org/examples/shortcodes/search/

Fixes cue-lang/cue#3394

Signed-off-by: Wies de Graaf <[email protected]>
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Nov 5, 2024
Adds a feature to allow tags to added to the search widget. These
will be preselected tags, but can be manually removed after by the
user.

To test and compare, see:
https://cuelang.org/examples/shortcodes/search/

Fixes cue-lang/cue#3394

Closes #477 as merged as of commit 3963a410.

Signed-off-by: Wies de Graaf <[email protected]>
Change-Id: I56a893311c1022a533ec1a631d63af9717d16f6e
Dispatch-Trailer: {"type":"trybot","CL":1203609,"patchset":1,"ref":"refs/changes/09/1203609/1","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue Nov 5, 2024
Adds a feature to allow tags to be added to the search widget. These
will be preselected tags, but can be manually removed by the user after
the page loads.

Fixes cue-lang/cue#3394

Closes #477 as merged as of commit 3963a410.

Preview-Path: /examples/shortcodes/search/
Signed-off-by: Wies de Graaf <[email protected]>
Change-Id: I56a893311c1022a533ec1a631d63af9717d16f6e
Dispatch-Trailer: {"type":"trybot","CL":1203609,"patchset":2,"ref":"refs/changes/09/1203609/2","targetBranch":"master"}
@github-project-automation github-project-automation bot moved this from Planned to Done in cuelang.org Roadmap Nov 5, 2024
@jpluscplusm
Copy link
Collaborator Author

Reopening to reflect that predefined search text still needs to be considered.

@jpluscplusm jpluscplusm reopened this Nov 8, 2024
@JorindeUsMedia
Copy link
Collaborator

JorindeUsMedia commented Nov 8, 2024

Reopening to reflect that predefined search text still needs to be considered.

@jpluscplusm Do you mean if you manually add it to the url? The shortcode does not support adding a predefined query text at the moment.

If you mean via the url: http://localhost:1313/examples/shortcodes/search/?q=schema
I have no way of knowing if this is the first time you 're on the page with the search widget or if this url is the result of removing tags. The url is where we keep the 'state' of the widget. Right now we're not keeping track anywhere if the update of the url is caused by manually changing the filters or clicking a link on a docs page.

For instance:
I go to this page https://cuelang.org/examples/shortcodes > the predefined tags get selected and added to the url.
Result: https://cuelang.org/examples/shortcodes/search/?q=%20tag:encodings%20tag:%22commented%20cue%22
I now search for another term, lets say 'schema'. The urls gets updated and the page reloads with cause the search to trigger:
https://cuelang.org/examples/shortcodes/search/?q=%20tag:encodings%20tag:%22commented%20cue%22%20schema
I now remove the predefined tags, the url gets updated again:
https://cuelang.org/examples/shortcodes/search/?q=schema

So I can't decide when there is just a text query in the url but no tags: add preselected tags. Because that means that in the case above that there's no way of removing the predefined tags because they would get added again when no tags are present in the url.

@JorindeUsMedia
Copy link
Collaborator

Just discussed with jonathan. I've misunderstood the question.
What was missing from this issue is that we've now added the option to add predefined tags to the search shortcode but not yet the option to add a predefined text query. Jonathan will create a new issue for that one.

@jpluscplusm
Copy link
Collaborator Author

jpluscplusm commented Nov 8, 2024

Closing as discussed with @JorindeUsMedia.

I've opened #3566 to track the predefined-search-text issue - but this additional feature will need to prove its necessity a few times before we'll choose to implement it.

@jpluscplusm jpluscplusm changed the title cuelang.org: allow an author to pre-populate a search box with a specific tag or search term cuelang.org: allow an author to pre-populate a search box with a specific tag Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuelang.org frontend cuelang.org frontend UI/UX related
Projects
Status: Done
Development

No branches or pull requests

3 participants