feat(plugin): make the info-card tagline link to the repo

This commit is contained in:
bowenliang123 committed 2026-08-28 00:14:21 +08:00
1 parent bee4b88509
commit 3ac8689feb
3 files changed
+12 -1

No files matched your search

+4 -1
View File
@@ -35,7 +35,10 @@ export function makePluginInfo(kit: ViewKit): () => ReactNS.ReactElement {
<div className="lc-card">
<div className="lc-card-title">
<span className="lc-card-title-text">{t('plugin.title')}</span>
<span className="lc-card-sub">{t('plugin.hint')}</span>
{/* The tagline doubles as the repo link: hover underlines it, a click opens GitHub. */}
<a className="lc-card-sub lc-pi-hint" href={PLUGIN_REPO} target="_blank" rel="noreferrer">
{t('plugin.hint')}
</a>
</div>
<div className="lc-pi-grid">
{row(t('plugin.name'), nameValue, PLUGIN_REPO + '/releases')}
+2
View File
@@ -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; }
/*
@@ -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()
})