feat(shell): add a bug-report button that opens the issue tracker

Show a bug icon first among the standard top-bar actions and in lite's sidebar footer. It opens the doona issue list in a new tab; the issue chooser routes backend problems to honk or dae.
This commit is contained in:
Zakk committed 2026-10-30 08:29:00 +00:00
1 parent 4f3b9fdd5a
commit feee8df94e
34 files changed
+346 -26

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ Changes must satisfy these rules and the browser checks in the same milestone.
## 2. Components and actions
- Primary and destructive buttons share the other controls' 8 px element radius, never pills. Existing borders use the emphasized border token. Ghost and icon-only buttons stay borderless. Segmented controls use size md everywhere: the 36 px frame matches the size md action button and the selected segment sits inset on the track; size tokens stay unchanged.
- Selected routing cards, group rows and segmented thumbs use a 1 px emphasized neutral border and a subtle neutral tint, without an extra ring or selection bar. Selected navigation items use neutral fills and icons. Duck yellow is reserved for keyboard focus rings; decorative artwork and search highlights are neutral, and warnings use orange. Primary buttons use a dark neutral fill with light text in light mode, and a light neutral fill with dark text in dark mode. Destructive actions keep their red tone. Sidebar and content share white in light mode and the same dark surface in dark mode; cards and overlays retain their own surface tokens.
- Selected routing cards, group rows and segmented thumbs use a 1 px emphasized neutral border and a subtle neutral tint, without an extra ring or selection bar. Selected navigation items use neutral fills and icons. Focus uses Astryx's default accent, never yellow or mustard; decorative artwork and search highlights are neutral, and warnings use orange. Primary buttons use a dark neutral fill with light text in light mode, and a light neutral fill with dark text in dark mode. Destructive actions keep their red tone. Sidebar and content share white in light mode and the same dark surface in dark mode; cards and overlays retain their own surface tokens.
- Same job, same component: TextInput for search, Selector for a scalar choice, Tokenizer/Token for removable values, CheckboxInput for text mode, MoreMenu `variant="ghost" size="sm"` for row actions. Loading text uses `ui/LoadingText`, forwarding Text props while retaining its measured content; its `loadingControl` export supplies overlays through existing control slots without wrapper DOM.
- Settings uses TabList/Tab for narrow panel navigation and SideNav for wide navigation. Keep the package's default overflow handling, tab/panel associations and keyboard focus; disable tabs with `aria-disabled` while validation, review or apply blocks section changes.
- A list toolbar is `CollectionToolbar`: optional search/filter at the start; text-mode toggle and Add together at the end, `gap={pageRhythm.controls}` with whole-control wrapping. Every control uses size md; labels stay on one line. Sort triggers show only the value and retain an accessible Sort label. Search and the first collection row share their start inset. Add is the primary action of that list until a page draft exists; Review changes then becomes the page's only primary.
+2 -1
View File
@@ -233,7 +233,8 @@ async function download(p, action) {
}
await p.locator('[data-backend-status]').click();
await shot(p, 'status-export');
await expect(p.getByRole('menuitem').last()).toHaveText(l.export);
// About follows the backend actions; export stays the last of them.
expect((await p.getByRole('menuitem').allTextContents()).map(text => text.trim()).at(-2)).toBe(l.export);
expect(await download(p, () => p.getByRole('menuitem', {name: l.export, exact: true}).click())).toBe(content);
await p.getByRole('button', {name: l.add, exact: true}).click();
const form = p.getByRole('dialog');
+32
View File
@@ -71,6 +71,25 @@ async function controls(p) {
}
}
}
async function aboutDialog(p, locale) {
await p.locator('[data-backend-status]').click();
await p.getByRole('menuitem', {name: locale === 'en' ? 'About doona' : '关于 doona', exact: true}).click();
const dialog = p.getByRole('dialog');
await expect(dialog).toBeVisible();
// Opening focuses the dialog's own close control, never a link inside it.
await expect.poll(() => p.evaluate(() => document.activeElement?.tagName)).not.toBe('A');
// The report button lives in the sidebar footer, not here.
await expect(dialog.getByRole('link')).toHaveCount(3);
const hrefs = [`https://doona.daeuniverse.org/${locale}/`, 'https://github.com/Zakkaus/doona', 'https://github.com/Zakkaus/doona/releases'];
for (const [index, href] of hrefs.entries()) {
const link = dialog.getByRole('link').nth(index);
await expect(link).toHaveAttribute('href', href);
await expect(link).toHaveAttribute('target', '_blank');
await expect(link).toHaveAttribute('rel', /noopener noreferrer/);
}
await p.keyboard.press('Escape');
await expect(dialog).toHaveCount(0);
}
async function footer(p, width, locale) {
if (width === 390) {
await p.getByRole('button', {name: locale === 'en' ? 'Open navigation' : '打开导航', exact: true}).click();
@@ -84,6 +103,18 @@ async function footer(p, width, locale) {
b = await language.boundingBox();
expect(Math.abs(a.height - b.height)).toBeLessThanOrEqual(1);
expect(Math.abs(a.y - b.y)).toBeLessThanOrEqual(1);
const report = nav.getByRole('link', {name: locale === 'en' ? 'Report a problem' : '报告问题', exact: true});
await expect(report).toHaveCount(1);
await expect(report).toBeVisible();
await expect(report).toHaveAttribute('href', 'https://github.com/Zakkaus/doona/issues');
await expect(report).toHaveAttribute('target', '_blank');
await expect(report).toHaveAttribute('rel', 'noopener noreferrer');
await expect(report).toHaveText('');
await expect(report.locator('svg')).toBeVisible();
const c = await report.boundingBox();
expect(Math.abs(a.height - c.height)).toBeLessThanOrEqual(1);
expect(Math.abs(a.y - c.y)).toBeLessThanOrEqual(1);
expect(c.x).toBeGreaterThan(b.x);
if (width === 1440) {
const collapse = await nav.getByRole('button', {name: locale === 'en' ? 'Collapse sidebar' : '折叠侧边栏', exact: true}).boundingBox();
expect(Math.abs(a.height - collapse.height)).toBeLessThanOrEqual(1);
@@ -322,6 +353,7 @@ async function subscriptionActionInset(p) {
);
await p.goto(base);
await waitForDemo(p);
if (width === 1440) await aboutDialog(p, locale);
const rhythm = [];
for (const route of routes) {
await p.evaluate(route => (location.hash = route), route);
+95
View File
@@ -0,0 +1,95 @@
import {Badge} from '@astryxdesign/core/Badge';
import {Card} from '@astryxdesign/core/Card';
import {Dialog, DialogHeader} from '@astryxdesign/core/Dialog';
import {Divider} from '@astryxdesign/core/Divider';
import {Icon} from '@astryxdesign/core/Icon';
import {HStack, Layout, LayoutContent, StackItem, VStack} from '@astryxdesign/core/Layout';
import {Link} from '@astryxdesign/core/Link';
import {Heading, Text} from '@astryxdesign/core/Text';
import {useCallback, useContext} from 'react';
import type {Connection} from './api';
import {docsHref} from './docs';
import {LocaleContext, useMessages} from './i18n';
import {useRead} from './state';
import {Feedback} from './ui';
import {BrandMark} from './ui/BrandMark';
import {RowEntrance} from './ui/motion';
const repository = 'https://github.com/Zakkaus/doona';
export function AboutDialog({connection, close}: {connection: Connection; close: () => void}) {
const t = useMessages();
const locale = useContext(LocaleContext);
const version = useRead(useCallback(() => connection.api.version(), [connection]));
const engine = version.data?.engine;
const rows = [
{label: t.address, value: connection.address === 'mock' ? t.demoName : connection.address},
{label: t.aboutBackend, value: engine ? `${engine.name} ${engine.version}` : version.loading ? t.loading : t.unknown}
];
return (
<Dialog
isOpen
width={480}
maxHeight="85dvh"
onOpenChange={open => {
if (!open) close();
}}
>
<Layout
header={<DialogHeader title={t.about} onOpenChange={close} />}
content={
<LayoutContent className="lite-dialog-content">
<VStack gap={4}>
<HStack gap={3} vAlign="center">
<Icon icon={BrandMark} size="lg" style={{width: 'var(--spacing-12)', height: 'var(--spacing-12)'}} />
<VStack gap={1}>
<HStack gap={2} vAlign="center" wrap="wrap">
<Heading level={2}>{t.app}</Heading>
<Badge label={`v${import.meta.env.VITE_DOONA_VERSION}`} variant="neutral" />
</HStack>
<Text type="supporting" color="secondary">
{t.aboutTagline}
</Text>
</VStack>
</HStack>
<HStack gap={4} wrap="wrap">
<Link href={docsHref(locale)} isExternalLink isStandalone>
{t.aboutGuide}
</Link>
<Link href={repository} isExternalLink isStandalone>
GitHub
</Link>
<Link href={`${repository}/releases`} isExternalLink isStandalone>
{t.aboutReleases}
</Link>
</HStack>
<VStack gap={3}>
<Heading level={2}>{t.aboutConnection}</Heading>
<Card padding={0} width="100%" variant="muted">
<RowEntrance>
<VStack as="ul" role="list" gap={0}>
{rows.map((row, index) => (
<VStack key={row.label} as="li" gap={0}>
{index > 0 && <Divider variant="subtle" />}
<HStack padding={4} gap={3} vAlign="start">
<StackItem size="fill">
<Text type="label">{row.label}</Text>
</StackItem>
<Text color="secondary" style={{overflowWrap: 'anywhere', minWidth: 0}}>
{row.value}
</Text>
</HStack>
</VStack>
))}
</VStack>
</RowEntrance>
</Card>
{!!version.error && <Feedback notice={{error: version.error}} />}
</VStack>
</VStack>
</LayoutContent>
}
/>
</Dialog>
);
}
+2
View File
@@ -36,6 +36,7 @@ export default function CopyMembers({
pending={false}
label={t.save}
disabled={!after || !current.writable}
disabledReason={!current.writable ? t.readOnly : entries.some(item => item.name !== name) ? t.chooseGroup : t.copyMembersEmpty}
confirm={() => {
if (after) {
stage(draft?.source ?? currentSource, after, target);
@@ -48,6 +49,7 @@ export default function CopyMembers({
label={t.targetGroup}
value={target}
onChange={setTarget}
isDisabled={!entries.some(item => item.name !== name)}
options={entries.filter(item => item.name !== name).map(item => ({value: item.name, label: item.name}))}
/>
{after && (
+4 -1
View File
@@ -1,6 +1,7 @@
import {useProgressiveRows} from './ui/useProgressiveRows';
import {CollectionLoading, RowPlaceholder} from './ui/CollectionLoading';
import {Button} from '@astryxdesign/core/Button';
import {EmptyState} from '@astryxdesign/core/EmptyState';
import {VStack} from '@astryxdesign/core/Layout';
import {Link} from '@astryxdesign/core/Link';
import {List, ListItem} from '@astryxdesign/core/List';
@@ -220,7 +221,9 @@ export function DnsUpstreams({
))}
</List>
</CollectionLoading>
{!fields.length && <Text color="secondary">{t.noUpstreams}</Text>}
{!loading && blocks.length <= 1 && !fields.length && (
<EmptyState isCompact title={t.noUpstreams} description={disabled ? t.readOnly : t.noUpstreamsHelp} />
)}
</VStack>
</RowEntrance>
</>
+1 -3
View File
@@ -321,9 +321,7 @@ export function GroupEditPanel({
onChange={value => stage(writeGroupEntry(content, name, {policy: entry.policy, filters: value ? [] : [EMPTY_GROUP_FILTER]}))}
isDisabled={!editable}
/>
{!before && !allNodes && chosen.length === 0 && (
<Banner status="info" title={sheet ? t.nextStepSheet : t.nextStep} collapsible={false} data-next-step />
)}
{!allNodes && chosen.length === 0 && <Banner status="info" title={sheet ? t.nextStepSheet : t.nextStep} collapsible={false} data-next-step />}
<VStack gap={0} xstyle={styles.box}>
<Pair gap={0}>
<VStack gap={0} role="group" aria-labelledby="group-members" data-transfer="members" xstyle={styles.panel}>
+1 -3
View File
@@ -521,9 +521,7 @@ export function GroupInspector({
)}
</VStack>
) : (
<Text type="supporting" color="secondary">
{t.noMatches}
</Text>
<EmptyState isCompact title={t.noMatches} description={t.noMatchesHelp} />
)}
</RowEntrance>
)}
+1 -1
View File
@@ -592,7 +592,7 @@ export function Groups({connection, setBusy}: {connection: Connection; setBusy:
<Text weight="medium" xstyle={styles.wrap}>
{deleting}
</Text>
<Text>{t.deleteDescription}</Text>
<Text>{t.deleteDraftDescription}</Text>
</EditDialog>
<ReviewDialog
open={reviewing}
+10 -1
View File
@@ -490,7 +490,16 @@ export function Nodes({connection, setBusy}: {connection: Connection; setBusy: (
}
>
<Text>{bulkReferenced ? t.referenced : t.deleteDescription}</Text>
<Text>{selectedNodes.map(node => node.name).join(', ')}</Text>
<Text type="label">{t.selectedCount.replace('{n}', String(selectedNodes.length))}</Text>
<RowEntrance>
<VStack as="ul" gap={1}>
{selectedNodes.map(node => (
<VStack as="li" key={node.id}>
<Text style={{overflowWrap: 'anywhere'}}>{node.name}</Text>
</VStack>
))}
</VStack>
</RowEntrance>
</EditDialog>
{share && (
<Suspense fallback={null}>
+10 -2
View File
@@ -5,6 +5,7 @@ import {CollectionLoading, RowPlaceholder} from './ui/CollectionLoading';
import {Button} from '@astryxdesign/core/Button';
import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';
import {Collapsible} from '@astryxdesign/core/Collapsible';
import {EmptyState} from '@astryxdesign/core/EmptyState';
import {HStack, StackItem, VStack} from '@astryxdesign/core/Layout';
import {Link} from '@astryxdesign/core/Link';
import {List, ListItem} from '@astryxdesign/core/List';
@@ -265,7 +266,13 @@ export function RuleList({
))}
</List>
</CollectionLoading>
{!loading && !visible.length && <Text color="secondary">{rows.length ? t.noMatches : t.noRules}</Text>}
{!loading && !visible.length && (
<EmptyState
isCompact
title={rows.length ? t.noMatches : t.noRules}
description={rows.length ? t.noMatchesHelp : disabled ? t.readOnly : t.noRulesHelp}
/>
)}
</VStack>
</RowEntrance>
)}
@@ -288,6 +295,7 @@ export function RuleList({
<VStack paddingBlockStart={2}>
<CheckboxInput
label={t.forceTarget}
description={t.forceTargetHelp}
value={fallbackForced}
isDisabled={disabled}
onChange={force => change(setFallback(text, kind, fallback!.target.replace(/\(must\)$/, '') + (force ? '(must)' : '')))}
@@ -510,7 +518,7 @@ function RuleForm({
{kind === 'routing' && (
<Collapsible isOpen={advanced} onOpenChange={setAdvanced} chevronPosition="start" trigger={<Text type="label">{t.advanced}</Text>}>
<VStack paddingBlockStart={2}>
<CheckboxInput label={t.forceTarget} value={must} onChange={setMust} />
<CheckboxInput label={t.forceTarget} description={t.forceTargetHelp} value={must} onChange={setMust} />
</VStack>
</Collapsible>
)}
+12 -1
View File
@@ -15,7 +15,7 @@ import {StatusDot} from '@astryxdesign/core/StatusDot';
import {Text} from '@astryxdesign/core/Text';
import {Tooltip} from '@astryxdesign/core/Tooltip';
import {useMediaQuery} from '@astryxdesign/core/hooks';
import {useCallback, useContext, useRef, useState, type ComponentProps, type ReactNode} from 'react';
import {lazy, Suspense, useCallback, useContext, useRef, useState, type ComponentProps, type ReactNode} from 'react';
import {errorKey, type Connection} from './api';
import {docsHref} from './docs';
import {DraftContext} from './ui/draftGuard';
@@ -30,6 +30,9 @@ import {BrandMark} from './ui/BrandMark';
import {EditDialog} from './ui/EditDialog';
import {useCommand} from './ui/commands';
import {GlobeGrid, Layers, Link, Location, Path, Search, Settings} from './ui/icons';
import {ReportShortcut} from './ui/ReportShortcut';
const AboutDialog = lazy(() => import('./AboutDialog').then(module => ({default: module.AboutDialog})));
export type Screen = 'nodes' | 'groups' | 'subscriptions' | 'routing' | 'dns';
const sections = [
@@ -108,6 +111,7 @@ function ShellContent({
const task = useTask(setBusy);
useNoticeToast(task.notice);
const [pauseOpen, setPauseOpen] = useState(false);
const [aboutOpen, setAboutOpen] = useState(false);
const resources = connection.capabilities.resources;
const applicable = (kind: 'suspend' | 'resume' | 'reload') =>
resources.operations.available &&
@@ -140,6 +144,7 @@ function ShellContent({
onClick: () => (kind === 'suspend' ? setPauseOpen(true) : act(kind))
}));
if (resources.config.available && !busy && !exporter.pending) actions.push({label: t.exportConfig, onClick: exporter.start});
actions.push({label: t.about, onClick: () => setAboutOpen(true)});
useCommand(command => {
const kind = command.replace('backend:', '');
if (command.startsWith('backend:') && ['suspend', 'resume', 'reload'].includes(kind) && applicable(kind as 'suspend' | 'resume' | 'reload')) {
@@ -195,6 +200,7 @@ function ShellContent({
<>
<ColorModeToggle />
<LanguageMenu />
<ReportShortcut />
</>
}
footer={
@@ -243,6 +249,11 @@ function ShellContent({
>
<DraftContext value={trackDirty}>{children}</DraftContext>
{exporter.dialog}
{aboutOpen && (
<Suspense fallback={null}>
<AboutDialog connection={connection} close={() => setAboutOpen(false)} />
</Suspense>
)}
<EditDialog
open={pauseOpen}
title={t.pauseBackend}
+1 -1
View File
@@ -518,7 +518,7 @@ export function Subscriptions({connection, setBusy}: {connection: Connection; se
{dialog === 'delete' ? (
<>
<Text weight="medium">{name}</Text>
<Text>{t.deleteDescription}</Text>
<Text>{t.deleteDraftDescription}</Text>
</>
) : (
<>
+3 -2
View File
@@ -4,6 +4,7 @@ import type {Locale} from './i18n';
// The standard edition's anchor map, so both editions open the same section and doona-docs checks lite's links too.
export type DocsAnchor = keyof typeof anchors;
export function docsHref(locale: Locale, anchor: DocsAnchor): string {
return `https://doona.daeuniverse.org/${locale}/${anchors[anchor]}.html#${anchor}`;
// Without an anchor it opens the guide's start page.
export function docsHref(locale: Locale, anchor?: DocsAnchor): string {
return `https://doona.daeuniverse.org/${locale}/${anchor ? `${anchors[anchor]}.html#${anchor}` : ''}`;
}
+13
View File
@@ -24,6 +24,19 @@ export const en = {
'login.check': 'Continue',
connectionSaveError: 'Cannot save the connection in this browser. Allow site storage and try again.',
locale: 'en',
about: 'About doona',
reportProblem: 'Report a problem',
aboutBackend: 'Backend',
aboutConnection: 'Connection details',
aboutTagline: 'Web UI for daeuniverse',
aboutGuide: 'Guide',
aboutReleases: 'Releases',
noMatchesHelp: 'Change or clear the filters to see more results.',
noRulesHelp: 'Add a rule to choose how matching traffic is handled.',
noUpstreamsHelp: 'Add a DNS server to use it in request rules.',
forceTargetHelp: 'Keep matching DNS traffic on this outbound instead of intercepting it for DNS processing.',
deleteDraftDescription: 'This removes the item from the draft. Review and apply the changes to update the active configuration.',
copyMembersEmpty: 'Create another editable group before copying members.',
conditionWebsites: 'Websites',
conditionIps: 'IP addresses',
conditionPorts: 'Ports and protocols',
+13
View File
@@ -25,6 +25,19 @@ export const zhCN: Messages = {
'login.check': '继续',
connectionSaveError: '无法在此浏览器中保存连接,请允许网站存储后重试。',
locale: 'zh-CN',
about: '关于 doona',
reportProblem: '报告问题',
aboutBackend: '后端',
aboutConnection: '连接信息',
aboutTagline: 'daeuniverse 的 Web 界面',
aboutGuide: '指南',
aboutReleases: '发行版',
noMatchesHelp: '请修改或清除筛选条件以查看其他结果。',
noRulesHelp: '请添加规则,指定匹配流量的处理方式。',
noUpstreamsHelp: '请添加 DNS 服务器,以便在请求规则中使用。',
forceTargetHelp: '匹配的 DNS 流量仍使用此出站,不再被拦截并交由 DNS 模块处理。',
deleteDraftDescription: '此操作会从草稿中删除该项。审核并应用变更后,当前配置才会更新。',
copyMembersEmpty: '请先创建另一个可编辑的策略组,再复制成员。',
conditionWebsites: '网站',
conditionIps: 'IP',
conditionPorts: '端口与协议',
+13
View File
@@ -25,6 +25,19 @@ export const zhTW: Messages = {
'login.check': '繼續',
connectionSaveError: '無法在此瀏覽器中儲存連線,請允許網站儲存資料後重試。',
locale: 'zh-TW',
about: '關於 doona',
reportProblem: '回報問題',
aboutBackend: '後端',
aboutConnection: '連線資訊',
aboutTagline: 'daeuniverse 的 Web 介面',
aboutGuide: '指南',
aboutReleases: '發行版本',
noMatchesHelp: '請修改或清除篩選條件以檢視其他結果。',
noRulesHelp: '請新增規則,指定符合條件的流量處理方式。',
noUpstreamsHelp: '請新增 DNS 伺服器,以便在請求規則中使用。',
forceTargetHelp: '符合條件的 DNS 流量仍使用此出站,不再被攔截並交由 DNS 模組處理。',
deleteDraftDescription: '此操作會從草稿中刪除該項。檢視並套用變更後,目前的設定才會更新。',
copyMembersEmpty: '請先建立另一個可編輯的策略群組,再複製成員。',
conditionWebsites: '網站',
conditionIps: 'IP',
conditionPorts: '連接埠與協定',
+1
View File
@@ -237,6 +237,7 @@
--size-element-sm: 32px;
--size-element-md: 36px;
--size-element-lg: 40px;
--focus-outline-color: light-dark(#0064E0, #2694FE);
--lite-primary-background: light-dark(#292929, #DFE2E5);
--lite-primary-text: light-dark(var(--color-on-dark), var(--color-on-light));
--color-brand: light-dark(#225BFF, #3D87FF);
+1
View File
@@ -110,6 +110,7 @@ export const siteTheme = {
"--size-element-sm": "32px",
"--size-element-md": "36px",
"--size-element-lg": "40px",
"--focus-outline-color": "light-dark(#0064E0, #2694FE)",
"--lite-primary-background": "light-dark(#292929, #DFE2E5)",
"--lite-primary-text": "light-dark(var(--color-on-dark), var(--color-on-light))",
"--color-brand": "light-dark(#225BFF, #3D87FF)",
+3 -2
View File
@@ -1,5 +1,5 @@
// Based on Astryx's site theme, with the console's typography and duck accent.
import {defineTheme, type TokenValue} from '@astryxdesign/core/theme';
// Based on Astryx's site theme, with the console's typography and neutral controls.
import {colorDefaults, defineTheme, type TokenValue} from '@astryxdesign/core/theme';
import {appIconRegistry, cjkFallbacks, systemMono, panelScale, panelShared} from '../shared';
const PRIMARY = 'light-dark(#15110C, #DFE2E5)';
@@ -53,6 +53,7 @@ export const siteTheme = defineTheme({
'--radius-container': '16px',
'--radius-page': '32px',
...panelShared.tokens,
'--focus-outline-color': colorDefaults['--color-accent'],
...customTokens
},
typography: {
+23
View File
@@ -0,0 +1,23 @@
import {Icon} from '@astryxdesign/core/Icon';
import {IconButton} from '@astryxdesign/core/IconButton';
import {Tooltip} from '@astryxdesign/core/Tooltip';
import {issuesUrl} from '../../../../src/api/problemReport';
import {useMessages} from '../i18n';
import {Bug} from './icons';
export function ReportShortcut() {
const t = useMessages();
return (
<Tooltip content={t.reportProblem}>
<IconButton
data-report-shortcut
label={t.reportProblem}
variant="ghost"
icon={<Icon icon={Bug} />}
href={issuesUrl}
target="_blank"
rel="noopener noreferrer"
/>
</Tooltip>
);
}
+14
View File
@@ -0,0 +1,14 @@
// Adobe Spectrum icon, Apache-2.0; fill adapted to currentColor.
import type {SVGProps} from 'react';
import IconSvg from './IconSvg';
export default function Bug(props: SVGProps<SVGSVGElement>) {
return (
<IconSvg {...props}>
<path
fill="currentColor"
d="M18.25 10h-1.5c0-1.327-.278-2.577-.763-3.68.644-.397 1.246-.853 1.784-1.375.298-.288.306-.762.018-1.06-.287-.298-.762-.306-1.06-.018-.444.43-.936.81-1.463 1.14C14.027 3.178 12.129 2 10 2S5.973 3.177 4.734 5.008c-.527-.331-1.02-.712-1.463-1.14-.297-.289-.772-.281-1.06.017s-.28.772.018 1.06c.538.522 1.14.978 1.784 1.375C3.528 7.423 3.25 8.673 3.25 10h-1.5c-.414 0-.75.336-.75.75s.336.75.75.75h1.623c.176 1.094.538 2.11 1.049 2.997-.955.643-1.751 1.443-2.312 2.362-.216.354-.104.815.25 1.03.121.076.256.111.389.111.253 0 .5-.128.64-.36.456-.744 1.111-1.395 1.901-1.92C6.508 17.128 8.17 18 10 18s3.492-.872 4.71-2.28c.79.525 1.445 1.176 1.9 1.92.141.232.388.36.641.36.133 0 .268-.035.39-.11.353-.216.465-.677.249-1.03-.56-.92-1.357-1.72-2.312-2.363.515-.894.878-1.918 1.052-3.021.04.007.078.024.12.024h1.5c.414 0 .75-.336.75-.75s-.336-.75-.75-.75M10 3.5c1.562 0 2.962.853 3.925 2.198-1.217.516-2.555.802-3.925.802s-2.708-.286-3.925-.802C7.038 4.353 8.438 3.5 10 3.5M6.15 14.404c-.007-.014-.006-.03-.013-.043-.037-.067-.09-.118-.143-.169C5.22 13.06 4.75 11.597 4.75 10c0-1.078.216-2.093.593-2.989 1.218.538 2.543.865 3.907.954v8.46c-1.219-.217-2.302-.952-3.1-2.021m4.6 2.022V7.965c1.365-.089 2.689-.416 3.907-.954.377.896.593 1.911.593 2.989 0 1.598-.47 3.061-1.246 4.195-.052.05-.104.1-.14.166-.008.014-.007.029-.014.043-.798 1.07-1.881 1.804-3.1 2.022"
/>
</IconSvg>
);
}
+1
View File
@@ -2,6 +2,7 @@ export {default as Add} from './Add';
export {default as AlertTriangle} from './AlertTriangle';
export {default as ArrowDown} from './ArrowDown';
export {default as ArrowUp} from './ArrowUp';
export {default as Bug} from './Bug';
export {default as CheckmarkCircle} from './CheckmarkCircle';
export {default as Checkmark} from './Checkmark';
export {default as ChevronDown} from './ChevronDown';
+5
View File
@@ -0,0 +1,5 @@
Added
- A bug-icon report button opens doona's issue tracker in a new tab: first among the standard app's top-bar actions and at the bottom left of the lite sidebar, next to the theme and language buttons. It has no text; the accessible name and tooltip say "Report a problem".
- Lite About shows the name, version, guide, GitHub and release links, and the connection address and backend.
- Empty rule, DNS, group-member and copy-member states now offer guidance; the routing `must` control has supporting text. Group and subscription deletion text explains staged changes, and bulk node deletion lists the selected names.
+1 -1
View File
@@ -210,7 +210,7 @@ test('charts are named and icon buttons show their tooltip on keyboard focus', a
}
await page.locator('.rp-search').focus();
await page.keyboard.press('Tab');
await expect(page.locator('.rp-actions button[aria-label]:focus')).toHaveCount(1);
await expect(page.locator('.rp-actions :is(a, button)[aria-label]:focus')).toHaveCount(1);
await expect(page.getByRole('tooltip')).toBeVisible();
});
+6 -3
View File
@@ -141,8 +141,11 @@ test('language, theme and palette are each two taps away in the overflow menu',
await expect(top.getByRole('button', {name: 'Reload honk'})).toBeHidden();
for (const name of ['Language', 'Palette']) await expect(top.getByRole('button', {name, exact: true})).toBeHidden();
const more = top.getByRole('button', {name: 'More options'});
const rect = await box(more);
expect(rect.x + rect.width).toBeGreaterThan((await box(top)).width - 24);
const report = top.getByRole('link', {name: 'Report a problem', exact: true});
await expect(report).toHaveText('');
const [moreRect, reportRect, firstRect] = [await box(more), await box(report), await box(top.locator('.rp-actions button:visible').first())];
expect(moreRect.x + moreRect.width).toBeGreaterThan((await box(top)).width - 24);
expect(reportRect.x + reportRect.width).toBeLessThanOrEqual(firstRect.x);
// The menu is three short rows, each naming its current value, then Reload honk and the Backend row; a row opens its
// choices in the same popover.
await more.click();
@@ -708,7 +711,7 @@ const pressCases: {name: string; width: number; route: string; target: string; l
layer: '.rp-hubbar-pill',
shape: '.rp-hubbar > [aria-current] .rp-hubbar-pill'
},
{name: 'menu item', width: 390, route: 'overview', open: '.rp-top .rp-btn.icon[aria-haspopup]', target: '[role=menuitem].rp-item'},
{name: 'menu item', width: 390, route: 'overview', open: '.rp-top button[aria-label="More options"]', target: '[role=menuitem].rp-item'},
{name: 'list row', width: 390, route: 'connections?tab=list', target: '.rp-table [role=row][data-react-aria-pressable]'},
{name: 'picker', width: 390, route: 'settings', target: '.rp-selectbtn:not([disabled])'}
];
+40
View File
@@ -1,6 +1,46 @@
import {expect, mockBackend, test, box} from './fixtures';
import {writeMode} from '../src/dae/outboundMode';
const issues = 'https://github.com/Zakkaus/doona/issues';
for (const width of [1440, 390]) {
for (const [lang, label] of [
['en', 'Report a problem'],
['zh-CN', '报告问题'],
['zh-TW', '回報問題']
] as const) {
test.describe(`${width}px ${lang} report button`, () => {
test.use({viewport: {width, height: 900}, storage: {'doona-lang': lang}});
test('is an icon-only link to the issue tracker at the start of the top bar actions, and About has no report links', async ({page}) => {
await mockBackend(page);
await page.goto('/#/activity');
const top = page.locator('.rp-top');
const report = top.getByRole('link', {name: label, exact: true});
await expect(report).toHaveCount(1);
await expect(report).toBeInViewport();
await expect(report).toHaveAttribute('href', issues);
await expect(report).toHaveAttribute('target', '_blank');
await expect(report).toHaveAttribute('rel', 'noopener noreferrer');
await expect(report).toHaveText('');
await expect(report.locator('svg')).toBeVisible();
// The same size as the icon buttons beside it, and the first of the bar's actions.
const [link, neighbour] = [await box(report), await box(top.locator('.rp-actions button:visible').first())];
expect(link.height).toBe(neighbour.height);
expect(link.width).toBe(neighbour.width);
expect(link.x + link.width).toBeLessThanOrEqual(neighbour.x);
await page.context().route('https://github.com/**', route => route.fulfill({body: ''}));
const popup = page.waitForEvent('popup');
await report.click();
const opened = await popup;
await expect.poll(() => opened.url()).toBe(issues);
await opened.close();
await page.locator('button.rp-brand').click();
await expect(page.getByRole('dialog').locator(`a[href^="${issues}"]`)).toHaveCount(0);
});
});
}
}
test('the desktop theme shortcut stays in sync with the appearance editor', async ({page}) => {
await page.emulateMedia({colorScheme: 'light'});
await page.goto('/#/activity');
+1
View File
@@ -0,0 +1 @@
export const issuesUrl = 'https://github.com/Zakkaus/doona/issues';
+1
View File
@@ -2037,6 +2037,7 @@
"shell.reloadEngine": "Reload honk",
"shell.reloadHelp": "honk reads its config files again and reloads. Held rules are not written.",
"shell.reloadTitle": "Reload honk?",
"shell.report": "Report a problem",
"shell.search": "Search pages, connections, nodes, groups, node sources and config files",
"shell.searchUnavailable": "Could not open search: it did not load.",
"shell.shortcut": "Ctrl K",
+1
View File
@@ -1827,6 +1827,7 @@
"shell.reloadEngine": "重载 honk",
"shell.reloadHelp": "honk 会重新读取配置文件并重载。暂存的规则不会写入。",
"shell.reloadTitle": "重载 honk?",
"shell.report": "报告问题",
"shell.search": "搜索页面、连接、节点、组、节点来源和配置文件",
"shell.searchUnavailable": "无法打开搜索:搜索功能加载失败。",
"shell.shortcut": "Ctrl K",
+1
View File
@@ -1827,6 +1827,7 @@
"shell.reloadEngine": "重載 honk",
"shell.reloadHelp": "honk 會重新讀取設定檔並重載。暫存的規則不會寫入。",
"shell.reloadTitle": "重載 honk?",
"shell.report": "回報問題",
"shell.search": "搜尋頁面、連線、節點、群組、節點來源與設定檔",
"shell.searchUnavailable": "無法開啟搜尋:搜尋功能載入失敗。",
"shell.shortcut": "Ctrl K",
+6 -1
View File
@@ -2,6 +2,7 @@ import {memo, useRef, useState} from 'react';
import {PhoneWidgets} from './widgets/host';
import {About} from './About';
import {BackendMenuPopover} from './Backend';
import Bug from '../ui/icons/Bug';
import Checkmark from '../ui/icons/Checkmark';
import Color from '../ui/icons/Color';
import Contrast from '../ui/icons/Contrast';
@@ -13,7 +14,8 @@ import Search from '../ui/icons/Search';
import Translate from '../ui/icons/Translate';
import logo from '../logo.svg';
import {useT, type Lang} from '../i18n';
import {Button, ChoiceMenu, Divider} from '../ui/ui';
import {Button, ChoiceMenu, Divider, Link} from '../ui/ui';
import {issuesUrl} from '../api/problemReport';
import {ReloadConfirm} from '../features/shared/ReloadConfirm';
import type {SettingsContext} from './preferences';
import type {Scheme} from './preferences';
@@ -94,6 +96,9 @@ export const TopBar = memo(function TopBar({
</Button>
</div>
<div className="rp-actions">
<Link appearance="button" quiet icon label={t('shell.report')} tip={t('shell.report')} href={issuesUrl} external rel="noopener noreferrer">
<Bug />
</Link>
<PhoneWidgets route={route} backend={backend} />
<span className="rp-search-compact" onPointerEnter={preloadSearch} onFocus={preloadSearch}>
<Button quiet icon label={t('shell.search')} onPress={openSearch}>
+13 -2
View File
@@ -1,8 +1,9 @@
import type {ComponentPropsWithRef} from 'react';
import {Link as RLink, composeRenderProps} from 'react-aria-components';
import {Link as RLink, TooltipTrigger, composeRenderProps} from 'react-aria-components';
import {cx} from './cx';
import {useControlSize} from './controlSize';
import {buttonClass, type ButtonStyle} from './Button';
import {Tip} from './Tooltip';
// Navigation with an address: a real link, so it can be opened in a tab or copied, in text or button dress.
// The button style applies only with `appearance="button"`.
@@ -11,6 +12,7 @@ export function Link({
layout,
appearance,
label,
tip,
className,
quiet,
secondary,
@@ -26,10 +28,11 @@ export function Link({
appearance?: 'button' | 'version' | 'link';
layout?: 'inline' | 'constrained';
label?: string;
tip?: string;
}) {
const base = appearance === 'button' ? buttonClass({quiet, secondary, small, icon, accent, negative}) : `rp-${appearance}`;
const controlSize = useControlSize(size);
return (
const link = (
<RLink
target={external ? '_blank' : undefined}
rel={external ? 'noreferrer' : undefined}
@@ -40,6 +43,14 @@ export function Link({
className={appearance ? composeRenderProps(className, value => cx(base, value)) : className}
/>
);
return tip ? (
<TooltipTrigger delay={400}>
{link}
<Tip>{tip}</Tip>
</TooltipTrigger>
) : (
link
);
}
// A link that help text ends with; one that leaves the app is marked so.
+14
View File
@@ -0,0 +1,14 @@
// Adobe Spectrum icon, Apache-2.0; fill adapted to currentColor.
import type {SVGProps} from 'react';
import IconSvg from './IconSvg';
export default function Bug(props: SVGProps<SVGSVGElement>) {
return (
<IconSvg {...props}>
<path
fill="currentColor"
d="M18.25 10h-1.5c0-1.327-.278-2.577-.763-3.68.644-.397 1.246-.853 1.784-1.375.298-.288.306-.762.018-1.06-.287-.298-.762-.306-1.06-.018-.444.43-.936.81-1.463 1.14C14.027 3.178 12.129 2 10 2S5.973 3.177 4.734 5.008c-.527-.331-1.02-.712-1.463-1.14-.297-.289-.772-.281-1.06.017s-.28.772.018 1.06c.538.522 1.14.978 1.784 1.375C3.528 7.423 3.25 8.673 3.25 10h-1.5c-.414 0-.75.336-.75.75s.336.75.75.75h1.623c.176 1.094.538 2.11 1.049 2.997-.955.643-1.751 1.443-2.312 2.362-.216.354-.104.815.25 1.03.121.076.256.111.389.111.253 0 .5-.128.64-.36.456-.744 1.111-1.395 1.901-1.92C6.508 17.128 8.17 18 10 18s3.492-.872 4.71-2.28c.79.525 1.445 1.176 1.9 1.92.141.232.388.36.641.36.133 0 .268-.035.39-.11.353-.216.465-.677.249-1.03-.56-.92-1.357-1.72-2.312-2.363.515-.894.878-1.918 1.052-3.021.04.007.078.024.12.024h1.5c.414 0 .75-.336.75-.75s-.336-.75-.75-.75M10 3.5c1.562 0 2.962.853 3.925 2.198-1.217.516-2.555.802-3.925.802s-2.708-.286-3.925-.802C7.038 4.353 8.438 3.5 10 3.5M6.15 14.404c-.007-.014-.006-.03-.013-.043-.037-.067-.09-.118-.143-.169C5.22 13.06 4.75 11.597 4.75 10c0-1.078.216-2.093.593-2.989 1.218.538 2.543.865 3.907.954v8.46c-1.219-.217-2.302-.952-3.1-2.021m4.6 2.022V7.965c1.365-.089 2.689-.416 3.907-.954.377.896.593 1.911.593 2.989 0 1.598-.47 3.061-1.246 4.195-.052.05-.104.1-.14.166-.008.014-.007.029-.014.043-.798 1.07-1.881 1.804-3.1 2.022"
/>
</IconSvg>
);
}