Skip to content

sort-conversations-by-update-time - Restore trailing space in query#9359

Merged
fregante merged 8 commits into
mainfrom
copilot/fix-sort-conversations-space-issue
May 7, 2026
Merged

sort-conversations-by-update-time - Restore trailing space in query#9359
fregante merged 8 commits into
mainfrom
copilot/fix-sort-conversations-space-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

I suppose this makes sense. My guess is that the change happened on GitHub's side, where they'd automatically append a space to the query even if it wasn't there, but they no longer do that.

@fregante fregante added the bug label May 7, 2026
@fregante fregante changed the title [WIP] Fix sorting conversations by update time dropping space sort-conversations-by-update-time - Restore trailing space in query May 7, 2026
@fregante fregante marked this pull request as ready for review May 7, 2026 03:55
Comment thread source/github-helpers/search-query.ts Outdated
get href(): string {
this.url.searchParams.set('q', this.get());
const query = this.get();
this.url.searchParams.set('q', this.trailingSpace ? query + ' ' : 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.

@copilot

  • This shouldn't be optional. The space should always be included in the href
  • add tests
  • also add tests to see the behavior with queries with multiple leading and trailing spaces, as well as between queries. The trailing and leading spaces should be dropped

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.

Done in 8afe64dhref now always appends a trailing space unconditionally (removed the trailingSpace flag). Added tests for:

  • href always ends with +
  • href always ends with + after prepend()
  • Multiple leading spaces dropped from get()
  • Multiple trailing spaces dropped from get()
  • Multiple spaces between terms collapsed in get()

Copilot AI requested a review from fregante May 7, 2026 18:21
@fregante fregante enabled auto-merge (squash) May 7, 2026 19:25
@fregante fregante merged commit e362062 into main May 7, 2026
9 checks passed
@SunsetTechuila SunsetTechuila deleted the copilot/fix-sort-conversations-space-issue branch May 7, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

sort-conversations-by-update-time is dropping a space

2 participants