Skip to content

Adds search based on link owner - #213

Merged
willnorris merged 1 commit into
mainfrom
tim/mine-search
Feb 15, 2026
Merged

Adds search based on link owner#213
willnorris merged 1 commit into
mainfrom
tim/mine-search

Conversation

@timtailscale

Copy link
Copy Markdown
Contributor

add search endpoint with support for owner filtering, the all page now uses the search template with the expectation that all becomes a "search" once search is fully implemented

updates #98

@parkr parkr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Drive-by comment for your Wednesday! Please ignore unless it provides value to you.

Comment thread golink.go
}

sort.Slice(links, func(i, j int) bool {
return links[i].Short < links[j].Short

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't sorting be user-defined? I might want to change the sorting (e.g. to created date) in the UI. Should that be supported?

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.

Hey Parker! 👋🏻

eventually, yes probably. Tim and I talked a lot about what future features we might want to build in the search endpoint and whittled that down to a simple first feature that was pretty straightforward to implement, and could easily be extended to support additional search operators in the future.

Custom sort will be a good thing to add as well, including on the existing /.all page. In fact, I'm expecting that /.all will pretty quickly just become a redirect for /.search, since it's basically just search without any query to limit the results.

Comment thread golink.go
query := r.URL.Query().Get("q")
owner, found := strings.CutPrefix(query, "owner:")
if !found {
http.Error(w, `search only supports "owner:<email>"`, http.StatusBadRequest)

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.

need a return after this, so that it doesn't also try to render the page. For example, try loading the /.search page without any query.

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.

just went ahead and fixed this myself.

add search endpoint with support for owner filtering, the all page
now uses the search template with the expectation that all becomes
a "search" once search is fully implemented

updates #98

Signed-off-by: Tim Walters <tim@tailscale.com>
Comment thread golink.go
query := r.URL.Query().Get("q")
owner, found := strings.CutPrefix(query, "owner:")
if !found {
http.Error(w, `search only supports "owner:<email>"`, http.StatusBadRequest)

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.

just went ahead and fixed this myself.

@willnorris
willnorris merged commit aa7bf1a into main Feb 15, 2026
1 check passed
@willnorris
willnorris deleted the tim/mine-search branch February 15, 2026 23:22
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