Repository navigation
fix(mobile): show remote CLI copy without literal markdown backticks #6403
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
Closed
iscekic
wants to merge
1
commit into
main
from
kwf/explorer-tour-runwhere-the-your-computer-card-renders-lit-c14a6-1027
Closed
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| import en from './locales/en.json'; | ||
|
|
||
| /** | ||
| * Catalog copy reaches the screen through plain `<Text>` (or the mono variant): | ||
| * the app has no inline-markdown renderer, so a markdown backtick in a value is | ||
| * shown to the reader literally. The tour's "Your computer" card rendered | ||
| * `` `kilo remote` `` with its backticks, so English — the source of truth for | ||
| * the other catalogs — must stay free of them. | ||
| */ | ||
| const RUN_COPY = [ | ||
| { | ||
| key: 'tour.remoteOptionBody', | ||
| value: 'Run Kilo on your own machine through the kilo remote CLI.', | ||
| }, | ||
| { | ||
| key: 'tour.remoteEmptyBody', | ||
| value: 'Run kilo remote on your computer to connect it.', | ||
| }, | ||
| { | ||
| key: 'agentChat.newSession.remoteHint', | ||
| value: | ||
| 'Run kilo remote on your computer, or /remote in a running CLI session, to control a local kilo process.', | ||
| }, | ||
| { | ||
| key: 'agentChat.instancePicker.noCliInstancesDescription', | ||
| value: | ||
| 'Run kilo remote in a project on your computer, or update Kilo CLI if one is already running.', | ||
| }, | ||
| ] as const; | ||
|
|
||
| function lookup(path: string): unknown { | ||
| let node: unknown = en; | ||
| for (const part of path.split('.')) { | ||
| if (!node || typeof node !== 'object' || !(part in node)) { | ||
| return undefined; | ||
| } | ||
| node = (node as Record<string, unknown>)[part]; | ||
| } | ||
| return node; | ||
| } | ||
|
|
||
| describe('plain-text copy', () => { | ||
| it.each(RUN_COPY)('keeps $key free of markdown backticks', ({ key, value }) => { | ||
| expect(lookup(key)).toBe(value); | ||
| expect(value).not.toContain('`'); | ||
| }); | ||
|
|
||
| it('has no markdown backticks anywhere in the English catalog', () => { | ||
| const offenders: string[] = []; | ||
| const walk = (node: unknown, path: string): void => { | ||
| if (typeof node === 'string') { | ||
| if (node.includes('`')) { | ||
| offenders.push(`${path}: ${node}`); | ||
| } | ||
| return; | ||
| } | ||
| if (node && typeof node === 'object') { | ||
| for (const [key, child] of Object.entries(node)) { | ||
| walk(child, path ? `${path}.${key}` : key); | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| walk(en, ''); | ||
|
|
||
| expect(offenders).toEqual([]); | ||
| }); | ||
| }); | ||
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.