Repository navigation
fix(mobile): label mixed thread and file mention results accurately #21456
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
Open
only21mil
wants to merge
16
commits into
pingdotgg:main
Choose a base branch
from
only21mil:fix/mobile-mention-result-labels
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+236
−55
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2e3cc7d
fix(mobile): label mixed mention results accurately
only21mil 13e4383
fix(mobile): preserve bare mention visibility
only21mil 2faff92
fix(mobile): surface mention path search failures
only21mil 9f65034
Merge main (05696c636e) into fix/mobile-mention-result-labels
only21mil d9316b7
Merge main (bd6940beab) into fix/mobile-mention-result-labels
only21mil 513d4dd
Merge main (8d3b061121) into fix/mobile-mention-result-labels
only21mil f696b39
Merge remote-tracking branch 'github/main' into fix/mobile-mention-re…
maria-rcks 33baa0d
fix(mobile): keep mention search errors accurate
maria-rcks 1794e11
fix(mobile): wait for all mention search results
maria-rcks 2af9b56
Merge github/main into fix/mobile-mention-result-labels
maria-rcks 28879f3
chore: merge main into mobile mention labels
maria-rcks 9ef0e1a
fix(mobile): wait for initial mention search snapshot
maria-rcks 2c04fa7
chore: merge main into mobile mention labels
maria-rcks 4885022
fix(mobile): wait for single-character mention snapshot
maria-rcks 2f97382
chore: merge main into mobile mention labels
maria-rcks b29ed97
style(mobile): format mention snapshot condition
maria-rcks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
apps/mobile/src/features/threads/composerCommandLabels.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { describe, expect, it } from "vite-plus/test"; | ||
|
|
||
| import { emptyText, groupLabel } from "./composerCommandLabels"; | ||
|
|
||
| describe("composer command labels", () => { | ||
| it("keeps the bare @ picker file-only", () => { | ||
| expect(groupLabel("path", false)).toBe("Files"); | ||
| expect(emptyText("path", false, false)).toBe("No matching files or folders."); | ||
| }); | ||
|
|
||
| it("describes thread searches even when no thread title matches", () => { | ||
| expect(groupLabel("path", true)).toBe("Threads and files"); | ||
| expect(emptyText("path", false, true)).toBe("No matching threads, files, or folders."); | ||
| }); | ||
|
|
||
| it("describes the search scope while file results are loading", () => { | ||
| expect(emptyText("path", true, true)).toBe("Searching threads and files…"); | ||
| expect(emptyText("path", true, false)).toBe("Searching files…"); | ||
| }); | ||
|
|
||
| it("keeps other command menus unchanged", () => { | ||
| expect(groupLabel("skill", false)).toBe("Skills"); | ||
| expect(emptyText("skill", false, false)).toBe("No skills found."); | ||
| expect(groupLabel("pull-request", false)).toBe("Pull requests"); | ||
| expect(emptyText("pull-request", true, false)).toBe("Loading…"); | ||
| expect(groupLabel("slash-command", false)).toBe("Commands"); | ||
| expect(emptyText("slash-command", false, false)).toBe("No matching commands."); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import type { ComposerTriggerKind } from "@t3tools/shared/composerTrigger"; | ||
|
|
||
| export function groupLabel( | ||
| triggerKind: ComposerTriggerKind | null, | ||
| searchesThreads: boolean, | ||
| ): string | null { | ||
| switch (triggerKind) { | ||
| case "pull-request": | ||
| return "Pull requests"; | ||
| case "slash-command": | ||
| return "Commands"; | ||
| case "skill": | ||
| return "Skills"; | ||
| case "path": | ||
| return searchesThreads ? "Threads and files" : "Files"; | ||
| default: | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| export function emptyText( | ||
| triggerKind: ComposerTriggerKind | null, | ||
| isLoading: boolean, | ||
| searchesThreads: boolean, | ||
| ): string { | ||
| if (isLoading) { | ||
| return triggerKind === "path" | ||
| ? searchesThreads | ||
| ? "Searching threads and files…" | ||
| : "Searching files…" | ||
| : "Loading…"; | ||
| } | ||
| switch (triggerKind) { | ||
| case "pull-request": | ||
| return "No matching pull requests."; | ||
| case "path": | ||
| return searchesThreads | ||
| ? "No matching threads, files, or folders." | ||
| : "No matching files or folders."; | ||
| case "skill": | ||
| return "No skills found."; | ||
| case "slash-command": | ||
| return "No matching commands."; | ||
| default: | ||
| return "No results."; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.