From 300e32013f415cbbd0791bfd8ca2a5675c7ec5fd Mon Sep 17 00:00:00 2001 From: Sakana <15715093608@163.com> Date: Thu, 3 Sep 2026 16:43:30 +0800 Subject: [PATCH] fix(code-server): open external links in new tabs --- .../app/components/LauncherView.stories.ts | 13 +++++++++++++ .../app/components/LauncherView.vue | 18 ++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/plugins/code-server/app/components/LauncherView.stories.ts b/plugins/code-server/app/components/LauncherView.stories.ts index 5cedf35b..a87a6584 100644 --- a/plugins/code-server/app/components/LauncherView.stories.ts +++ b/plugins/code-server/app/components/LauncherView.stories.ts @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite' import type { CodeServerDetection } from '../connect' +import { expect, within } from 'storybook/test' import LauncherView from './LauncherView.vue' const localCodeServer: CodeServerDetection = { @@ -44,6 +45,18 @@ export const NotInstalled: Story = { server: { status: 'stopped' }, busy: false, }, + play: async ({ canvasElement }) => { + const canvas = within(canvasElement) + const docsLink = canvas.getByRole('link', { name: 'Installation docs' }) + const repoLink = canvas.getByRole('link', { name: 'GitHub' }) + + await expect(docsLink).toHaveAttribute('href', 'https://coder.com/docs/code-server/latest/install') + await expect(docsLink).toHaveAttribute('target', '_blank') + await expect(docsLink).toHaveAttribute('rel', 'noreferrer') + await expect(repoLink).toHaveAttribute('href', 'https://github.com/coder/code-server') + await expect(repoLink).toHaveAttribute('target', '_blank') + await expect(repoLink).toHaveAttribute('rel', 'noreferrer') + }, } /** Short dock panel with install instructions available through scrolling. */ diff --git a/plugins/code-server/app/components/LauncherView.vue b/plugins/code-server/app/components/LauncherView.vue index 2baccc5d..ad162551 100644 --- a/plugins/code-server/app/components/LauncherView.vue +++ b/plugins/code-server/app/components/LauncherView.vue @@ -130,10 +130,24 @@ const errorText = computed(() => (props.server.status === 'error' ? props.server > {{ busy ? 'Checking…' : 'Re-check' }} - + Installation docs - + GitHub