feat(about): the accessibility statement and where to report a barrier
Someone who cannot use part of the app is the person least able to go looking for a repository file about it. About gains an Accessibility section: a button that opens ACCESSIBILITY.md, and accessibility@poli0981.dev beside the two addresses already there, copyable the same way. No capability is widened: https://github.com/* was already in scope. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
a5fc204de8
commit
885bca416c
4 files changed
+54
-3
No files matched your search
@@ -467,9 +467,13 @@
|
||||
"reopen": "Show the documents again",
|
||||
"reopenDetail": "Puts the first-run screen back so you can read the five documents. It changes nothing: your acceptance stays as it is, and closing that screen returns you here.",
|
||||
"contactTitle": "Contact",
|
||||
"contactIntro": "PipDock is made by one person. Both addresses are read.",
|
||||
"contactIntro": "PipDock is made by one person. Every address here is read.",
|
||||
"contactGeneral": "General questions and feedback",
|
||||
"contactCode": "Source code, security reports and licensing",
|
||||
"a11yTitle": "Accessibility",
|
||||
"a11yBody": "PipDock is meant to work with a keyboard alone, with a screen reader and in high contrast. The statement says what is supported and what is known not to work yet. If something gets in your way, write — in English or Vietnamese, and no GitHub account is needed.",
|
||||
"a11yRead": "Read the accessibility statement",
|
||||
"a11yContact": "Accessibility barriers and feedback",
|
||||
"copy": "Copy",
|
||||
"copyAddress": "Copy {{address}}",
|
||||
"copied": "Copied",
|
||||
|
||||
@@ -425,9 +425,13 @@
|
||||
"reopen": "Xem lại các tài liệu",
|
||||
"reopenDetail": "Đưa màn hình chạy lần đầu trở lại để bạn đọc năm tài liệu. Nó không thay đổi gì cả: việc bạn đã chấp nhận vẫn giữ nguyên, và đóng màn hình đó sẽ đưa bạn về đây.",
|
||||
"contactTitle": "Liên hệ",
|
||||
"contactIntro": "PipDock do một người làm ra. Cả hai địa chỉ đều được đọc.",
|
||||
"contactIntro": "PipDock do một người làm ra. Mọi địa chỉ ở đây đều được đọc.",
|
||||
"contactGeneral": "Câu hỏi chung và góp ý",
|
||||
"contactCode": "Mã nguồn, báo cáo bảo mật và giấy phép",
|
||||
"a11yTitle": "Khả năng tiếp cận",
|
||||
"a11yBody": "PipDock được làm để dùng được chỉ với bàn phím, với trình đọc màn hình và ở chế độ tương phản cao. Bản tuyên bố nêu những gì đang được hỗ trợ và những gì đã biết là chưa hoạt động. Nếu có điều gì cản trở bạn, hãy viết thư — bằng tiếng Việt hoặc tiếng Anh, không cần tài khoản GitHub.",
|
||||
"a11yRead": "Đọc tuyên bố về khả năng tiếp cận",
|
||||
"a11yContact": "Rào cản và góp ý về khả năng tiếp cận",
|
||||
"copy": "Sao chép",
|
||||
"copyAddress": "Sao chép {{address}}",
|
||||
"copied": "Đã sao chép",
|
||||
|
||||
@@ -81,6 +81,24 @@ describe('PdAbout', () => {
|
||||
expect(writeText).toHaveBeenCalledTimes(2)
|
||||
})
|
||||
|
||||
it('says where to report a barrier, and opens the accessibility statement', async () => {
|
||||
// Someone who cannot use part of the app is the person least able to go and find a
|
||||
// repository file about it. The address and the statement are on the screen every other
|
||||
// contact is on.
|
||||
render(<PdAbout />)
|
||||
expect(screen.getByRole('heading', { level: 2, name: 'Accessibility' })).toBeInTheDocument()
|
||||
|
||||
const address = 'accessibility@poli0981.dev'
|
||||
expect(screen.getByText(address)).toBeInTheDocument()
|
||||
fireEvent.click(screen.getByLabelText(`Copy ${address}`))
|
||||
await waitFor(() => {
|
||||
expect(writeText).toHaveBeenCalledWith(address)
|
||||
})
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Read the accessibility statement' }))
|
||||
expect(openUrl).toHaveBeenCalledWith(`${REPO}/blob/main/ACCESSIBILITY.md`)
|
||||
})
|
||||
|
||||
it('opens the links page inside the capability scope', () => {
|
||||
render(<PdAbout />)
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Open the links page' }))
|
||||
|
||||
@@ -29,12 +29,22 @@ import { useLegalStore } from '@/stores'
|
||||
/** SPDX identifier from `Cargo.toml` and `package.json`. An identifier, never translated. */
|
||||
const LICENSE = 'GPL-3.0-only'
|
||||
|
||||
/** Where to write. Both are read. */
|
||||
/** Where to write. All three are read. */
|
||||
const CONTACT = {
|
||||
general: 'contact@poli0981.dev',
|
||||
code: 'code@poli0981.dev',
|
||||
accessibility: 'accessibility@poli0981.dev',
|
||||
} as const
|
||||
|
||||
/**
|
||||
* The accessibility statement, in the app and not only in the repository.
|
||||
*
|
||||
* Someone who cannot use part of PipDock is the person least able to go looking for a file about
|
||||
* it. The statement says what is supported, what is known not to work, and how to report a
|
||||
* barrier without a GitHub account — which is what the address below is for.
|
||||
*/
|
||||
const ACCESSIBILITY = `${REPO}/blob/main/ACCESSIBILITY.md`
|
||||
|
||||
/** The one page listing every other channel. Scoped in `capabilities/external-links.json`. */
|
||||
const LINKS = 'https://poli0981.dev/links/'
|
||||
|
||||
@@ -151,6 +161,21 @@ export function PdAbout() {
|
||||
<CopyableAddress address={CONTACT.general} label={t('about.contactGeneral')} />
|
||||
<CopyableAddress address={CONTACT.code} label={t('about.contactCode')} />
|
||||
|
||||
<h2 className="mt-8 text-text-dim">{t('about.a11yTitle')}</h2>
|
||||
<p className="mt-1 max-w-2xl text-data text-text-dim">{t('about.a11yBody')}</p>
|
||||
<p className="mt-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
open(ACCESSIBILITY)
|
||||
}}
|
||||
className="rounded-pd border border-border px-3 py-1 text-data text-text-dim hover:bg-surface-2"
|
||||
>
|
||||
{t('about.a11yRead')}
|
||||
</button>
|
||||
</p>
|
||||
<CopyableAddress address={CONTACT.accessibility} label={t('about.a11yContact')} />
|
||||
|
||||
<h2 className="mt-8 text-text-dim">{t('about.linksTitle')}</h2>
|
||||
<p className="mt-1 max-w-2xl text-data text-text-dim">{t('about.linksIntro')}</p>
|
||||
<p className="mt-2 flex flex-wrap items-center gap-2">
|
||||
|
||||
Reference in new issue
Block a user