From bee9195da7ba3d504df381a62b50efc2e80bbfcc Mon Sep 17 00:00:00 2001 From: Zakk Date: Sat, 26 Sep 2026 19:57:26 +1000 Subject: [PATCH] fix(shell): tidy the backend popover actions About doona and Edit backend become two buttons on one end-aligned row, with Edit backend as the filled secondary button. The project page link is dropped; About already links to it. --- e2e/backend.spec.ts | 1 - src/i18n/locales/en.ts | 1 - src/i18n/locales/zh-CN.ts | 1 - src/i18n/locales/zh-TW.ts | 1 - src/shell/Backend.tsx | 14 +++++--------- src/shell/messages.ts | 3 --- src/shell/view.ts | 5 +---- src/ui/styles/shell-search.css | 12 ++++-------- 8 files changed, 10 insertions(+), 28 deletions(-) diff --git a/e2e/backend.spec.ts b/e2e/backend.spec.ts index 118b61f3..61df718f 100644 --- a/e2e/backend.spec.ts +++ b/e2e/backend.spec.ts @@ -14,7 +14,6 @@ test('the backend indicator shows the facts, opens About doona and closes on Esc await indicator.click(); const popover = page.getByRole('dialog', {name: engine}); for (const fact of ['Connected', 'API', 'Build', 'Backend URL', 'Built-in demo data']) await expect(popover).toContainText(fact); - await expect(popover.getByRole('link', {name: `${version.engine.name} project page`})).toHaveAttribute('href', new RegExp(`/${version.engine.name}$`)); await page.keyboard.press('Escape'); await expect(popover).toBeHidden(); await expect(indicator).toBeFocused(); diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index b7349747..96fe3e07 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -1184,7 +1184,6 @@ export const messages = { 'shell.backend.offline': 'Unreachable', 'shell.backend.degraded': 'Connected, version unknown', 'shell.backend.edit': 'Edit backend', - 'shell.backend.project': '{engine} project page', 'palette.rosePine': 'Rosé Pine', 'palette.moon': 'Moon', 'palette.dawnMain': 'Dawn / Main', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index d08b2db8..e0526da9 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1158,7 +1158,6 @@ export const messages = { 'shell.backend.offline': '无法连接', 'shell.backend.degraded': '已连接,版本未知', 'shell.backend.edit': '编辑后端', - 'shell.backend.project': '{engine} 项目页面', 'palette.rosePine': 'Rosé Pine', 'palette.moon': 'Moon', 'palette.dawnMain': 'Dawn / Main', diff --git a/src/i18n/locales/zh-TW.ts b/src/i18n/locales/zh-TW.ts index 270e83e3..bd36077a 100644 --- a/src/i18n/locales/zh-TW.ts +++ b/src/i18n/locales/zh-TW.ts @@ -1157,7 +1157,6 @@ export const messages = { 'shell.backend.offline': '無法連線', 'shell.backend.degraded': '已連線,版本不明', 'shell.backend.edit': '編輯後端', - 'shell.backend.project': '{engine} 專案頁面', 'palette.rosePine': 'Rosé Pine', 'palette.moon': 'Moon', 'palette.dawnMain': 'Dawn / Main', diff --git a/src/shell/Backend.tsx b/src/shell/Backend.tsx index 1dc4e713..f41973b8 100644 --- a/src/shell/Backend.tsx +++ b/src/shell/Backend.tsx @@ -1,20 +1,16 @@ import {useState, type ReactElement, type RefObject} from 'react'; -import {Button, Divider, Kv, Light, Link, PopoverDialog} from '../ui/ui'; +import {Button, Kv, Light, Link, PopoverDialog} from '../ui/ui'; import {About} from './About'; import type {BackendView} from './view'; -// A hover card of what the shell knows about the backend, then editing it in Settings, About doona and the engine's -// project page as menu rows. +// A hover card of what the shell knows about the backend, then two buttons: About doona, and editing the backend in +// Settings as the main action. The engine's project page is in About, so it is not repeated here. // The About action closes the popover before the dialog opens, so focus has one place to return to. function BackendFacts({backend, close, openAbout}: {backend: BackendView; close: () => void; openAbout: () => void}) { return ( <> -
- - {backend.edit.label} - - - {backend.project.label} + + {backend.edit.label}
diff --git a/src/shell/messages.ts b/src/shell/messages.ts index 15a4d1c6..5c26f2f7 100644 --- a/src/shell/messages.ts +++ b/src/shell/messages.ts @@ -109,7 +109,6 @@ export const messages = defineMessages({ 'shell.backend.offline': '無法連線', 'shell.backend.degraded': '已連線,版本不明', 'shell.backend.edit': '編輯後端', - 'shell.backend.project': '{engine} 專案頁面', 'palette.rosePine': 'Rosé Pine', 'palette.moon': 'Moon', 'palette.dawnMain': 'Dawn / Main', @@ -252,7 +251,6 @@ export const messages = defineMessages({ 'shell.backend.offline': '无法连接', 'shell.backend.degraded': '已连接,版本未知', 'shell.backend.edit': '编辑后端', - 'shell.backend.project': '{engine} 项目页面', 'palette.rosePine': 'Rosé Pine', 'palette.moon': 'Moon', 'palette.dawnMain': 'Dawn / Main', @@ -395,7 +393,6 @@ export const messages = defineMessages({ 'shell.backend.offline': 'Unreachable', 'shell.backend.degraded': 'Connected, version unknown', 'shell.backend.edit': 'Edit backend', - 'shell.backend.project': '{engine} project page', 'palette.rosePine': 'Rosé Pine', 'palette.moon': 'Moon', 'palette.dawnMain': 'Dawn / Main', diff --git a/src/shell/view.ts b/src/shell/view.ts index dbfd3a91..34907e8d 100644 --- a/src/shell/view.ts +++ b/src/shell/view.ts @@ -47,7 +47,6 @@ export type BackendView = { facts: Array<[string, string]>; about: string; edit: {href: string; label: string}; - project: {href: string; label: string}; }; export type PaletteSection = {title: string; items: Array<{id: string; label: string; desc?: string; className?: string}>}; export type AppearanceMenu = ReturnType; @@ -113,7 +112,6 @@ export function shellView( const build = version?.build?.revision ? ` (${version.build.revision.slice(0, 12)})` : ''; const apiText = version ? t('ui.apiVersion', {name: version.api.name, major: version.api.major, status: version.api.status}) : '—'; const contractText = import.meta.env.VITE_DOONA_CONTRACT_COMMIT; - const engineName = version?.engine.name ?? org.split('/').pop()!; const api = profile?.api; const address = isDemoApi(api) ? t('shell.backend.demo') : api; const [tone, stateKey] = backendState(needsLogin, !capabilities && !capabilityError, capabilityError, versionError); @@ -155,8 +153,7 @@ export function shellView( ...fact(t('shell.backend.profile'), profile?.name) ], about: t('about.title'), - edit: {href: href('settings', {card: 'backend'}), label: t('shell.backend.edit')}, - project: {href: version ? `${org}/${version.engine.name}` : org, label: t('shell.backend.project', {engine: engineName})} + edit: {href: href('settings', {card: 'backend'}), label: t('shell.backend.edit')} }, shortcuts, shortcutPaths: Object.fromEntries(shortcuts.map(item => [item.key, item.path])), diff --git a/src/ui/styles/shell-search.css b/src/ui/styles/shell-search.css index e6c2ebe4..c0b37166 100644 --- a/src/ui/styles/shell-search.css +++ b/src/ui/styles/shell-search.css @@ -393,14 +393,10 @@ /* The actions read as menu rows: full width, their text at the start edge, in line with the facts. */ .rp-backend-actions { display: flex; - flex-direction: column; - margin-inline: -8px; - margin-block-end: -8px; -} -.rp-backend-actions > .rp-btn { - justify-content: flex-start; - inline-size: 100%; - padding-inline: 8px; + flex-wrap: wrap; + justify-content: flex-end; + gap: 8px; + margin-block-start: 8px; } .rp-main { margin-inline-end: 0;