From 3ac8689feb41f52e0c2b28bf657753ca99dcb735 Mon Sep 17 00:00:00 2001 From: bowenliang123 Date: Fri, 28 Aug 2026 00:14:21 +0800 Subject: [PATCH] feat(plugin): make the info-card tagline link to the repo --- src/client/components/pluginInfo.tsx | 5 ++++- src/client/styles.css | 2 ++ tests/client/components/pluginInfo.spec.ts | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/client/components/pluginInfo.tsx b/src/client/components/pluginInfo.tsx index 1815c6b..54d06fb 100644 --- a/src/client/components/pluginInfo.tsx +++ b/src/client/components/pluginInfo.tsx @@ -35,7 +35,10 @@ export function makePluginInfo(kit: ViewKit): () => ReactNS.ReactElement {
{t('plugin.title')} - {t('plugin.hint')} + {/* The tagline doubles as the repo link: hover underlines it, a click opens GitHub. */} + + {t('plugin.hint')} +
{row(t('plugin.name'), nameValue, PLUGIN_REPO + '/releases')} diff --git a/src/client/styles.css b/src/client/styles.css index 1664214..aa06dfa 100644 --- a/src/client/styles.css +++ b/src/client/styles.css @@ -213,6 +213,8 @@ button.lc-brief-row-link { cursor: pointer; } .lc-pi-grid { display: grid; grid-template-columns: 1fr; gap: 8px; } .lc-pi-row { display: flex; flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; min-width: 0; text-decoration: none; color: inherit; } .lc-pi-row:hover .lc-pi-value { text-decoration: underline; } +.lc-pi-hint { text-decoration: none; } +.lc-pi-hint:hover { text-decoration: underline; } .lc-pi-update { color: var(--dsw-alias-state-warn-primary); font-size: 11px; margin-left: 6px; white-space: nowrap; } .lc-pi-label { flex: none; color: var(--dsw-alias-label-secondary); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* diff --git a/tests/client/components/pluginInfo.spec.ts b/tests/client/components/pluginInfo.spec.ts index 1cc3efb..ddbcee9 100644 --- a/tests/client/components/pluginInfo.spec.ts +++ b/tests/client/components/pluginInfo.spec.ts @@ -51,6 +51,12 @@ describe('PluginInfo', () => { assert.equal(query(rows[1], '.lc-pi-label').textContent, 'GitHub') assert.equal(query(rows[1], '.lc-pi-value').textContent, 'bowenliang123/dsh-context') assert.equal(rows[1].getAttribute('href'), 'https://github.com/bowenliang123/dsh-context') + // The tagline is the repo link too: hover underlines it, a click opens GitHub. + const hint = query(m.container, '.lc-pi-hint') + assert.ok(text(hint).includes('The best DSH context plugin')) + assert.equal(hint.getAttribute('href'), 'https://github.com/bowenliang123/dsh-context') + assert.equal(hint.getAttribute('target'), '_blank') + assert.equal(hint.getAttribute('rel'), 'noreferrer') assert.equal(queryAll(m.container, '.lc-pi-update').length, 0) await m.unmount() })