Skip to content

Commit 1fe29dd

Browse files
nickwesselmanclaude
andcommitted
Add JSDoc to terminalSupportsHyperlinks and restore missing JSDoc on terminalSupportsPrompting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3d38f4a commit 1fe29dd

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

packages/app/src/cli/services/dev/ui/components/DevSessionUI.test.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ const onAbort = vi.fn()
5656

5757
describe('DevSessionUI', () => {
5858
beforeEach(() => {
59+
mocks.terminalSupportsHyperlinks.mockReturnValue(false)
60+
mocks.useStdin.mockReturnValue({isRawModeSupported: true})
5961
devSessionStatusManager = new DevSessionStatusManager()
6062
devSessionStatusManager.reset()
6163
devSessionStatusManager.updateStatus(initialStatus)
@@ -568,15 +570,16 @@ describe('DevSessionUI', () => {
568570

569571
await waitForInputsToBeReady()
570572

571-
// Then - shortcuts should be present but URL list should be hidden
573+
// Then - shortcuts with label text should be present but URL list should be hidden
572574
const output = unstyled(renderInstance.lastFrame()!)
573-
expect(output).toContain('(p)')
574-
expect(output).toContain('(g)')
575+
expect(output).toContain('(p) Open app preview')
576+
expect(output).toContain('(c) Open Dev Console for extension previews')
577+
expect(output).toContain('(g) Open GraphiQL (Admin API)')
575578
expect(output).not.toContain('Preview URL:')
579+
expect(output).not.toContain('Dev Console URL:')
576580
expect(output).not.toContain('GraphiQL URL:')
577581

578582
renderInstance.unmount()
579-
mocks.terminalSupportsHyperlinks.mockReturnValue(false)
580583
})
581584

582585
test('shows URL list when terminal does not support hyperlinks', async () => {
@@ -595,11 +598,13 @@ describe('DevSessionUI', () => {
595598

596599
await waitForInputsToBeReady()
597600

598-
// Then - both shortcuts and URL list should be present
601+
// Then - both shortcuts with label text and URL list should be present
599602
const output = unstyled(renderInstance.lastFrame()!)
600-
expect(output).toContain('(p)')
601-
expect(output).toContain('(g)')
603+
expect(output).toContain('(p) Open app preview')
604+
expect(output).toContain('(c) Open Dev Console for extension previews')
605+
expect(output).toContain('(g) Open GraphiQL (Admin API)')
602606
expect(output).toContain('Preview URL: https://shopify.com')
607+
expect(output).toContain('Dev Console URL: https://mystore.myshopify.com/admin?dev-console=show')
603608
expect(output).toContain('GraphiQL URL: https://graphiql.shopify.com')
604609

605610
renderInstance.unmount()
@@ -631,8 +636,5 @@ describe('DevSessionUI', () => {
631636
expect(output).toContain('GraphiQL URL: https://graphiql.shopify.com')
632637

633638
renderInstance.unmount()
634-
635-
// Restore original mock for other tests
636-
mocks.useStdin.mockReturnValue({isRawModeSupported: true})
637639
})
638640
})

packages/cli-kit/src/public/node/system.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,19 @@ export async function sleep(seconds: number): Promise<void> {
348348
}
349349

350350
/**
351-
* Check if the standard input and output streams support prompting.
351+
* Check if the terminal supports OSC 8 hyperlinks.
352352
*
353-
* @returns True if the standard input and output streams support prompting.
353+
* @returns True if the terminal supports hyperlinks.
354354
*/
355355
export function terminalSupportsHyperlinks(): boolean {
356356
return supportsHyperlinks.stdout
357357
}
358358

359+
/**
360+
* Check if the standard input and output streams support prompting.
361+
*
362+
* @returns True if the standard input and output streams support prompting.
363+
*/
359364
export function terminalSupportsPrompting(): boolean {
360365
if (isTruthy(process.env.CI)) {
361366
return false

0 commit comments

Comments
 (0)