Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a343b8cbe3 | ||
|
|
d61318aed7 | ||
|
|
0bd2aabbf2 | ||
|
|
2be6955087 | ||
|
|
8d9739cab4 | ||
|
|
9d4458ae4b | ||
|
|
e4f2a93820 | ||
|
|
bf3eb9f22b | ||
|
|
073a7cd654 | ||
|
|
e5d1cf5bf5 | ||
|
|
21b04c3e96 | ||
|
|
8c4d75fe08 | ||
|
|
533809ce4f | ||
|
|
f65264a020 | ||
|
|
c5dd04a1b8 | ||
|
|
c42681fb04 | ||
|
|
e2f36bc6b1 | ||
|
|
46606dce94 | ||
|
|
63dcf0d4fc | ||
|
|
c667a0b4c9 | ||
|
|
49ce0bf868 | ||
|
|
254409dd3b | ||
|
|
a95663a1f9 | ||
|
|
71d969e673 |
No files matched your search
@@ -0,0 +1,106 @@
|
||||
name: Something is hard or impossible to use
|
||||
description: A barrier with the keyboard, a screen reader, a contrast theme, zoom, or voice control.
|
||||
title: '[a11y] '
|
||||
labels: [accessibility]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you — a report like this is treated as a defect, not a wish.
|
||||
[ACCESSIBILITY.md](https://github.com/poli0981/bookmarkmagic/blob/main/ACCESSIBILITY.md)
|
||||
lists what is already known not to work well; it is fine to report
|
||||
something on that list if it is in your way.
|
||||
|
||||
You do not need to explain why you use the tools you use.
|
||||
|
||||
**Please do not attach your real bookmarks file**, and check a
|
||||
screenshot or recording for bookmark titles first — your bookmarks are
|
||||
your browsing history.
|
||||
|
||||
- type: textarea
|
||||
id: task
|
||||
attributes:
|
||||
label: What were you trying to do, and what happened instead?
|
||||
placeholder: |
|
||||
I tabbed to the tree on the Edit tab and pressed F2 to rename a
|
||||
folder. Nothing was announced and I could not tell whether …
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: severity
|
||||
attributes:
|
||||
label: How badly does it get in the way?
|
||||
options:
|
||||
- Blocked — I could not finish what I was doing
|
||||
- Hard — I finished, but only with a workaround
|
||||
- Annoying — it works, but badly
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: area
|
||||
attributes:
|
||||
label: Where does it happen?
|
||||
options:
|
||||
- Import
|
||||
- Export
|
||||
- Edit
|
||||
- Settings
|
||||
- About / legal gate
|
||||
- The toolbar popup
|
||||
- Everywhere
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: assistive-tech
|
||||
attributes:
|
||||
label: Assistive technology and settings
|
||||
description: >-
|
||||
Whatever applies, with a version if you know it — a screen reader
|
||||
(Narrator, NVDA, JAWS, VoiceOver, ChromeVox, Orca), a contrast theme,
|
||||
zoom level, reduced motion, voice control, switch access, a keyboard
|
||||
only. "None, keyboard only" is a complete answer.
|
||||
placeholder: NVDA 2026.3, Windows contrast theme "Night sky", 150 % zoom
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: BookmarkMagic version
|
||||
description: Shown in the About tab, and on chrome://extensions.
|
||||
placeholder: '1.2.1'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: browser
|
||||
attributes:
|
||||
label: Browser and operating system
|
||||
placeholder: Chrome 142 on Windows 11
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: The keys you pressed are as useful as anything else here.
|
||||
placeholder: |
|
||||
1. Open the manager, go to Edit
|
||||
2. Tab to the tree, press ↓ three times
|
||||
3. …
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
id: confirmations
|
||||
attributes:
|
||||
label: Before submitting
|
||||
options:
|
||||
- label: >-
|
||||
Anything I attached contains no real addresses, titles or personal
|
||||
data.
|
||||
required: true
|
||||
@@ -10,6 +10,10 @@ body:
|
||||
"A bookmark file will not import correctly" form instead — it asks for
|
||||
the one thing that makes those fixable.
|
||||
|
||||
If something is hard or impossible to use with a **keyboard, a screen
|
||||
reader, a contrast theme or zoom**, the "Something is hard or
|
||||
impossible to use" form asks better questions for that.
|
||||
|
||||
If this is a **security** problem, do not file it here. See
|
||||
[SECURITY.md](https://github.com/poli0981/bookmarkmagic/blob/main/SECURITY.md).
|
||||
|
||||
|
||||
@@ -14,6 +14,12 @@ contact_links:
|
||||
url: https://chromewebstore.google.com/detail/bookmarkmagic/eghnciphhegekmnofffpgbdfefckdhmg
|
||||
about: Reviews are read, but a bug reported here gets fixed faster.
|
||||
|
||||
- name: Accessibility barrier, by email
|
||||
url: mailto:accessibility@poli0981.dev
|
||||
about: >-
|
||||
The "Something is hard or impossible to use" form above is the quickest
|
||||
route; email works too. See ACCESSIBILITY.md.
|
||||
|
||||
- name: Question, or no GitHub account
|
||||
url: mailto:code@poli0981.dev
|
||||
about: >-
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: A translation is wrong or awkward
|
||||
description: Vietnamese or Japanese wording that is incorrect, unnatural, or untranslated.
|
||||
description: Vietnamese, Japanese, Chinese or Romanian wording that is incorrect, unnatural, or untranslated.
|
||||
title: '[i18n] '
|
||||
labels: [i18n]
|
||||
body:
|
||||
@@ -7,9 +7,9 @@ body:
|
||||
attributes:
|
||||
value: |
|
||||
Native speakers are the only people who can catch this. English is the
|
||||
source language; Vietnamese is reviewed by the maintainer and Japanese
|
||||
is best-effort until a native pass, so JA reports are especially
|
||||
welcome.
|
||||
source language; Vietnamese is reviewed by the maintainer. Japanese,
|
||||
Simplified Chinese and Romanian are best-effort until a native pass,
|
||||
so reports in those three are especially welcome.
|
||||
|
||||
You do **not** need to open a pull request or install anything — just
|
||||
tell us the wording. If you would rather send the change yourself,
|
||||
@@ -23,6 +23,8 @@ body:
|
||||
options:
|
||||
- Tiếng Việt (vi)
|
||||
- 日本語 (ja)
|
||||
- 简体中文 (zh-CN)
|
||||
- Română (ro)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -22,10 +22,34 @@ a translation fix does not need the parser section, and vice versa.
|
||||
|
||||
### If it touches user-visible text
|
||||
|
||||
- [ ] The key exists in **all three** locales — `en`, `vi`, `ja`. `en.ts` is the
|
||||
schema; `vi`/`ja` use `satisfies Dict`, so a missing key fails the type
|
||||
check. Never add `as const` to a locale file.
|
||||
- [ ] Interpolation tokens (`{n}`, `{name}`) match across all three.
|
||||
- [ ] The key exists in **every** locale — `en`, `vi`, `ja`, `zh-CN`, `ro`
|
||||
(`LOCALES`). `en.ts` is the schema; the others use `satisfies Dict`, so a
|
||||
missing key fails the type check. Never add `as const` to a locale file.
|
||||
- [ ] Interpolation tokens (`{n}`, `{name}`) match across every locale, and a
|
||||
plural key carries the forms its language needs (`few` in Romanian —
|
||||
`docs/07 §5`).
|
||||
|
||||
### If it changes the interface
|
||||
|
||||
`ACCESSIBILITY.md` is a public promise and `docs/06 §5` is its specification.
|
||||
|
||||
- [ ] Everything new works from the **keyboard alone**, and focus is visible
|
||||
on it — including on a control with a filled background.
|
||||
- [ ] Focus goes somewhere sensible when the thing that had it disappears
|
||||
(a closed dialog, a removed row, a replaced step). It never falls to
|
||||
the top of the page.
|
||||
- [ ] Every control has an accessible **name**; an icon-only button takes a
|
||||
`label`. Text a screen reader speaks is an i18n key like any other.
|
||||
- [ ] No state is shown by **colour alone**, and a state shown by a fill or a
|
||||
shadow has a `@media (forced-colors: active)` equivalent
|
||||
(`tests/unit/styles/forced-colors.test.ts` holds the list).
|
||||
- [ ] Anything that moves sits inside
|
||||
`@media (prefers-reduced-motion: no-preference)`; pointer targets are at
|
||||
least 24 × 24 CSS px.
|
||||
- [ ] One pass with a **screen reader** over the changed screen (Narrator,
|
||||
NVDA or VoiceOver) — or the PR says that it was not done.
|
||||
- [ ] `ACCESSIBILITY.md` is still true: its key table and its known
|
||||
limitations.
|
||||
|
||||
### If it is a parser fix
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
if: steps.token.outputs.present == 'true'
|
||||
# Pinned to a commit, not a moving tag: this step holds a token. Dependabot
|
||||
# proposes updates (with the repo's 7-day cooldown).
|
||||
uses: SonarSource/sonarqube-scan-action@d209202bc7d53ff1cc128f7f907dac145c9d6ae9 # v8.3.0
|
||||
uses: SonarSource/sonarqube-scan-action@4d1dc0c91ee400dcf8a6dddf2f705ac36542e304 # v8.4.0
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
# Accessibility
|
||||
|
||||
BookmarkMagic should be usable by anyone who has bookmarks to move — with a
|
||||
keyboard and no mouse, with a screen reader, with a contrast theme, with the
|
||||
page zoomed, or with animation switched off. This file says what that means
|
||||
today: what the goal is, what has actually been tested, what is known not to
|
||||
work well yet, and how to tell us about a barrier.
|
||||
|
||||
**Last reviewed:** 2026-11-10, for version 1.2.1.
|
||||
|
||||
## The goal
|
||||
|
||||
The target is the [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/)
|
||||
at **Level AA**.
|
||||
|
||||
That is a goal, not a claim. BookmarkMagic has not been audited by an
|
||||
accessibility specialist, and it does not claim to conform to WCAG. It is
|
||||
built and tested by one person, and the testing that has been done is listed
|
||||
below so you can judge it for yourself.
|
||||
|
||||
The priorities, in order:
|
||||
|
||||
1. **Everything works from the keyboard.** No task needs a mouse.
|
||||
2. **A screen reader is told what is on screen and what just happened** —
|
||||
names, roles, states, and the result of an import.
|
||||
3. **Nothing depends on colour, motion or a pointer's precision alone.**
|
||||
4. **Every shipped language is treated the same** — English, Tiếng Việt, 日本語,
|
||||
简体中文 and Română. The page's language is declared to the browser, so a
|
||||
screen reader picks the right voice.
|
||||
|
||||
## Supported environments
|
||||
|
||||
| Environment | Status |
|
||||
|---|---|
|
||||
| Chrome 136 or later on Windows | Supported, and where the testing below was done |
|
||||
| Chrome 136 or later on macOS, Linux and ChromeOS | Supported; expected to work the same, not tested for accessibility |
|
||||
| Edge, Brave, Vivaldi and Opera (the same build) | Best effort — the extension runs there, and accessibility is untested |
|
||||
| Chrome on Android or iOS | Not applicable: Chrome there does not run extensions |
|
||||
|
||||
## What is in place
|
||||
|
||||
### Keyboard
|
||||
|
||||
Every control is either a tab stop or has a key of its own, and every dialog
|
||||
can be closed with Esc. Focus shows as a 2-pixel ring on controls; inside the
|
||||
bookmark tree, the current row is marked by a highlight and a bar at its left
|
||||
edge.
|
||||
|
||||
The bookmark tree on the **Edit** tab is a single tab stop. Inside it:
|
||||
|
||||
| Key | What it does |
|
||||
|---|---|
|
||||
| ↑ / ↓ | Move to the previous or next row |
|
||||
| Home / End | Move to the first or last row |
|
||||
| → | Open a closed folder, or step into an open one |
|
||||
| ← | Close an open folder, or step out to its parent |
|
||||
| A letter or digit | Jump to the next row whose title starts with it |
|
||||
| Enter | Open a bookmark in a new tab; open or close a folder |
|
||||
| F2 | Rename (Enter saves, Esc cancels) |
|
||||
| Delete (Fn+Delete on a Mac laptop) | Delete, after a confirmation |
|
||||
| Menu key, or Shift+F10 | **Move to…** — pick a destination folder from a filterable list |
|
||||
| Alt+↑ / Alt+↓ | Move the row up or down one place inside its folder |
|
||||
| Ctrl+C (⌘C on macOS) | Copy the focused bookmark's address |
|
||||
| Ctrl+F (⌘F on macOS) | Go to the search box, from anywhere on the Edit tab |
|
||||
|
||||
The small buttons that appear on a row are shortcuts for the mouse, and are
|
||||
deliberately not tab stops: Open, Copy link, Rename, Move to… and Delete each
|
||||
have a key in the table above, and Sort A→Z is also a button on the toolbar.
|
||||
|
||||
Alt+↑ and Alt+↓ move a row past the neighbour you can see. While a search is
|
||||
filtering the tree, that also carries it past any hidden items in between.
|
||||
|
||||
Elsewhere: the theme control is a radio group (arrow keys change the choice),
|
||||
the file drop zone is a button that opens the file picker, and the folder
|
||||
lists in the import preview and the export picker are ordinary lists with
|
||||
buttons and checkboxes — Tab, Enter and Space.
|
||||
|
||||
### Screen readers
|
||||
|
||||
- The Edit tree is an ARIA tree: each row announces its name, its level, its
|
||||
position ("3 of 12") and whether it is expanded.
|
||||
- Dialogs are native `<dialog>` elements. Focus moves in when one opens and
|
||||
returns when it closes; a confirmation reads its title and its body, and
|
||||
opens with **Cancel** focused, so Enter never confirms a deletion.
|
||||
- An import is spoken as it goes: reading the file, backing up, writing,
|
||||
progress every 10 %, and the result. Failures are announced as alerts.
|
||||
- Moving a row with Alt+↑ or Alt+↓ announces its new position ("Docs:
|
||||
position 2 of 5"). This is new in 1.2.1 and has not yet been checked with a
|
||||
screen reader — see "What has been tested".
|
||||
- When an import moves to its next step, focus moves to that step's heading.
|
||||
When a page change removes the control that had focus, focus moves to the
|
||||
page's main content rather than back to the top of the page.
|
||||
- Every icon-only button has a name. Icons themselves are hidden from
|
||||
assistive technology.
|
||||
- The page title names the current section, and the page's language follows
|
||||
the language you chose.
|
||||
|
||||
### Seeing the page
|
||||
|
||||
- **Contrast.** Text is at least 4.5:1 against its background, and control
|
||||
borders and the focus ring at least 3:1, in the light and the dark theme. A
|
||||
test fails the build if a colour pair drops below that.
|
||||
- **Contrast themes** (Windows "Contrast themes", `forced-colors`). Since
|
||||
1.2.1, the states that were shown only by a fill or a shadow — the focused
|
||||
row, where a dragged item will land, the selected theme, the current
|
||||
section, the selected option cards, the progress bar, the edge of the file
|
||||
drop zone — are drawn with the theme's own colours instead.
|
||||
- **Zoom.** The layout reflows as the window narrows or the page is zoomed.
|
||||
- **Light and dark** themes follow the system, or your choice in Settings.
|
||||
- **Disabled buttons** are marked by colour and cursor, never by fading the
|
||||
text until it cannot be read. (Two kinds of button are an exception; see
|
||||
the limitations.)
|
||||
- **Target size.** Since 1.2.1, every button is at least 24 × 24 CSS pixels,
|
||||
including the small icon buttons. Checkboxes, radio buttons and links in
|
||||
text keep their natural size; their labels are part of the target.
|
||||
|
||||
### Motion
|
||||
|
||||
If your system asks for reduced motion, nothing moves: no sliding, spinning or
|
||||
travelling stripes. A test fails the build if an animation is added outside
|
||||
that rule. Nothing flashes. An error message stays until you dismiss it;
|
||||
short confirmations leave by themselves after four seconds (see the
|
||||
limitations below).
|
||||
|
||||
## What has been tested
|
||||
|
||||
| Check | With | When |
|
||||
|---|---|---|
|
||||
| Keyboard only, mouse unplugged | Chrome on Windows 11 | November 2026, version 1.2.0 |
|
||||
| Screen reader | **Narrator** with Chrome on Windows 11 | November 2026, version 1.2.0 |
|
||||
| Contrast themes | Chrome with `forced-colors` emulated — not yet a real Windows theme | November 2026, version 1.2.1 |
|
||||
| What 1.2.1 changed: focus, Alt+↑/↓, button sizes | A scripted keyboard run in Chrome — no screen reader | November 2026, version 1.2.1 |
|
||||
| Colour contrast of the theme colours, reduced motion, the tree's key handling | Automated tests, on every change | Continuous |
|
||||
|
||||
**Not tested**, so we cannot tell you how well they work: anything on macOS,
|
||||
Linux or ChromeOS; NVDA, JAWS, VoiceOver, ChromeVox and Orca; voice control
|
||||
(Dragon, Voice Access, Voice Control); switch access; screen magnifiers; and
|
||||
zoom at 200 %. Narrator has not yet been run over what 1.2.1 added.
|
||||
If you use one of these, a report of what you found — good or bad — is
|
||||
genuinely useful.
|
||||
|
||||
## Known limitations
|
||||
|
||||
These are known, and none of them is by design.
|
||||
|
||||
- **Most edits are not announced.** Alt+↑/↓ announces the result; a rename, a
|
||||
move to another folder, a sort and a new folder succeed silently. Search
|
||||
does not announce how many rows match. A key that cannot act — Alt+↑ on the
|
||||
first item of a folder, Delete on one of the three top-level folders — does
|
||||
nothing and says nothing.
|
||||
- **Folders and bookmarks sound alike in the tree.** They differ by an icon a
|
||||
screen reader does not read. A folder with something in it announces
|
||||
"expanded" or "collapsed"; an empty folder announces neither. The lock on a
|
||||
bookmark your organisation manages is also only an icon, and a folder's
|
||||
item count is read as a bare number.
|
||||
- **A focused row may read out its buttons** ("Open, Copy link, Rename…")
|
||||
after its name. It is noisy, not broken.
|
||||
- **Reordering with a pointer needs a drag.** There is a keyboard way
|
||||
(Alt+↑/↓) and Sort A→Z, but no click-only way to place one item before
|
||||
another.
|
||||
- **Alt+↑/↓ may not reach the page on a Chromebook**, where the system can turn
|
||||
those keys into Page Up and Page Down. On a Mac there is no Menu key (use
|
||||
Shift+F10), and the laptop's delete key is Backspace, which the tree does
|
||||
not act on (use Fn+Delete).
|
||||
- **The tree's keys are not shown inside the extension**, apart from Ctrl+F on
|
||||
the search box. The table above is the list; the About tab links to this
|
||||
file.
|
||||
- **The toolbar above the tree is announced as a toolbar**, but its buttons are
|
||||
reached with Tab, not with the arrow keys a toolbar usually offers.
|
||||
- **Some hints appear only on mouse hover**: the notes in the status bar, where
|
||||
a top-level folder of an imported file will go, and the reason a section is
|
||||
unavailable while an import is writing.
|
||||
- **A section that is unavailable while an import is writing looks the same as
|
||||
one that is available**; only the cursor and the hover hint differ. The same
|
||||
goes for a tree row's small buttons while a sort or a bulk delete is
|
||||
running. A screen reader does announce both as unavailable.
|
||||
- **Long titles are cut short with "…"** in the tree, and there is no way to
|
||||
read the whole title there other than renaming (F2).
|
||||
- **Headings are sparse.** Sections are landmarks, but the pages have few
|
||||
headings to jump between, and there is no "skip to content" link past the
|
||||
header's controls.
|
||||
- **Descriptions in Settings are not tied to their controls**, so a screen
|
||||
reader reads the control's name but not the sentence under it.
|
||||
- **Short notices disappear after four seconds** ("Saved", "Link copied",
|
||||
the name of an exported file). They are announced, but they cannot be
|
||||
paused. An error stays, though a second error replaces the first.
|
||||
- **Text size follows zoom, not the browser's font-size setting.** Use
|
||||
Ctrl and + to enlarge the page.
|
||||
- **On the Edit tab, Ctrl+F always goes to BookmarkMagic's own search box**
|
||||
rather than the browser's Find.
|
||||
- **The Japanese, Chinese and Romanian translations have not been reviewed by
|
||||
native speakers**, which includes the text a screen reader speaks.
|
||||
|
||||
## Reporting a barrier
|
||||
|
||||
If something stops you, or just gets in your way, please say so. An
|
||||
accessibility report is treated as a defect, not a feature request.
|
||||
|
||||
- **With a GitHub account:** open an
|
||||
[accessibility report](https://github.com/poli0981/bookmarkmagic/issues/new?template=accessibility.yml).
|
||||
- **Without one:** write to **accessibility@poli0981.dev**.
|
||||
|
||||
It helps to include:
|
||||
|
||||
- what you were trying to do, and what happened instead;
|
||||
- the BookmarkMagic version (About tab, or `chrome://extensions`);
|
||||
- your browser and operating system;
|
||||
- the assistive technology you use and its version, if any — a screen reader,
|
||||
a contrast theme, zoom level, voice control;
|
||||
- how badly it gets in the way: **blocked** (you could not finish),
|
||||
**hard** (you finished, with a workaround), or **annoying**.
|
||||
|
||||
You do not need to explain why you use the tools you use, and nobody will ask.
|
||||
|
||||
**Please do not send your real bookmarks file**, and check a screenshot or a
|
||||
recording for bookmark titles before attaching it — your bookmarks are your
|
||||
browsing history. [`CONTRIBUTING.md`](CONTRIBUTING.md) explains how to
|
||||
sanitize a file if a particular one is needed.
|
||||
|
||||
### What happens next
|
||||
|
||||
BookmarkMagic has one maintainer, so these are honest intentions rather than
|
||||
guarantees:
|
||||
|
||||
- A report is acknowledged within about a week.
|
||||
- A **blocking** barrier is fixed ahead of other work and shipped in its own
|
||||
patch release; Chrome then updates installed copies by itself, usually
|
||||
within days of the store's review.
|
||||
- Anything else is scheduled, and added to the list above until it is fixed,
|
||||
so the next person can see it is known.
|
||||
- If a fix is not possible or not planned, you will be told why.
|
||||
- When a fix ships, you will be asked whether it actually works for you. Your
|
||||
answer counts for more than our test.
|
||||
|
||||
## For contributors
|
||||
|
||||
A change to the interface has to keep the above true.
|
||||
[`CONTRIBUTING.md`](CONTRIBUTING.md) and the pull-request checklist list what
|
||||
to check: keyboard, visible focus, names and labels, no meaning carried by
|
||||
colour alone, reduced motion, contrast themes, and one pass with a screen
|
||||
reader. The specification behind this statement is
|
||||
[`docs/06_UI.md` §5](docs/06_UI.md); if a change makes this file wrong, the
|
||||
same pull request has to correct it.
|
||||
|
||||
## Who is responsible
|
||||
|
||||
The maintainer, [@poli0981](https://github.com/poli0981), triages
|
||||
accessibility reports, keeps the limitations list current, and reviews this
|
||||
statement at every release.
|
||||
|
||||
Suggestions for the statement itself are welcome the same way as any other
|
||||
report.
|
||||
+84
-4
@@ -5,14 +5,92 @@ All notable changes to BookmarkMagic are documented here.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
Per `docs/12 §4`: **patch** = fixes and translations · **minor** = features, and
|
||||
any change to the permission list or the store privacy tab · **major** =
|
||||
breaking format or schema changes (a BM JSON version bump).
|
||||
Per `docs/12 §4`: **patch** = fixes and translation fixes · **minor** =
|
||||
features, a new UI language, and any change to the permission list or the
|
||||
store privacy tab · **major** = breaking format or schema changes (a BM JSON
|
||||
version bump).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
Nothing yet.
|
||||
|
||||
## [1.2.1] — 2026-11-10
|
||||
|
||||
Accessibility. Permissions are unchanged (`bookmarks` and `storage`), nothing
|
||||
is asked of you again, and there is nothing to do — Chrome updates itself.
|
||||
|
||||
### Added
|
||||
|
||||
- **An accessibility statement**,
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md): what works with a keyboard and a
|
||||
screen reader, what was tested and with what, what is known not to work
|
||||
well yet, every key the Edit tree understands, and how to report a barrier.
|
||||
About links to it.
|
||||
- **Reorder with the keyboard.** On the Edit tab, **Alt+↑** and **Alt+↓** move
|
||||
the focused bookmark or folder one place up or down inside its folder — until
|
||||
now only a drag could do that. The new position is announced for screen
|
||||
readers (not yet checked with one).
|
||||
- **Windows contrast themes.** The focused row, the line that shows where a
|
||||
dragged item will land, the selected theme, the current section, the
|
||||
selected import mode and export format, the progress bar and the drop zone's
|
||||
outline are now drawn in the theme's own colours; before, they disappeared.
|
||||
Checked with Chrome's emulation so far, not yet with a real theme.
|
||||
|
||||
### Fixed
|
||||
|
||||
- The theme switch showed no focus ring: it was drawn in the same colour as
|
||||
the button under it.
|
||||
- Keyboard focus is no longer thrown back to the top of the page after "Open
|
||||
in Edit", after "Keep the first of each", or after sorting a folder from the
|
||||
toolbar.
|
||||
- Clicking a row's button or its arrow no longer stops the arrow keys from
|
||||
working in the tree.
|
||||
- Clicking a row in a long, scrolled tree no longer jumps the tree back to the
|
||||
top.
|
||||
- Small buttons — the ones on a tree row, the folder arrows, the close buttons
|
||||
on dialogs and notices, the popup's gear, "Show more" — are at least
|
||||
24 × 24 pixels to click or tap.
|
||||
- The focus ring was cut off on "Show earlier / Show more" in the tree and on
|
||||
the folders in "Move to…"; the selected theme lost its label on hover; and
|
||||
the search box's placeholder text was fainter than the rest.
|
||||
|
||||
### Notes
|
||||
|
||||
- The goal is WCAG 2.2 AA; it is a goal, not a claim — nobody has audited the
|
||||
extension. If something is hard or impossible to use, the "Something is hard
|
||||
or impossible to use" form on GitHub, or accessibility@poli0981.dev, reaches
|
||||
the maintainer.
|
||||
- The two new pieces of text are best-effort in Japanese, Chinese and Romanian,
|
||||
like the rest of those translations.
|
||||
|
||||
## [1.2.0] — 2026-11-06
|
||||
|
||||
Two new languages. Permissions are unchanged (`bookmarks` and `storage`), and
|
||||
there is nothing to do — Chrome updates itself.
|
||||
|
||||
### Added
|
||||
|
||||
- **简体中文 (Simplified Chinese)** and **Română (Romanian)**, in the extension
|
||||
and in its name and description in `chrome://extensions`. Pick one under
|
||||
Settings → Language, or leave it on Automatic.
|
||||
- Romanian counts read the way Romanian does: "1 marcaj", "5 marcaje",
|
||||
"20 de marcaje".
|
||||
- Sort A→Z follows the language you use: pinyin order in Chinese, and `ș`/`ț`
|
||||
as letters of their own in Romanian.
|
||||
|
||||
### Changed
|
||||
|
||||
- **If your browser is set to Simplified Chinese or Romanian and the language
|
||||
setting is Automatic** (the default), BookmarkMagic switches from English to
|
||||
that language after this update. A browser in Traditional Chinese stays in
|
||||
English; 简体中文 can still be chosen by hand.
|
||||
|
||||
### Notes
|
||||
|
||||
- Both translations are best-effort, written from Chrome's own wording in each
|
||||
language but not yet read by a native speaker. If something reads wrong,
|
||||
the translation form on GitHub takes a sentence — no code needed.
|
||||
|
||||
## [1.1.0] — 2026-10-29
|
||||
|
||||
New import formats, a Merge that really merges, restores that put everything
|
||||
@@ -215,7 +293,9 @@ from 2026-08-03.
|
||||
- Parsing is bounded: 25 MB per file, 100 000 nodes, 200 levels of nesting.
|
||||
- No network access of any kind at runtime, enforced by a grep gate in CI.
|
||||
|
||||
[Unreleased]: https://github.com/poli0981/bookmarkmagic/compare/v1.1.0...HEAD
|
||||
[Unreleased]: https://github.com/poli0981/bookmarkmagic/compare/v1.2.1...HEAD
|
||||
[1.2.1]: https://github.com/poli0981/bookmarkmagic/compare/v1.2.0...v1.2.1
|
||||
[1.2.0]: https://github.com/poli0981/bookmarkmagic/compare/v1.1.0...v1.2.0
|
||||
[1.1.0]: https://github.com/poli0981/bookmarkmagic/compare/v1.0.1...v1.1.0
|
||||
[1.0.1]: https://github.com/poli0981/bookmarkmagic/compare/v1.0.0...v1.0.1
|
||||
[1.0.0]: https://github.com/poli0981/bookmarkmagic/releases/tag/v1.0.0
|
||||
@@ -8,8 +8,10 @@ This file is the entry point; the `docs/` suite is the specification.
|
||||
>
|
||||
> **BookmarkMagic is published on the Chrome Web Store and has real users**
|
||||
> (v1.0.0 live by 2026-08-03; v1.0.1 live, confirmed on the listing
|
||||
> 2026-10-28; v1.1.0 released on GitHub 2026-10-29, ⚠️ not yet submitted).
|
||||
> Phases 0–7 are complete; the project is in **maintenance**.
|
||||
> 2026-10-28; v1.1.0 live, confirmed on the listing 2026-11-06; v1.2.0 live,
|
||||
> confirmed on the listing 2026-11-10; v1.2.1 released on GitHub 2026-11-10,
|
||||
> ⚠️ not yet submitted).
|
||||
> Phases 0–9 are complete; the project is in **maintenance**.
|
||||
> That changes the rules of the game:
|
||||
>
|
||||
> - Every change now reaches installed users through a store review. It needs a
|
||||
@@ -32,7 +34,7 @@ This file is the entry point; the `docs/` suite is the specification.
|
||||
| docs/03_DATA_FLOW.md | Import/export/edit pipelines, state machine |
|
||||
| docs/04_FILE_FORMATS.md | Netscape HTML / BM JSON / CSV / Markdown specs |
|
||||
| docs/05_ALGORITHMS.md | Parser walk, normalize, dedupe, diff, write queue |
|
||||
| docs/06_UI.md | Tokens, layouts per tab, component inventory, a11y |
|
||||
| docs/06_UI.md | Tokens, layouts per tab, component inventory, a11y (§5 is the spec behind `/ACCESSIBILITY.md`) |
|
||||
| docs/07_I18N.md | chrome.i18n vs runtime store split, EN/VI/JA rules |
|
||||
| docs/08_MV3_COMPLIANCE.md | Manifest, permissions (bookmarks+storage ONLY), CWS rules |
|
||||
| docs/09_SECURITY_PRIVACY.md | Threat model T1–T8, secure-coding bans |
|
||||
@@ -51,9 +53,11 @@ This file is the entry point; the `docs/` suite is the specification.
|
||||
The canonical gate is docs/08 §3, run as `npm run guard`.
|
||||
4. `src/lib/core/` never imports browser APIs, Svelte, or `src/lib/browser`.
|
||||
5. Files ≤300 lines (hard 500); functions ≤50 (hard 80).
|
||||
6. Every string user-visible ⇒ i18n key in en+vi+ja (en is schema; vi/ja
|
||||
`satisfies Dict`, where `Dict = typeof dict` is exported from
|
||||
`locales/en.ts`). **Never `as const` on a locale file** — docs/07 §2.
|
||||
6. Every string user-visible ⇒ i18n key in **every shipped locale** — `LOCALES`
|
||||
in `src/lib/i18n/resolve-locale.ts`: en, vi, ja, zh-CN, ro (en is schema;
|
||||
the others `satisfies Dict`, where `Dict = Localized<typeof dict>` is
|
||||
exported from `locales/en.ts`). **Never `as const` on a locale file** —
|
||||
docs/07 §2. Romanian plural keys carry a third form, `few` (docs/07 §5).
|
||||
7. TypeScript strict; no `any`; casts need `// SAFETY:` comments.
|
||||
8. Conventional Commits; `npm run verify` green before every commit — and
|
||||
**`npm run verify:full` before anything release-bearing**. `verify` omits
|
||||
@@ -154,6 +158,51 @@ checksum-verified zip). Still human-only: the docs/11 §5 manual pass on real
|
||||
Chrome including the **1.0.1 → 1.1.0 upgrade over an existing profile** ⚠️,
|
||||
then the zip uploaded to the store ⚠️.
|
||||
|
||||
### Phase 8 — v1.2.0: Simplified Chinese and Romanian
|
||||
Real installs in Chinese and Romanian browsers (CWS dashboard) made two UI
|
||||
languages the next minor. In order: docs first (`07` gains §6 "Adding a
|
||||
locale") → one `LOCALES` list and a third plural form (`few`), with no new
|
||||
language yet → `zh-CN` → `ro` → manifest `_locales`, store listings, the
|
||||
translation form, the screenshot harness → visual sweep in both languages and
|
||||
an adversarial review of code *and* translations → 1.2.0. Both ship
|
||||
best-effort (`TODO(review-zh)`, `TODO(review-ro)`). A Traditional Chinese
|
||||
browser on "Automatic" gets English.
|
||||
**Exit:** ✔ v1.2.0 tagged and released 2026-11-06 (signed tag on `e2f36bc`,
|
||||
checksum-verified zip). A finding worth keeping: on this Windows machine the
|
||||
process-spawning script tests time out intermittently under load (`main`'s
|
||||
too), so CI — whose Windows smoke job passed — was the gate.
|
||||
✔ Live on the store, confirmed on the listing 2026-11-10 (5 languages).
|
||||
Human-only ⚠️, still open: the native review passes, and `13 §1b` step 10 —
|
||||
the published build installed on a clean profile — which has no recorded
|
||||
result for any version.
|
||||
|
||||
### Phase 9 — v1.2.1: accessibility
|
||||
The owner's keyboard-only and Narrator pass over 1.2.0 found nothing; an audit
|
||||
of `src/` then found what such a pass cannot see. In order: dependency sync
|
||||
after Dependabot (the `biome.json` `$schema` and `docs/01` do **not** move
|
||||
with its PRs) → docs first (`06 §5`) → `ACCESSIBILITY.md` at the repository
|
||||
root with its intake (issue form, PR checklist, `accessibility@`) → the fixes:
|
||||
a focus ring that was drawn in the colour of the fill under it, forced-colours
|
||||
support, Alt+↑/↓ to reorder (through the drag's own `planDrop`), focus that
|
||||
fell to `<body>` in three places, 24 px targets, an About link to the
|
||||
statement → adversarial review → 1.2.1.
|
||||
Two things to carry forward. **`ACCESSIBILITY.md` is a public promise**: a UI
|
||||
change that makes its key table or its known-limitations list false has to
|
||||
change the file in the same PR (`11 §5` has the check). And the statement's
|
||||
goal is WCAG 2.2 AA **as a goal** — never write "conforms" or "compliant"
|
||||
without an audit to cite. The review found the first draft of the statement
|
||||
overclaiming in nine places ("every clickable target", "nothing times out"):
|
||||
check each sentence of it against the source, not against the intention.
|
||||
A third: **code moved out of a component starts counting.** SonarCloud's
|
||||
new-code gate (80 %) failed the first push because the live-sync wiring left
|
||||
`EditTab` for a `.ts` module with no test. Extracting to stay under a size
|
||||
limit is half the job; the test is the other half.
|
||||
**Exit:** ✔ v1.2.1 tagged and released 2026-11-10 (signed tag on `d61318a`,
|
||||
checksum-verified zip). Human-only ⚠️: the `11 §5` pass with the
|
||||
**1.2.0 → 1.2.1 upgrade over an existing profile**, a real Windows contrast
|
||||
theme and a screen-reader pass over Alt+↑/↓, the zip upload, and the native
|
||||
review of the two new strings.
|
||||
|
||||
## Working style
|
||||
|
||||
- Small commits per module; tests land with (or before) implementation.
|
||||
|
||||
+54
-11
@@ -7,6 +7,11 @@ stop reading here — the forms ask for what is needed.
|
||||
|
||||
Security problems go through [`SECURITY.md`](SECURITY.md), never a public issue.
|
||||
|
||||
If something is hard or impossible to use — with a keyboard, a screen reader, a
|
||||
contrast theme, zoom — that is a defect, and it has its own form.
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md) says what is already known and how a
|
||||
report is handled.
|
||||
|
||||
## Reporting a bookmark file that will not import
|
||||
|
||||
This is the most valuable report this project gets, because a sample becomes a
|
||||
@@ -51,8 +56,9 @@ Anything you attach to a GitHub issue is public and permanent; see
|
||||
|
||||
You do not need to clone anything. Use the translation issue form: the language,
|
||||
where the text appears, what it says now, and what it should say. Vietnamese is
|
||||
reviewed by the maintainer; **Japanese is best-effort until a native pass**, so
|
||||
JA corrections are especially welcome.
|
||||
reviewed by the maintainer; **Japanese, Simplified Chinese and Romanian are
|
||||
best-effort until a native pass**, so corrections in those three are especially
|
||||
welcome.
|
||||
|
||||
One constraint if you send the change yourself: placeholders like `{n}` or
|
||||
`{name}` must appear in the translation exactly as in English — same names, same
|
||||
@@ -60,7 +66,7 @@ count. A build gate enforces it.
|
||||
|
||||
## Setting up to write code
|
||||
|
||||
Node **24 or newer** (see `.nvmrc`).
|
||||
Node **26 or newer** (see `.nvmrc`).
|
||||
|
||||
```bash
|
||||
npm ci
|
||||
@@ -101,13 +107,41 @@ so they are not style preferences:
|
||||
- `src/lib/core/` is pure: it imports nothing from `browser/`, `stores/`, Svelte
|
||||
or `chrome.*`.
|
||||
- Files stay under 300 lines (hard limit 500), functions under 50 (hard 80).
|
||||
- Every user-visible string is an i18n key present in **all three** locales.
|
||||
- Every user-visible string is an i18n key present in **every** locale (en, vi,
|
||||
ja, zh-CN, ro — `LOCALES` in `src/lib/i18n/resolve-locale.ts`).
|
||||
|
||||
[`CLAUDE.md`](CLAUDE.md) is the entry point and [`docs/`](docs/) is the binding
|
||||
specification — **where code and docs disagree, the docs win.** A behaviour
|
||||
change that skips its doc leaves the spec lying, which is why the PR checklist
|
||||
asks about it.
|
||||
|
||||
## Changing the interface
|
||||
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md) tells users what works; `docs/06 §5`
|
||||
is the specification behind it. A change to a component has to keep both true:
|
||||
|
||||
- **Keyboard.** Whatever a pointer can do, a key can do. A control that is not
|
||||
a tab stop on purpose (the tree's row buttons) has its key documented.
|
||||
- **Focus.** Always visible — check it on a control with a filled background,
|
||||
where the default ring can vanish into the fill — and never dropped: when
|
||||
the focused thing goes away, focus is put somewhere deliberate
|
||||
(`src/lib/components/focus-heading.ts` has the helpers).
|
||||
- **Names.** Icons are decorative; the control carries the name. Anything a
|
||||
screen reader speaks is an i18n key in every locale.
|
||||
- **Not colour alone, not motion.** A state shown by a fill or a shadow needs
|
||||
a `forced-colors` equivalent; anything that moves sits behind
|
||||
`prefers-reduced-motion: no-preference`. Tests enforce the second
|
||||
(`tests/unit/styles/motion.test.ts`) and hold the list for the first
|
||||
(`forced-colors.test.ts`).
|
||||
- **Native first.** A `<button>`, a `<dialog>`, a `<fieldset>` before an ARIA
|
||||
role. A role is a promise of that role's keyboard behaviour: the previews
|
||||
lost `role="tree"` because they did not have the arrow keys.
|
||||
- **Try it.** Unplug the mouse, then run one screen reader over the screen you
|
||||
changed. Say in the PR which one, or that you could not.
|
||||
|
||||
There is no component test framework here, so logic that can leave a component
|
||||
does, and is tested where it lands (`src/lib/edit/`, `src/lib/stores/`).
|
||||
|
||||
## Turning a reported file into a regression test
|
||||
|
||||
The full ritual, in order, because it is easy to do four fifths of it:
|
||||
@@ -134,17 +168,26 @@ a real regression into a passing test.
|
||||
|
||||
## Translations, in code
|
||||
|
||||
`src/lib/i18n/locales/en.ts` is the schema; `vi.ts` and `ja.ts` are typed
|
||||
`satisfies Dict` against it, so a missing key is a compile error.
|
||||
`src/lib/i18n/locales/en.ts` is the schema; every other locale (`vi.ts`,
|
||||
`ja.ts`, `zh-CN.ts`, `ro.ts`, each with its `-notices` and `-import` parts) is
|
||||
typed `satisfies Dict` against it, so a missing key is a compile error.
|
||||
|
||||
**Never add `as const` to `en.ts`.** It would make `Dict` a tree of string
|
||||
*literal* types, and every correct translation would become a type error — the
|
||||
only way to make the build pass would be leaving VI and JA in English.
|
||||
only way to make the build pass would be leaving every other locale in English.
|
||||
|
||||
Four gates run on every change: identical key paths across the three locales,
|
||||
identical interpolation tokens per string, no empty leaves, and plural keys
|
||||
carrying exactly `{one, other}` everywhere. See `docs/07` for register and tone
|
||||
(VI: neutral-friendly, "bạn"; JA: です/ます with katakana loanwords).
|
||||
The gates that run on every change:
|
||||
- identical key paths across the locales;
|
||||
- identical interpolation tokens per string;
|
||||
- no empty leaves;
|
||||
- plural keys carrying exactly the forms the language needs: `{one, other}`
|
||||
everywhere, plus `few` in Romanian ("1 marcaj", "5 marcaje", "20 de
|
||||
marcaje");
|
||||
- language names written as endonyms, identical in every dictionary;
|
||||
- for Romanian, comma-below `ș ț` only, never the cedilla look-alikes.
|
||||
|
||||
See `docs/07` for register and tone in each language. Adding a whole new
|
||||
language has its own checklist: `docs/07 §6`.
|
||||
|
||||
## Commits and pull requests
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Move your bookmarks between browsers the simple way: with a file. No account,
|
||||
no cloud sync, 100% offline.
|
||||
|
||||
A Chrome (MV3) extension for importing, exporting and editing bookmarks and
|
||||
folder trees. English · Tiếng Việt · 日本語.
|
||||
folder trees. English · Tiếng Việt · 日本語 · 简体中文 · Română.
|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -45,6 +45,17 @@ from anyone's real profile.
|
||||
A→Z, create folders, delete, and find duplicate links — every action
|
||||
reachable from the keyboard.
|
||||
|
||||
## Accessibility
|
||||
|
||||
Everything works without a mouse, a screen reader is told what is on screen
|
||||
and what an import did, contrast themes and reduced motion are respected, and
|
||||
the page declares the language you chose. The goal is WCAG 2.2 AA; it is a
|
||||
goal, not a claim — nobody has audited it.
|
||||
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md) has the detail: the keys, what was
|
||||
tested and with which screen reader, what is known not to work well yet, and
|
||||
how to report a barrier.
|
||||
|
||||
## Privacy
|
||||
|
||||
This is the whole point of the project, so it is worth being precise.
|
||||
@@ -148,6 +159,7 @@ a public issue.
|
||||
|---|---|
|
||||
| Security vulnerabilities (if you have no GitHub account) | security@poli0981.dev |
|
||||
| Privacy questions, removing a sample you sent | privacy@poli0981.dev |
|
||||
| An accessibility barrier (if you have no GitHub account) | accessibility@poli0981.dev |
|
||||
| The terms (EULA, disclaimer) | legal@poli0981.dev |
|
||||
| Licensing and permission questions | copyright@poli0981.dev |
|
||||
| Formal copyright (DMCA) notices | dmca@poli0981.dev |
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.6.2/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.6.4/schema.json",
|
||||
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
|
||||
"files": {
|
||||
"ignoreUnknown": true,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 75 KiB |
+54
-13
@@ -17,18 +17,27 @@
|
||||
> 5 users) on 2026-10-28. ⚠️ The exact approval date was never recorded — the
|
||||
> owner can read it from the dashboard. Installed users are on 1.0.1.
|
||||
>
|
||||
> **v1.1.0 is RELEASED on GitHub, not yet on the store.** Tagged and
|
||||
> released 2026-10-29 (signed tag on `9040f84`, checksum-verified zip). ⚠️ It
|
||||
> still needs the owner's manual pass on real Chrome, including the 1.0.1 →
|
||||
> 1.1.0 upgrade over an existing profile, and a hand upload to the store
|
||||
> (`13 §1b`); until it clears review, installed users stay on 1.0.1. It raises
|
||||
> the floor to Chrome 136 (`08 §7`); permissions are unchanged.
|
||||
> **v1.1.0 is PUBLISHED.** Tagged and released 2026-10-29 (signed tag on
|
||||
> `9040f84`, checksum-verified zip); the listing showed version 1.1.0 on
|
||||
> 2026-11-06. It raised the floor to Chrome 136 (`08 §7`); permissions are
|
||||
> unchanged.
|
||||
>
|
||||
> **v1.2.0 is PUBLISHED.** Tagged and released 2026-11-06 (signed tag on
|
||||
> `e2f36bc`); the listing was observed showing **version 1.2.0** (`Updated:
|
||||
> November 7, 2026`, 5 languages) on 2026-11-10. Installed users are on 1.2.0.
|
||||
>
|
||||
> **v1.2.1 — accessibility — is RELEASED on GitHub, not yet on the store.**
|
||||
> Tagged and released 2026-11-10 (signed tag on `d61318a`, checksum-verified
|
||||
> zip): an accessibility statement (`/ACCESSIBILITY.md`) and the fixes an
|
||||
> audit found (`06 §5`). ⚠️ It still needs the owner's manual pass, including
|
||||
> the 1.2.0 → 1.2.1 upgrade over an existing profile, and a hand upload to
|
||||
> the store (`13 §1b`); until it clears review, installed users stay on 1.2.0.
|
||||
>
|
||||
> The project is now in **maintenance**, not construction: every change from
|
||||
> here reaches installed users through a store review, so it needs a version
|
||||
> bump, a CHANGELOG entry and an update submission (`13 §1b`). Sequencing lives
|
||||
> in `/CLAUDE.md`; what is still open is in §10 below.
|
||||
> **Doc suite version:** 1.9 (2026-10-29 — v1.1.0 released on GitHub)
|
||||
> **Doc suite version:** 1.11 (2026-11-10 — v1.2.1 released on GitHub)
|
||||
|
||||
---
|
||||
|
||||
@@ -111,6 +120,11 @@ v1.0's scope):
|
||||
- A redesigned UI with a self-drawn icon set, all motion behind
|
||||
`prefers-reduced-motion` (`06`).
|
||||
|
||||
**v1.2.0 adds** two UI languages, chosen from the CWS dashboard's install and
|
||||
usage figures: **Simplified Chinese (`zh-CN`) and Romanian (`ro`)** — in the
|
||||
app, in the manifest and in the store listing (`07`). Traditional Chinese is
|
||||
not shipped; a Traditional Chinese browser on "Automatic" gets English.
|
||||
|
||||
## 7. Non-goals (v1.0)
|
||||
|
||||
- ❌ Cloud sync, accounts, or any server component.
|
||||
@@ -148,7 +162,7 @@ Derived identifiers (canonical across docs and code):
|
||||
|
||||
| Context | Value |
|
||||
|---|---|
|
||||
| Manifest / store / UI name | `BookmarkMagic` (identical in EN/VI/JA) |
|
||||
| Manifest / store / UI name | `BookmarkMagic` (identical in every locale) |
|
||||
| Repo slug | `poli0981/bookmarkmagic` ✔ |
|
||||
| Own JSON schema | "BM JSON v1", `"format": "bookmarkmagic"` |
|
||||
| Code prefix | `Bm*` (`BmParseError`, `BmAborted`) |
|
||||
@@ -222,14 +236,41 @@ Derived identifiers (canonical across docs and code):
|
||||
open: the exact approval date, and `13 §1b` step 10 against the published
|
||||
build (install on a clean profile, re-run the upgrade check) — no result is
|
||||
recorded for either.
|
||||
12. ⚠️ **v1.1.0 to the store.** The GitHub Release exists and is verified
|
||||
(`15`'s progress table). Still human-only: the `11 §5` manual pass on real
|
||||
Chrome — the **1.0.1 → 1.1.0 upgrade over an existing profile** above all —
|
||||
then the hand upload of the Release zip (`13 §1b`), with new screenshots
|
||||
chosen from `store/screenshots/`. Also unverified outside the harness: the
|
||||
12. ✔ **v1.1.0 cleared review** — the listing showed 1.1.0 ("Updated October
|
||||
29, 2026", 6 users, 3 languages) when checked on 2026-11-06. ⚠️ Still
|
||||
open, as for 1.0.1: `13 §1b` step 10 against the published build — no
|
||||
result is recorded. Also unverified outside the harness: the
|
||||
account-storage roots of a signed-in profile and the hidden empty Mobile
|
||||
root (`02 §4`), and the `MAX_WRITE_DEPTH` rationale against a real Chrome.
|
||||
|
||||
### v1.2.0 (added 2026-11-06)
|
||||
|
||||
13. ⚠️ **ZH-CN and RO native review passes.** Both locales ship best-effort
|
||||
(`07 §4`), written from Chrome's own terminology in each language but read
|
||||
by no native speaker. Each file's header carries `TODO(review-zh)` /
|
||||
`TODO(review-ro)`. The `translation` issue form lists both languages.
|
||||
14. ✔ **v1.2.0 to the store** — live, observed 2026-11-10 (version 1.2.0,
|
||||
`Updated: November 7, 2026`, 5 listing languages). ⚠️ Still unrecorded, as
|
||||
for 1.0.1 and 1.1.0: `13 §1b` step 10, the clean-profile install of the
|
||||
published build and the upgrade re-check against it.
|
||||
|
||||
### v1.2.1 (added 2026-11-10)
|
||||
|
||||
15. ⚠️ **v1.2.1 to the store.** The GitHub Release exists and is verified
|
||||
(`15`'s progress table). The usual `11 §5` pass plus the **1.2.0 →
|
||||
1.2.1 upgrade over an existing profile**, then the Release zip uploaded in
|
||||
the dashboard. No listing change: a patch (`13 §5`).
|
||||
16. ⚠️ **The accessibility checks no script can run** (`11 §5`): a Windows
|
||||
contrast theme over the tree, the tabs, the theme control and a running
|
||||
import; a screen-reader pass over Alt+↑/↓ (does the new position get
|
||||
spoken, once); 200 % zoom. The fixes were verified in a headless Chrome
|
||||
with `forced-colors` emulated, which is not the same as a real theme.
|
||||
17. ⚠️ **Other screen readers.** `ACCESSIBILITY.md` says Narrator with Chrome
|
||||
on Windows 11 was tested and NVDA, JAWS, VoiceOver and ChromeVox were not.
|
||||
Any pass with one of those moves it from the second list to the first.
|
||||
18. ⚠️ **Native review of the new strings** — the About link label and the
|
||||
spoken position — in JA, ZH-CN and RO, with the passes in items 9 and 13.
|
||||
|
||||
## 11. Reading order
|
||||
|
||||
For humans: this file → `15_ROADMAP.md` → the rest as needed.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 01 — Tech Stack
|
||||
|
||||
> Versions verified against npm/official sources on **2026-10-28** (first pass
|
||||
> Versions verified against npm/official sources on **2026-11-10** (first pass
|
||||
> 2026-07-25).
|
||||
> Rule: latest stable or LTS only, with any deliberate exception stated inline.
|
||||
> Re-verify minor/patch at scaffold time (`npm outdated`), but do NOT jump
|
||||
@@ -20,17 +20,17 @@
|
||||
|---|---|---|
|
||||
| Node.js | **26.x (Active LTS)** (was 24.x through v1.0.1) | Build runtime. Node 26 entered Active LTS on 2026-10-28 (maintenance from 2027-10-20, end of life 2029-04-30); Node 24 moved to maintenance on 2026-10-20. `.nvmrc`, `engines` and every CI job say 26 — CI reads `.nvmrc` where it can, and passes `'26'` to the ops reusable, which takes a string input. |
|
||||
| npm | bundled with Node 26 (v11.20+) | Package manager. Commit `package-lock.json`. `.npmrc` sets `min-release-age=7` (§6). |
|
||||
| **WXT** | **^0.21.4** (was ^0.20.27 through v1.0.0) | Extension framework: entrypoints, manifest generation, HMR, `wxt zip`, `wxt submit`. **0.x, so a minor is semver's breaking slot** — and 0.21 was: `wxt/testing` split into `wxt/testing/fake-browser` and `wxt/testing/vitest-plugin`, and `tabs.create` is now typed as returning `void`. Both are dev-only. Never take a WXT bump without diffing the **built** manifest before and after (`12 §2.3`); `tests/unit/manifest.test.ts` reads `wxt.config.ts` and is structurally incapable of noticing. |
|
||||
| **WXT** | **^0.21.5** (was ^0.20.27 through v1.0.0) | Extension framework: entrypoints, manifest generation, HMR, `wxt zip`, `wxt submit`. **0.x, so a minor is semver's breaking slot** — and 0.21 was: `wxt/testing` split into `wxt/testing/fake-browser` and `wxt/testing/vitest-plugin`, and `tabs.create` is now typed as returning `void`. Both are dev-only. Never take a WXT bump without diffing the **built** manifest before and after (`12 §2.3`); `tests/unit/manifest.test.ts` reads `wxt.config.ts` and is structurally incapable of noticing. |
|
||||
| **TypeScript** | **7.0 for `tsc`, 6.0 for the API** (strict) | Two packages under two names, Microsoft's documented side-by-side setup for toolchains that embed the compiler: `"@typescript/native": "npm:typescript@~7.0.2"` provides the `tsc` binary (the Go-native 7.0 compiler that type-checks every `.ts` file in `npm run check`), and `"typescript": "npm:@typescript/typescript6@~6.0.2"` keeps the TS 6.0 programmatic API under the `typescript` module name (it re-exports the real `typescript@6.0.x` and adds a `tsc6` binary). svelte-check (peer `typescript ^5 || ^6`) and Volar need that API — TS 7 has none until 7.1 — so `.svelte` files are checked by 6.0 and `.ts` files by both. `tsc --version` must say 7.x and `tsc6 --version` 6.x. Drop the alias when svelte-check declares TS 7 support. Both pinned `~` (patch-only). |
|
||||
| **Svelte** | **^5.57.2** | UI, runes mode only (`$state`, `$derived`, `$effect`, `$props`). The compiled runtime ships in the bundle (MIT — `legal/THIRD_PARTY_NOTICES.md`). |
|
||||
| **Svelte** | **^5.57.3** | UI, runes mode only (`$state`, `$derived`, `$effect`, `$props`). The compiled runtime ships in the bundle (MIT — `legal/THIRD_PARTY_NOTICES.md`). |
|
||||
| @sveltejs/vite-plugin-svelte | ^7.3.1 | Compiles `.svelte` and the runes in `.svelte.ts` stores for Vitest (`vitest.config.ts`). Its `deepmerge` dependency carries the one advisory with no fix (`09 §3.1`). |
|
||||
| @wxt-dev/module-svelte | ^2.0.5 | WXT ↔ Svelte integration. |
|
||||
| **Biome** | **2.6.2 (pinned exact)** | Lint + format (replaces ESLint + Prettier). Install with `npm i -D -E @biomejs/biome` per Biome guidance. 2.6 started formatting Markdown and YAML; both are excluded in `biome.json` so docs and workflows keep their hand layout (`10 §3`). |
|
||||
| svelte-check | ^4.7.7 | Type/template authority for `.svelte` files. Runs on the TS 6 API (see TypeScript above). |
|
||||
| **Biome** | **2.6.4 (pinned exact)** | Lint + format (replaces ESLint + Prettier). Install with `npm i -D -E @biomejs/biome` per Biome guidance. 2.6 started formatting Markdown and YAML; both are excluded in `biome.json` so docs and workflows keep their hand layout (`10 §3`). The `$schema` URL in `biome.json` names the same version and moves with the pin — Dependabot bumps the package and leaves the URL behind. |
|
||||
| svelte-check | ^4.7.8 | Type/template authority for `.svelte` files. Runs on the TS 6 API (see TypeScript above). |
|
||||
| **@types/node** | **^26** (matches the Node major) | Types for `node:fs`, `node:path`, `node:child_process` and `process`, which the test suite and `scripts/*.mjs` genuinely use. **Declared explicitly since 2026-08-03** — it used to arrive transitively, and WXT 0.21 stopped providing it. Types only: erased at build, so hard rule 2 (zero *runtime* dependencies) is untouched. |
|
||||
| jsdom | **^30.1** (was ^29 through v1.0.0) | Test DOM. Not interchangeable — `02 §3` picks jsdom over happy-dom because the Netscape walk depends on parse5's implied-end-tag behaviour. A major bump runs `tests/unit/dom-environment.test.ts` first; if that canary fails, pin rather than loosen the test. |
|
||||
| **Knip** | **^6** (6.42.1 as of 2026-10) | Dead code: unused files, exports, dependencies. Requires Node ≥ 20.19. v6 swapped the TypeScript backend for oxc-parser — confirm `compilers.svelte` is still the supported `.svelte` hook before scaffold (`10 §4`). |
|
||||
| **Vitest** | **^5.0.5** (was ^4 through v1.0.1) | Unit tests. 5.0 changed `clearMocks` to default `true`, requires `vi.mock` at top level and fails unawaited async assertions; the suite needed no changes. Requires Node ≥ 22.12. |
|
||||
| **Knip** | **^6** (6.44.1 as of 2026-11) | Dead code: unused files, exports, dependencies. Requires Node ≥ 20.19. v6 swapped the TypeScript backend for oxc-parser — confirm `compilers.svelte` is still the supported `.svelte` hook before scaffold (`10 §4`). |
|
||||
| **Vitest** | **^5.1.0** (was ^4 through v1.0.1) | Unit tests. 5.0 changed `clearMocks` to default `true`, requires `vi.mock` at top level and fails unawaited async assertions; the suite needed no changes. Requires Node ≥ 22.12. |
|
||||
| @vitest/coverage-v8 | match Vitest | Coverage reporting (`text` + `lcov` for SonarCloud, `12 §2.5`). |
|
||||
|
||||
## 3. Explicitly rejected
|
||||
@@ -63,7 +63,7 @@
|
||||
"dev:firefox": "wxt -b firefox", // build sanity only, no store release
|
||||
"build": "wxt build",
|
||||
"zip": "wxt zip",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && tsc --noEmit && tsc -p tsconfig.scripts.json",
|
||||
// TS 6 API, the TS 7 tsc, then scripts/*.mjs via checkJs
|
||||
"lint": "biome check .",
|
||||
"lint:fix": "biome check --write .",
|
||||
|
||||
@@ -58,10 +58,14 @@ bookmarkmagic/
|
||||
│ └── sanitize/ # its format modules: detect, mappers, spans, html, json, csv, leaks
|
||||
├── docs/ # this suite (00–15)
|
||||
├── legal/ # EULA.md, DISCLAIMER.md, PRIVACY.md, THIRD_PARTY_NOTICES.md
|
||||
├── README.md / CHANGELOG.md # what users read; CHANGELOG is linked from #about
|
||||
├── ACCESSIBILITY.md # the accessibility statement (06 §5), linked from #about
|
||||
├── CONTRIBUTING.md / SECURITY.md / CODE_OF_CONDUCT.md
|
||||
├── .github/ # issue forms, PR template, workflows (12), dependabot, FUNDING
|
||||
├── src/
|
||||
│ ├── public/
|
||||
│ │ ├── icon/ # 16/32/48/128 png
|
||||
│ │ ├── _locales/{en,vi,ja}/messages.json # manifest-level strings only
|
||||
│ │ ├── _locales/{en,vi,ja,zh_CN,ro}/messages.json # manifest-level strings only (07 §1)
|
||||
│ │ └── THIRD_PARTY_NOTICES.txt # MIT notices for what the build compiles in (14 §5)
|
||||
│ ├── entrypoints/
|
||||
│ │ ├── popup/ # index.html + App.svelte + main.ts
|
||||
@@ -126,12 +130,13 @@ bookmarkmagic/
|
||||
│ │ │ ├── import-session.svelte.ts
|
||||
│ │ │ ├── edit-view.svelte.ts # #edit: what the tree shows (03 §3)
|
||||
│ │ │ ├── edit-commands.svelte.ts # #edit: single-item writes, extends the view
|
||||
│ │ │ └── edit-session.svelte.ts # #edit: duplicates + bulk commands, extends both
|
||||
│ │ │ ├── edit-session.svelte.ts # #edit: duplicates + bulk commands, extends both
|
||||
│ │ │ └── edit-live.ts # #edit: subscribes a session to the browser's events (03 §3)
|
||||
│ │ ├── i18n/ # runtime UI i18n (see 07_I18N.md)
|
||||
│ │ │ ├── index.svelte.ts
|
||||
│ │ │ ├── format.ts # pure Intl number/date helpers (07 §3)
|
||||
│ │ │ ├── resolve-locale.ts
|
||||
│ │ │ └── locales/{en,vi,ja}{,-notices,-import}.ts # split by namespace (07 §2)
|
||||
│ │ │ └── locales/{en,vi,ja,zh-CN,ro}{,-notices,-import}.ts # split by namespace (07 §2)
|
||||
│ │ └── components/ # Svelte components (see 06_UI.md); icons/Icon.svelte,
|
||||
│ │ # focus-heading.ts (the step-heading focus attachment)
|
||||
│ └── styles/
|
||||
|
||||
@@ -190,7 +190,7 @@ tree key was ignored.
|
||||
|---|---|
|
||||
| Search | input (debounced 150 ms) → core filter on title+URL → tree shows matches with ancestors expanded; a folder the user collapses during the search stays collapsed until the search text changes |
|
||||
| Rename | F2 or the row button → inline input, focused with its text selected; Enter or blur commits, Esc cancels (a blur after Esc does not commit), and after Enter or Esc focus returns to the tree → trimmed; blank or unchanged → nothing; else `bookmarks.update(id, { title })` |
|
||||
| Move | drag & drop onto a row — before, after or into (`planDrop`, `05 §10`) → `bookmarks.move(id, { parentId, index })`, or `{ parentId }` alone into a folder; "Move to…" (row button, menu key / Shift+F10) → modal folder list with a filter → `bookmarks.move(id, { parentId })`, appended |
|
||||
| Move | drag & drop onto a row — before, after or into (`planDrop`, `05 §10`) → `bookmarks.move(id, { parentId, index })`, or `{ parentId }` alone into a folder; "Move to…" (row button, menu key / Shift+F10) → modal folder list with a filter → `bookmarks.move(id, { parentId })`, appended; **Alt+↑ / Alt+↓** on the tree (since v1.2.1) → `nudgeTarget` picks the sibling shown above or below, then the same `planDrop` (before / after) and the same `moveTo` as a drag — no second write path. One move at a time. The command reports the row's new place among the siblings on screen — the same "n of m" as its `aria-posinset` — which the tab speaks (`06 §5`) |
|
||||
| Delete | Del or the row button → confirm dialog (folder shows descendant count) → `removeTree` / `remove`; when the deleted row had focus, focus moves to the next row, else the previous. A copy deleted from the duplicate panel leaves the tree's focus where it was |
|
||||
| New folder | toolbar button → `bookmarks.create({ parentId, title })` in the focused folder, beside a focused bookmark, else in the first writable root → inserted at once unless its live event got there first (Chrome fires `onCreated` before `create` resolves, so either may win), a search that would hide it cleared, and every folder above it opened as the user's own — so clearing the search cannot close them again → inline rename |
|
||||
| Sort A→Z | toolbar (the focused folder, or the focused bookmark's folder) or a folder row's button → `planSort` (`05 §10`) → confirm stating how many items move → one awaited `bookmarks.move(id, { parentId, index })` per planned move, yielding every 25, under the write lock (§5). Refused part-way → "moved d of t" and a re-read: there is no undo |
|
||||
@@ -228,7 +228,7 @@ no longer silently stop the tree following the browser.
|
||||
lost from 200 ms to roughly nothing — not to zero.
|
||||
- Legal gate: on Manager mount read `legal.acceptedVersion`; if
|
||||
`< LEGAL_VERSION` render `<LegalGate>` overlay blocking **#import / #export /
|
||||
#edit** — **#settings and #about stay reachable**, so a VI/JA user can switch
|
||||
#edit** — **#settings and #about stay reachable**, so a non-English user can switch
|
||||
language (and theme) before reading the notice and the gate needs no language
|
||||
switcher of its own. Accept → write version + timestamp → unlock.
|
||||
This three-route set is normative; `14 §2` states the same list.
|
||||
|
||||
@@ -392,6 +392,46 @@ destination. Asserted in `move-target.test.ts` (both index spaces, cross-folder,
|
||||
into a bookmark refused, beside itself, beside a root) and, against the
|
||||
in-memory fake, in `edit-session.test.ts`.
|
||||
|
||||
**Keyboard reorder** (Alt+↑ / Alt+↓, since v1.2.1) adds no planner. It picks a
|
||||
target row and a zone, and `planDrop` does the rest:
|
||||
|
||||
```
|
||||
nudgeTarget(rows, id, direction): // rows: the visible rows, in order; direction: -1 | +1
|
||||
row = the row for id; none if absent
|
||||
siblings = rows with row.parentId, in order // the VISIBLE ones: under a search, only matches
|
||||
neighbour = siblings[index of row + direction]; none at either end
|
||||
return neighbour.id
|
||||
|
||||
nudge(id, direction):
|
||||
a nudge already in flight → nothing // a held key repeats faster than a move completes
|
||||
target = nudgeTarget(rows, id, direction); none → nothing
|
||||
plan = planDrop(roots, id, target, direction < 0 ? 'before' : 'after'); none → nothing
|
||||
moveTo(id, plan); refused → nothing
|
||||
row = the row for id, as it is now
|
||||
return { position: row.posInSet, total: row.setSize } // among the siblings ON SCREEN
|
||||
```
|
||||
|
||||
Visible siblings, not all of them, because that is what a drag does too: the
|
||||
user places the item relative to a row they can see. Under a search that has
|
||||
a consequence: the row passes its visible neighbour **and every hidden item
|
||||
between them**, so down-then-up restores what is on screen but not
|
||||
necessarily the hidden order. The place it reports is the visible one too —
|
||||
the same "n of m" the row's `aria-posinset`/`aria-setsize` give — so what is
|
||||
spoken and what the tree says cannot disagree. A permanent root has no
|
||||
`parentId` that `planDrop` accepts, so it never moves.
|
||||
|
||||
One at a time, because each plan is made from the optimistic tree: a second
|
||||
plan made before the first move has landed is made from a tree that is about
|
||||
to change. A residue is known and unfixed: the first move's live event can
|
||||
flush a frame after a second press's optimistic patch and roll the row back
|
||||
for that frame; the tree converges once the events drain (`15`, backlog).
|
||||
|
||||
Asserted in `tree-keyboard.test.ts` (ends of a folder, an open neighbour's
|
||||
children stepped over, a filtered list, a root's neighbour) and
|
||||
`edit-session.test.ts` (Chrome's index rule in both directions, a root, a
|
||||
managed node, hidden items under a search, one move at a time, while busy, a
|
||||
refusal).
|
||||
|
||||
## 11. Live-sync batching — `edit/live-sync.ts`
|
||||
|
||||
```
|
||||
|
||||
+113
-16
@@ -305,6 +305,13 @@ Search matches render bold in the accent colour.
|
||||
half. An illegal drop — onto itself, into its own subtree, beside a
|
||||
permanent root, into a managed folder — shows nothing and does nothing; a
|
||||
cancelled drag clears every highlight.
|
||||
- **Alt+↑ / Alt+↓** (since v1.2.1) is the keyboard's before/after: the focused
|
||||
row changes places with the sibling shown above or below it — under a search,
|
||||
the nearest one the search still shows. It is the same `planDrop` a drag
|
||||
resolves through (`05 §10`), so legality is one rule: nothing happens at
|
||||
either end of a folder, on a permanent root, on a policy-managed node or
|
||||
while a bulk command runs. Focus stays on the row, and the new position is
|
||||
spoken (§5).
|
||||
- **Move to…** (`MoveToDialog`, built on `Modal`): a filter box over every
|
||||
folder the item may move into, each as its full path, indented — the item
|
||||
itself, its subtree, its current parent and managed folders left out.
|
||||
@@ -329,12 +336,18 @@ Single column of **six** `<SettingRow>`s: Language · Theme
|
||||
(System/Light/Dark segmented) · Default export format · Default import mode ·
|
||||
CSV delimiter · Markdown layout.
|
||||
|
||||
- The Language select offers **four** options, not three: `Settings.locale` is
|
||||
`'auto' | 'en' | 'vi' | 'ja'` and `DEFAULT_SETTINGS.locale === 'auto'`, so
|
||||
- The Language select offers **six** options — one per shipped locale plus
|
||||
"Automatic": `Settings.locale` is `'auto' | Locale` (`en`, `vi`, `ja`,
|
||||
`zh-CN`, `ro` — `07 §2`) and `DEFAULT_SETTINGS.locale === 'auto'`, so
|
||||
"Automatic (follow the browser)" has to be selectable or the default is
|
||||
unreachable. The three language labels are **endonyms**, identical in all
|
||||
three dictionaries — a Japanese user hunting for Vietnamese looks for
|
||||
"Tiếng Việt".
|
||||
unreachable. The options are built from `LOCALES`, in that order. The
|
||||
language labels are **endonyms**, identical in every dictionary — a Japanese
|
||||
user hunting for Vietnamese looks for "Tiếng Việt", a Romanian one for
|
||||
"Română" — and `dictionaries.test.ts` enforces that they match.
|
||||
- Romanian runs roughly a third longer than English, and Chinese far shorter.
|
||||
Neither may truncate a control, wrap a tab label or push the popup past its
|
||||
340 px width — the visual sweep (`11 §5`) photographs every route in both,
|
||||
and that sweep, not a test, is where overflow is caught.
|
||||
- Markdown layout is the sixth row because `markdownStyle` is a persisted
|
||||
field; without it the only place to change it was a transient `#export`
|
||||
control that never wrote back.
|
||||
@@ -349,7 +362,8 @@ behind a `<ConfirmDialog>` (six preferences is enough to be worth a confirm).
|
||||
### 3.5 #about
|
||||
|
||||
`<AboutCard>`: logo, name, version (from manifest at runtime), tagline;
|
||||
links: **GitHub repo ↗** · Report an issue ↗ · Changelog ↗ · Chrome Web Store ↗;
|
||||
links: **GitHub repo ↗** · Report an issue ↗ · Changelog ↗ · Accessibility ↗ ·
|
||||
Chrome Web Store ↗;
|
||||
**Third-party code:** no runtime dependencies are installed, and the two
|
||||
MIT-licensed pieces the build compiles in are named — the Svelte runtime and
|
||||
WXT's one-line browser shim — with their notices shipped in the package as
|
||||
@@ -372,14 +386,20 @@ releases page until Phase 5 wrote that file — an empty releases page beats a 4
|
||||
opened from a legal surface. `tests/unit/links.test.ts` now pins both the URL
|
||||
shape and the file's existence, so the fallback cannot silently return.)
|
||||
|
||||
"Accessibility" (since v1.2.1) points at `ACCESSIBILITY.md` on `main` — the
|
||||
statement, the full key list and how to report a barrier. Someone who cannot
|
||||
use a screen has no other route from inside the product to either, and the
|
||||
tree's keys are shown nowhere in the UI. The same test pins its URL and the
|
||||
file's existence.
|
||||
|
||||
"Chrome Web Store" points at the published listing (item id in `00 §9`), added
|
||||
once the item went public. It is the only route a user has from inside the
|
||||
product to rate or review it, which `13 §6` depends on.
|
||||
|
||||
**No email address appears anywhere in the product.** Since v1.1.0 the
|
||||
project's addresses are per purpose (`security@` in `SECURITY.md`, `privacy@` in
|
||||
`legal/PRIVACY.md`, the rest in the legal files and the README's contact table;
|
||||
`contact@` is retired), and none of them is inside the extension. An address on
|
||||
`legal/PRIVACY.md`, `accessibility@` in `ACCESSIBILITY.md`, the rest in the
|
||||
legal files and the README's contact table; `contact@` is retired), and none of them is inside the extension. An address on
|
||||
an in-product surface invites users to mail their real bookmark file, and
|
||||
receiving unsanitized personal URLs is exactly what `09` and the privacy policy
|
||||
are written to avoid (`15` decision log, 2026-08-03). `tests/unit/links.test.ts`
|
||||
@@ -438,9 +458,15 @@ held failures at the head of the one queue instead, and every later toast —
|
||||
Home/End; type-ahead by first letter, wrapping. → on an empty folder does
|
||||
nothing, even after "Expand all" put it in the open set. Enter opens a
|
||||
bookmark or toggles a folder; F2 renames; Del asks to delete; the **menu key or
|
||||
Shift+F10** opens "Move to…"; **Ctrl/⌘+C** copies the focused bookmark's
|
||||
link. Ctrl/⌘+F focuses search from anywhere in the tab. Keys typed into the
|
||||
rename input belong to it.
|
||||
Shift+F10** opens "Move to…"; **Alt+↑ / Alt+↓** moves the row one place up
|
||||
or down among its siblings (§3.3); **Ctrl/⌘+C** copies the focused
|
||||
bookmark's link. Ctrl/⌘+F focuses search from anywhere in the tab. Keys
|
||||
typed into the rename input belong to it. `ACCESSIBILITY.md` carries the
|
||||
same list for users, and the About tab links to it — apart from "Ctrl F" on
|
||||
the search box, nothing in the UI shows these keys yet. Tabbing in with
|
||||
nothing focused focuses the first row; a **mouse** press does not (since
|
||||
v1.2.1): the press focuses the list too, and choosing the first row then
|
||||
scrolled a long tree to the top under the pointer.
|
||||
- **Focus never dangles.** A focused row that leaves the screen hands focus to
|
||||
its nearest visible folder (`03 §3`). After a delete, focus goes back where
|
||||
the delete was asked for — the tree, or in the duplicate panel the next
|
||||
@@ -452,6 +478,20 @@ held failures at the head of the one queue instead, and every later toast —
|
||||
change that removes the focused control (confirming the backup) hands focus
|
||||
to the step's heading again. The import's outcome is spoken by one
|
||||
always-present live region (`ImportAnnouncer`).
|
||||
Since v1.2.1 three more places that dropped focus on `<body>` are closed. A
|
||||
**route change** whose control went with the old route ("Open in Edit" on
|
||||
the import report) moves focus to `<main>` — only when focus was lost, and
|
||||
never on the first load. After **"Keep the first of each"** focus lands on
|
||||
the panel's close button, the delete buttons having gone with the copies.
|
||||
After a confirmed **Sort A→Z** from the toolbar — whose button is disabled
|
||||
while the sort runs, which is what dropped it — focus goes to the tree.
|
||||
- **The tree says what Alt+↑/↓ did.** One always-present polite live region in
|
||||
the tab speaks "<title>: position n of m" after each move — n and m being
|
||||
the row's own `aria-posinset` and `aria-setsize`, so under a search they
|
||||
count the siblings on screen, as the tree does. The attributes change too,
|
||||
but a screen reader does not re-read the active descendant for an attribute
|
||||
change, so without the region the move is silent. The region is emptied
|
||||
before each message: set to the text it already holds, it would say nothing.
|
||||
- **Dialogs** (`Modal`): the × is named "Dismiss" — it was named after the
|
||||
dialog, so a screen reader announced the cancel button as "Delete this
|
||||
item?" — and a confirmation's body is its `aria-describedby`, so the counts
|
||||
@@ -459,11 +499,20 @@ held failures at the head of the one queue instead, and every later toast —
|
||||
- **Row buttons are not tab stops** (`tabindex="-1"`; the disclosure is
|
||||
`aria-hidden`). They are mouse shortcuts, and each has a key above — Open
|
||||
(Enter), Copy link (Ctrl+C), Rename (F2), Move to… (menu key), Delete (Del);
|
||||
Sort A→Z is also on the toolbar.
|
||||
- Drag & drop has keyboard parity for **moving into a folder** ("Move to…").
|
||||
Placing an item at an exact position among its siblings — a before/after
|
||||
drop — has **no keyboard equivalent yet**; Sort A→Z is the only keyboard
|
||||
reorder.
|
||||
Sort A→Z is also on the toolbar. **A click on one, or on the chevron, hands
|
||||
focus back to the tree** (since v1.2.1, `focusOwningTree`): Chrome focuses a
|
||||
`tabindex="-1"` button on click, the tree's key handler ignores keys aimed at
|
||||
a row's own control, and so one click used to switch the arrow keys off
|
||||
until the next click on a row. It also means "Move to…" opened from the row
|
||||
button returns focus to the tree, not to a button on a row that has moved.
|
||||
With no row focused yet, the clicked control's row becomes the focused one,
|
||||
so the keys start from where the click was.
|
||||
- Drag & drop has keyboard parity: **into a folder** is "Move to…", and
|
||||
**before/after a sibling** is Alt+↑ / Alt+↓, one place at a time (since
|
||||
v1.2.1; through 1.2.0 Sort A→Z was the only keyboard reorder). What is still
|
||||
missing is a **pointer** route that is not a drag — a click-only way to
|
||||
place an item (WCAG 2.5.7); `ACCESSIBILITY.md` lists it as a known
|
||||
limitation.
|
||||
- **Read-only previews are lists, not trees.** The import preview and the
|
||||
export picker are nested `<ul>`s with disclosure buttons (`aria-expanded`,
|
||||
named "Expand folder: <title>") and, in the picker, checkboxes; plain Tab,
|
||||
@@ -491,6 +540,54 @@ held failures at the head of the one queue instead, and every later toast —
|
||||
in light and both dark variants (§1, enforced by `contrast.test.ts` at token
|
||||
level). Disabled controls say so with colour and the cursor, never opacity,
|
||||
which would drop text under the floor while it still has to be read.
|
||||
- **A ring drawn inside a filled control takes the fill's text colour.** The
|
||||
global ring is `--accent`, outside the control (`outline-offset: 2px`), where
|
||||
it sits on the page. The theme control insets it (`-2px`) to stay inside the
|
||||
group's border — and its selected segment is filled with `--accent`, so
|
||||
through 1.2.0 the ring was accent on accent: invisible, on the one segment
|
||||
roving focus ever lands on. An inset ring on an accent fill is `--accent-fg`
|
||||
(≥ 4.5:1 on `--accent`, already a tested pair), 4px in rather than 2, so
|
||||
the fill shows on both sides of it — at the very edge, a ring in the page's
|
||||
colour only made the segment look smaller. `styles/focus-ring.test.ts` fails
|
||||
on a component that insets a ring over an accent fill without the switch.
|
||||
- **Forced colours** (Windows contrast themes; since v1.2.1). The browser
|
||||
replaces every colour and removes `box-shadow` and background images, so
|
||||
state shown only by a fill or a shadow vanishes. Each such state gets a
|
||||
system-colour equivalent inside `@media (forced-colors: active)`: the tree's
|
||||
focused row and its drop lines, the selected theme segment, the current tab
|
||||
and status-bar entry, the selected import-mode and export-format cards, the
|
||||
progress fill, and the drop zone's edge (drawn with background gradients,
|
||||
which are images). **A border or an outline in `Highlight` wherever the
|
||||
state has a label**: Chrome paints a backplate in the page colour behind
|
||||
forced text, so a label on a `Highlight` fill became a box that hid it — the
|
||||
first cut of this did exactly that to the current tab. The one fill with a
|
||||
label on it, the selected theme segment, sets `forced-color-adjust: none`
|
||||
with `Highlight` / `HighlightText`, because its outline is already the focus
|
||||
ring's.
|
||||
`styles/forced-colors.test.ts` holds the list of components that must carry
|
||||
the block; like the contrast pair list it is hand-maintained, so a new
|
||||
filled state has to be added to it.
|
||||
- **Target size:** every pointer target is at least 24 × 24 CSS px (WCAG 2.2,
|
||||
2.5.8) — since v1.2.1 the row buttons (were 22), the three disclosure
|
||||
chevrons (16), the toast and dialog dismiss buttons, the popup's gear and
|
||||
"Show more" in the export picker and the import preview. The glyphs keep
|
||||
their size; the hit area grows. "Every target" means every button: native
|
||||
checkboxes and radios keep the browser's size inside a label that is the
|
||||
target, and links in running text are exempt by the criterion itself.
|
||||
- **A ring that would be clipped is drawn inside.** The tree's frame and the
|
||||
"Move to…" list clip their overflow, and the global ring sits 2px outside
|
||||
the control: on "Show earlier / Show more" and on the folder buttons it was
|
||||
cut off. Those use `outline-offset: -2px`.
|
||||
- **Placeholders use `--fg-muted`**, set once in `base.css`. The browser's
|
||||
default placeholder grey is not a token, so `contrast.test.ts` never saw it
|
||||
— about 4:1 on `--bg-sunken`.
|
||||
- **The selected theme segment keeps its label on hover.** `button:hover`
|
||||
outranks `.selected`, and `--fg` on the accent fill is under 3:1.
|
||||
- **The public statement is `ACCESSIBILITY.md`** at the repository root: the
|
||||
goal (WCAG 2.2 AA — a goal, not a conformance claim), what was tested and
|
||||
with what, the known limitations, and how to report a barrier. This section
|
||||
is the specification; the statement is what users are told, and a change
|
||||
here that makes the statement false has to change it too (`11 §5`).
|
||||
|
||||
## 6. Iconography
|
||||
|
||||
|
||||
+220
-72
@@ -1,7 +1,9 @@
|
||||
# 07 — Internationalization (EN / VI / JA)
|
||||
# 07 — Internationalization (EN / VI / JA / ZH-CN / RO)
|
||||
|
||||
Baseline matches the portfolio standard: **English (default), Vietnamese,
|
||||
Japanese**. Two mechanisms with a strict split:
|
||||
Japanese**. v1.2.0 adds **Simplified Chinese (`zh-CN`) and Romanian (`ro`)** —
|
||||
the two languages the CWS dashboard showed real installs and active users in
|
||||
after the first three. Two mechanisms with a strict split:
|
||||
|
||||
| Layer | Mechanism | Why |
|
||||
|---|---|---|
|
||||
@@ -11,9 +13,11 @@ Japanese**. Two mechanisms with a strict split:
|
||||
## 1. `_locales/` (manifest-level only)
|
||||
|
||||
```
|
||||
public/_locales/en/messages.json ← default_locale
|
||||
public/_locales/vi/messages.json
|
||||
public/_locales/ja/messages.json
|
||||
src/public/_locales/en/messages.json ← default_locale
|
||||
src/public/_locales/vi/messages.json
|
||||
src/public/_locales/ja/messages.json
|
||||
src/public/_locales/zh_CN/messages.json ← Chrome's directory name, underscore
|
||||
src/public/_locales/ro/messages.json
|
||||
```
|
||||
|
||||
```json
|
||||
@@ -25,13 +29,37 @@ public/_locales/ja/messages.json
|
||||
|
||||
`wxt.config.ts` manifest: `name: "__MSG_appName__"`,
|
||||
`description: "__MSG_appDesc__"`, `default_locale: "en"`.
|
||||
Keep `appName` identical in all three locales (brand name is not translated);
|
||||
`appDesc` is translated.
|
||||
Keep `appName` identical in every locale (brand name is not translated);
|
||||
`appDesc` is translated and stays ≤ 132 characters (the manifest limit, enforced
|
||||
by `manifest.test.ts`).
|
||||
|
||||
Directory names are **Chrome's**, not BCP 47: `zh_CN`, with an underscore. The
|
||||
runtime locale id is the BCP 47 tag `zh-CN` (§2). The two are mapped in `CHROME_LOCALE_DIRS` in `tests/helpers/locales.ts`; `manifest.test.ts`
|
||||
uses it to fail on a missing `messages.json` and on a `_locales/` directory no
|
||||
locale owns.
|
||||
|
||||
Chrome resolves a manifest string by trying the full UI locale, then its
|
||||
language, then `default_locale` — so a Traditional Chinese browser (`zh_TW`)
|
||||
falls back to **English**, never to `zh_CN`. §2's runtime rule deliberately
|
||||
matches it, so the name in `chrome://extensions` and the UI agree.
|
||||
|
||||
## 2. Runtime i18n — `src/lib/i18n/`
|
||||
|
||||
```ts
|
||||
// locales/en.ts (vi.ts, ja.ts mirror the exact same shape)
|
||||
// resolve-locale.ts — the single list of shipped locales
|
||||
export const LOCALES = ['en', 'vi', 'ja', 'zh-CN', 'ro'] as const;
|
||||
export type Locale = (typeof LOCALES)[number];
|
||||
```
|
||||
|
||||
`as const` is correct **here** — this is a list of ids, not a dictionary (the
|
||||
ban below is about dictionaries). Every table keyed by locale is a
|
||||
`Record<Locale, …>`, so a locale added to `LOCALES` and missing anywhere else is
|
||||
a compile error rather than a silent English fallback: `dicts` in
|
||||
`index.svelte.ts`, `TAGS` in `format.ts`. `storage.ts`'s allow-list is
|
||||
`['auto', ...LOCALES]` and the Settings choices are built from the same array.
|
||||
|
||||
```ts
|
||||
// locales/en.ts (every other locale mirrors the exact same shape)
|
||||
import { importTab } from './en-import';
|
||||
import { errors, warnings } from './en-notices';
|
||||
|
||||
@@ -45,11 +73,12 @@ const dict = {
|
||||
};
|
||||
|
||||
export default dict;
|
||||
export type Dict = typeof dict; // widened: string, NOT the literal 'Import'
|
||||
/** Widened (string, NOT the literal 'Import'); plural branches may add `few` (§5). */
|
||||
export type Dict = Localized<typeof dict>;
|
||||
```
|
||||
|
||||
```ts
|
||||
// locales/vi.ts (ja.ts identical in shape)
|
||||
// locales/vi.ts (ja.ts, zh-CN.ts, ro.ts identical in shape)
|
||||
import type { Dict } from './en';
|
||||
import { importTab } from './vi-import';
|
||||
import { errors, warnings } from './vi-notices';
|
||||
@@ -63,43 +92,73 @@ export const importTab = { /* … */ } satisfies Dict['import'];
|
||||
(`warnings` and `errors`) and `<lang>-import.ts` (the Import tab). `<lang>.ts`
|
||||
re-assembles them, so the runtime shape and every key path are unchanged — the
|
||||
split exists only to keep each file under the `10 §1` size limit as codes and
|
||||
Import strings are added. In vi/ja the parts are typed `satisfies
|
||||
Dict['warnings']`, `Dict['errors']` and `Dict['import']`, so a missing key fails
|
||||
`tsc` in the very file that lacks it. A new string goes in whichever file holds
|
||||
its branch.
|
||||
Import strings are added. In the non-English locales the parts are typed
|
||||
`satisfies Dict['warnings']`, `Dict['errors']` and `Dict['import']`, so a
|
||||
missing key fails `tsc` in the very file that lacks it. A new string goes in
|
||||
whichever file holds its branch.
|
||||
|
||||
```ts
|
||||
// index.svelte.ts
|
||||
import en from './locales/en'; import vi from './locales/vi'; import ja from './locales/ja';
|
||||
export type Locale = 'en' | 'vi' | 'ja';
|
||||
const dicts = { en, vi, ja };
|
||||
const dicts: Record<Locale, Dict> = { en, vi, ja, 'zh-CN': zhCN, ro };
|
||||
let locale = $state<Locale>('en'); // hydrated from settings store
|
||||
export function t(path: string, params?: Record<string, string | number>): string
|
||||
// resolves dotted path in dicts[locale], falls back to en, interpolates {tokens}
|
||||
export function setLocale(l: Locale) { locale = l; } // settings store persists
|
||||
```
|
||||
|
||||
- `en.ts` is the **schema source of truth**; `vi`/`ja` are typed
|
||||
- `en.ts` is the **schema source of truth**; every other locale is typed
|
||||
`satisfies Dict` → missing keys fail `tsc` (compile-time completeness check,
|
||||
no i18n framework needed).
|
||||
- ⚠️ **Do not write `as const` on `en.ts`.** It would make `typeof dict` a tree
|
||||
of *string literal* types, so `satisfies Dict` would demand
|
||||
`vi.common.import === 'Import'` — every correct translation becomes a compile
|
||||
error and the only way to make VI/JA build is to leave them in English.
|
||||
- ⚠️ **Do not write `as const` on `en.ts`** (or any dictionary). It would make
|
||||
`typeof dict` a tree of *string literal* types, so `satisfies Dict` would
|
||||
demand `vi.common.import === 'Import'` — every correct translation becomes a
|
||||
compile error and the only way to make a locale build is to leave it in
|
||||
English.
|
||||
- `Dict` is `Localized<typeof dict>`: `typeof dict` with every plural branch
|
||||
(`{ one, other }`) widened to `{ one, other, few? }`. That optional `few` is
|
||||
the only thing it adds — it lets Romanian carry its third form (§5) without
|
||||
every other locale writing a dead one. Whether a locale carries `few` is
|
||||
checked at runtime, not by the type.
|
||||
- `Dict` is exported from `locales/en.ts` (a leaf module), **not** from
|
||||
`index.svelte.ts`. That module imports vi/ja and holds runtime `$state`, so
|
||||
having vi/ja import a type back from it forms a cycle that is only harmless
|
||||
while the import stays type-only — fragile under `verbatimModuleSyntax`.
|
||||
`index.svelte.ts`. That module imports every locale and holds runtime
|
||||
`$state`, so having a locale import a type back from it forms a cycle that is
|
||||
only harmless while the import stays type-only — fragile under
|
||||
`verbatimModuleSyntax`.
|
||||
- Interpolation is `{token}` replacement only. **No string concatenation of
|
||||
sentence fragments** — full sentences per key, so VI/JA word order works.
|
||||
- Initial locale resolution: saved setting → else map
|
||||
`chrome.i18n.getUILanguage()` prefix (`vi*`→vi, `ja*`→ja) → else `en`.
|
||||
sentence fragments** — full sentences per key, so word order works in every
|
||||
language.
|
||||
- The document language follows the resolved locale: `<html lang>` is set to the
|
||||
locale id (`vi`, `zh-CN`, …). For `zh-CN` that is load-bearing — Chinese and
|
||||
Japanese share code points, and `lang` is what makes Chrome pick a Simplified
|
||||
Chinese font and glyph forms instead of Japanese ones.
|
||||
|
||||
**Initial locale resolution:** saved setting → else map
|
||||
`chrome.i18n.getUILanguage()` → else `en`. The mapping (`resolveLocale`):
|
||||
|
||||
| Browser UI language | Resolves to |
|
||||
|---|---|
|
||||
| `vi`, `vi-*` | `vi` |
|
||||
| `ja`, `ja-*` | `ja` |
|
||||
| `zh-Hant*` (any region) | **`en`** — matches Chrome's own manifest fallback (§1); the user can still pick 简体中文 by hand |
|
||||
| `zh-Hans*` (any region) | `zh-CN` |
|
||||
| `zh-TW`, `zh-HK`, `zh-MO` (no script subtag) | **`en`**, as above |
|
||||
| `zh`, `zh-CN`, `zh-SG` and every other `zh-*` region | `zh-CN` |
|
||||
| `ro`, `ro-*` (incl. `ro-MD`) | `ro` |
|
||||
| anything else | `en` |
|
||||
|
||||
The rows are checked top to bottom, so an explicit script wins over the region
|
||||
(`zh-Hans-TW` is Simplified). Only whole subtags match: `vic` or `jav` (Javanese)
|
||||
start with `vi`/`ja` but are not our locales. Extension and private-use subtags
|
||||
(`-u-…`, `-x-…`) are ignored. `-` and `_` both separate subtags.
|
||||
The `<option>` for each language carries its own `lang`, so the endonyms are
|
||||
voiced and drawn in their own language whatever the UI language is.
|
||||
|
||||
## 3. Formatting rules
|
||||
|
||||
- Dates in UI: `new Intl.DateTimeFormat(localeTag, { dateStyle:'medium', timeStyle:'short' })`
|
||||
with tags `en-US` / `vi-VN` / `ja-JP`.
|
||||
- Numbers (counts): `Intl.NumberFormat(localeTag)` — VI uses `.` thousands.
|
||||
with tags `en-US` / `vi-VN` / `ja-JP` / `zh-CN` / `ro-RO`.
|
||||
- Numbers (counts): `Intl.NumberFormat(localeTag)` — VI and RO use `.`
|
||||
thousands, EN, JA and ZH `,`.
|
||||
|
||||
Where these live: pure `localeTag` / `formatCount` / `formatDateTime` in
|
||||
`src/lib/i18n/format.ts` (formatters cached per tag — `StatsCard` alone formats
|
||||
@@ -114,7 +173,7 @@ comment at the site so the next reader does not "finish the job":
|
||||
|
||||
| Site | Why |
|
||||
|---|---|
|
||||
| `ProgressBar`'s `{n}%` | 0–100; no locale groups two digits, and it is the hottest render path in the app |
|
||||
| `ProgressBar`'s `{n}%` | 0–100; no shipped locale groups two digits, and it is the hottest render path in the app |
|
||||
| `import.folderName`'s date | this bullet list already pins it to the localized *word* + an **ISO** date; localizing it would rename folders written into the user's browser |
|
||||
| Export filenames and file contents | locale-independent so a file means the same thing whoever opens it |
|
||||
|
||||
@@ -123,64 +182,153 @@ stay raw.
|
||||
- File names & file contents stay locale-independent (ISO dates, English
|
||||
"Imported" folder prefix? **No** — the auto-folder title uses the localized
|
||||
word + ISO date, e.g. `Đã nhập 2026-07-03`, key `import.folderName`).
|
||||
- **Sort A→Z** collates with the UI locale (`Intl.Collator(getLocale())`), so a
|
||||
Chinese user's folders sort by pinyin and a Romanian user's put `ș` after `s`.
|
||||
|
||||
## 4. Translation workflow & tone
|
||||
|
||||
- New strings land in English first — in `en.ts`, `en-notices.ts` or
|
||||
`en-import.ts`, whichever holds the branch (PR fails type-check until vi/ja
|
||||
follow).
|
||||
`en-import.ts`, whichever holds the branch (PR fails type-check until every
|
||||
locale follows).
|
||||
- **Terminology follows the browser.** Where Chrome (or, for Firefox's root
|
||||
names, Firefox) already has a word in that language — bookmark, bookmarks
|
||||
bar, folder, import — use the browser's own word, so the extension and the
|
||||
browser around it never disagree.
|
||||
- VI: neutral–friendly register, "bạn"; keep established loanwords
|
||||
(bookmark, import/export may stay English in UI where natural — decide per
|
||||
string, be consistent; folder = "thư mục").
|
||||
- JA: です/ます form; katakana loanwords (ブックマーク, インポート,
|
||||
エクスポート, フォルダ).
|
||||
- No machine-translated commits without human review (owner reviews VI;
|
||||
JA reviewed best-effort — mark `// TODO(review-ja)` where unsure).
|
||||
- ZH-CN (Simplified only):
|
||||
- Chrome's zh-CN terms: 书签 · 书签栏 · 其他书签 · 移动设备书签 · 文件夹 ·
|
||||
导入 · 导出 · 编辑 · 设置 · 关于 · 重复 · 合并 · 替换 · 备份 · 主题.
|
||||
- Polite but sparing: 您 where a pronoun is needed. Most strings need none.
|
||||
- Full-width punctuation (,。:;?!“”()). The ellipsis is `…`, as in the
|
||||
English source.
|
||||
- One half-width space between Han characters and Latin text, numbers or a
|
||||
`{token}`: "导出 {n} 个书签", "HTML 文件". No space next to full-width
|
||||
punctuation.
|
||||
- Measure words with counts: 个书签, 个文件夹, 项 for mixed items.
|
||||
- RO:
|
||||
- Chrome's ro terms: marcaj / marcaje · Bara de marcaje · Alte marcaje ·
|
||||
Marcaje mobile · dosar / dosare · a importa / a exporta · setări · despre ·
|
||||
copie de rezervă · temă.
|
||||
- Polite plural address, as Chrome and Windows use: "Selectați", "Importați",
|
||||
"dumneavoastră" where a pronoun is needed.
|
||||
- **Comma-below `ș ț Ș Ț` (U+0219/021B/0218/021A), never cedilla `ş ţ`**. They
|
||||
are different letters to a search box and a sort. `dictionaries.test.ts`
|
||||
fails on a cedilla anywhere in the Romanian files.
|
||||
- Quotation marks „…”.
|
||||
- Counts take a third plural form (§5): "1 marcaj", "5 marcaje", "20 de
|
||||
marcaje".
|
||||
- **Review policy.** Commit no machine translation unless someone has reviewed
|
||||
it. The owner reviews VI. JA, ZH-CN and RO are **best-effort** until a native
|
||||
pass, and each file says so in its header: `TODO(review-ja)`,
|
||||
`TODO(review-zh)`, `TODO(review-ro)`, with the same marker on any single
|
||||
string that is especially uncertain. Native passes are open ⚠️ items
|
||||
(`00 §10`), and translation reports arrive through
|
||||
`.github/ISSUE_TEMPLATE/translation.yml`.
|
||||
|
||||
## 5. Locale-sensitive edge cases
|
||||
|
||||
- Pluralization: plural keys are objects `{ one, other }` in **every** locale —
|
||||
a tiny helper selects by locale. VI/JA have one grammatical form, so they set
|
||||
`one` and `other` to the same string. They must still carry both keys, or the
|
||||
`satisfies Dict` shape check that §2 relies on for completeness fails.
|
||||
- **Pluralization.** A plural key is an object of CLDR plural forms. Every
|
||||
locale carries `{ one, other }`. **Romanian also carries `few`.** The rule is
|
||||
mechanical: a locale carries `few` exactly when
|
||||
`Intl.PluralRules(tag).resolvedOptions().pluralCategories` includes it.
|
||||
- VI, JA and ZH have one grammatical form, so they set `one` and `other` to
|
||||
the same string. They must still carry both keys, or the `satisfies Dict`
|
||||
shape check that §2 relies on for completeness fails.
|
||||
- EN has `one` (1) and `other`.
|
||||
- RO has `one` (1), `few` (0, 2–19, and any number ending in 01–19, such as
|
||||
101 or 119) and `other` (20–100, 120…). `other` is the form with "de":
|
||||
"{n} de marcaje".
|
||||
- A count-less noun label — the popup's eyebrows above a big number — is not
|
||||
a sentence. There the bare plural noun serves both `few` and `other`
|
||||
("marcaje").
|
||||
|
||||
Implemented as `selectPluralForm(count, tag)` in `i18n/format.ts` (backed by
|
||||
`Intl.PluralRules`, narrowed to the two forms — en yields `one`/`other`, vi
|
||||
and ja only ever `other`, so two forms cover every locale we ship) and
|
||||
`tPlural(path, count, params?)` in `index.svelte.ts`, which supplies `{n}`
|
||||
already grouped for the locale so callers pass a raw count. Two tests in
|
||||
`tests/unit/i18n/dictionaries.test.ts` enforce the shape: every plural key
|
||||
carries both forms in all three locales, and carries nothing else.
|
||||
Implemented as `selectPluralForm(count, tag)` in `i18n/format.ts`. It is
|
||||
backed by `Intl.PluralRules` and narrowed to `one`/`few`/`other`; `zero`,
|
||||
`two` and `many` fold into `other`, and no shipped locale produces them.
|
||||
`tPlural(path, count, params?)` in `index.svelte.ts` supplies `{n}` already
|
||||
grouped for the locale, so callers pass a raw count. It falls back from the
|
||||
selected form to `other`, then to English.
|
||||
|
||||
The plural keys are **every** `warnings.*` code — including the two that
|
||||
interpolate no count, because `ParseWarning` always carries one and a uniform
|
||||
shape lets `WarningList` call `tPlural` unconditionally instead of
|
||||
maintaining a list of which codes count things — then `import.warnings.title`
|
||||
and, since v1.1.0, eighteen more: `popup.bookmarks`/`folders`;
|
||||
`export.start`; `import.start`, `countBookmarks`/`countFolders`, `reused`,
|
||||
`cancelledSummary`, `partialCreated`/`partialCleared`;
|
||||
`edit.deleteFolderBody`, `keepFirst`/`keepFirstBody`, `sortBody`,
|
||||
`showMore`/`showEarlier` and `duplicateLinks`/`extraCopies` (the duplicate
|
||||
summary was one string with two counts, so it read "1 duplicated links · 1
|
||||
extra copies"). Anything else stays a plain string.
|
||||
`tests/unit/i18n/dictionaries.test.ts` enforces the shape:
|
||||
- every plural key carries exactly the forms its locale's rules need, and
|
||||
nothing else;
|
||||
- `few` is compared against English `other` for interpolation tokens;
|
||||
- **every shipped locale's `pluralCategories` ⊆ {one, few, other}**. A future
|
||||
locale that needs `two` or `many` (Arabic, Polish, Russian…) fails there
|
||||
first, before anyone ships a grammar the helper cannot select.
|
||||
|
||||
⚠️ **No non-plural key may be named `one` or `other`.** The second test reads
|
||||
any branch holding either key as a plural and fails it unless it has exactly
|
||||
two keys. That is why the Firefox root names are
|
||||
The plural keys are **every** `warnings.*` code. That includes the two that
|
||||
interpolate no count: `ParseWarning` always carries one, and a uniform shape
|
||||
lets `WarningList` call `tPlural` unconditionally instead of keeping a list
|
||||
of which codes count things. Beyond those come `import.warnings.title` and,
|
||||
since v1.1.0, eighteen more:
|
||||
- `popup.bookmarks`/`folders`;
|
||||
- `export.start`;
|
||||
- `import.start`, `countBookmarks`/`countFolders`, `reused`,
|
||||
`cancelledSummary`, `partialCreated`/`partialCleared`;
|
||||
- `edit.deleteFolderBody`, `keepFirst`/`keepFirstBody`, `sortBody`,
|
||||
`showMore`/`showEarlier` and `duplicateLinks`/`extraCopies`. The duplicate
|
||||
summary was one string with two counts, so it read "1 duplicated links · 1
|
||||
extra copies".
|
||||
|
||||
Anything else stays a plain string.
|
||||
|
||||
⚠️ **No non-plural key may be named `one`, `few` or `other`.** The test reads
|
||||
any branch holding one of those keys as a plural and fails it unless its keys
|
||||
are exactly the plural forms. That is why the Firefox root names are
|
||||
`import.rootTitle.{toolbar, unfiled, mobile}`: a third key named `other` made
|
||||
the branch a malformed "plural".
|
||||
|
||||
- **Every code needs a message, in all three locales.** A code with no key
|
||||
renders as its own dotted path (`warnings.INVALID_URL`) and no union type can
|
||||
see it, so `dictionaries.test.ts` walks three runtime lists:
|
||||
`PARSE_WARNING_CODES` (eleven since v1.1.0, each a plural under `warnings.*`),
|
||||
`BM_PARSE_ERROR_CODES`, and since v1.1.0 `BM_BACKUP_ERROR_CODES`
|
||||
(`browser/errors.ts`, now `BACKUP_EXCEEDS_LIMITS` included) — plain strings
|
||||
under `errors.*`. A new code goes into its list, or the test cannot see it.
|
||||
`BmEnvError`'s codes (`NO_WRITABLE_ROOTS`, `WRITE_LOCKED`) have no list yet:
|
||||
the key-path parity check keeps vi/ja in step with en, but nothing checks
|
||||
that en has them.
|
||||
- **Language labels are endonyms, identical in every dictionary.** A Japanese
|
||||
user hunting for Romanian looks for "Română", not "ルーマニア語".
|
||||
`dictionaries.test.ts` asserts `settings.lang` is the same in all of them.
|
||||
- **Every code needs a message, in every locale.** A code with no key renders
|
||||
as its own dotted path (`warnings.INVALID_URL`) and no union type can see it,
|
||||
so `dictionaries.test.ts` walks three runtime lists:
|
||||
- `PARSE_WARNING_CODES` (eleven since v1.1.0, each a plural under
|
||||
`warnings.*`);
|
||||
- `BM_PARSE_ERROR_CODES`;
|
||||
- since v1.1.0, `BM_BACKUP_ERROR_CODES` (`browser/errors.ts`, now including
|
||||
`BACKUP_EXCEEDS_LIMITS`).
|
||||
|
||||
The last two are plain strings under `errors.*`. A new code goes into its
|
||||
list, or the test cannot see it. `BmEnvError`'s codes are covered by
|
||||
`BM_ENV_ERROR_CODES`.
|
||||
- Legal Gate: the four legal documents are **English-only** (canonical), with
|
||||
a localized one-line note: "The legally binding documents are in English."
|
||||
- Store listing: EN required; VI + JA listings via CWS dashboard localized
|
||||
fields (copy lives in `13_RELEASE_PUBLISHING.md`).
|
||||
- Store listing: EN required; every other locale's listing goes into the CWS
|
||||
dashboard's localized fields (copy lives in `store/listing.*.md`, `13 §3`).
|
||||
|
||||
## 6. Adding a locale
|
||||
|
||||
Written while adding `zh-CN` and `ro`, so the next language is a checklist and
|
||||
not an investigation. Each step names what fails when it is skipped.
|
||||
|
||||
1. **Plural forms first.** Check
|
||||
`new Intl.PluralRules(tag).resolvedOptions().pluralCategories`. If it holds
|
||||
anything besides `one`, `few` and `other`, stop: `format.ts`, `Localized`
|
||||
and the dictionary tests need a new form before any translation can be
|
||||
correct. The guard test fails here anyway.
|
||||
2. `LOCALES` in `resolve-locale.ts`, plus a `resolveLocale` row and its tests.
|
||||
`tsc` then demands the `dicts` entry (`index.svelte.ts`) and the `TAGS`
|
||||
entry (`format.ts`).
|
||||
3. Three dictionary files modelled on `ja.ts` / `ja-notices.ts` /
|
||||
`ja-import.ts`, with a tone header and the `TODO(review-xx)` marker.
|
||||
4. The endonym in `settings.lang` of **every** dictionary (the endonym test
|
||||
fails otherwise).
|
||||
5. `src/public/_locales/<chrome dir>/messages.json`. Also add it to
|
||||
`CHROME_LOCALE_DIRS` (`tests/helpers/locales.ts`), to `REQUIRED_FILES`
|
||||
(`scripts/check-manifest.mjs`) and to that script's test fixture.
|
||||
6. `store/listing.<chrome dir>.md` plus its row in `store/README.md`.
|
||||
7. The language dropdown in `.github/ISSUE_TEMPLATE/translation.yml`, and the
|
||||
`LANGS` list in `scripts/screenshots.mjs`. Then run the visual sweep
|
||||
(`11 §5`) in both themes for overflow and glyphs.
|
||||
`tests/unit/i18n/touch-points.test.ts` fails on any of steps 5–7 left out,
|
||||
and on a `LANGUAGES` line in a listing or the README that does not name
|
||||
every language.
|
||||
8. This chapter's tone section, `06 §3.4`, `11 §5`, `README.md`, `CHANGELOG.md`.
|
||||
A new UI language is a **minor** release (`12 §4`).
|
||||
@@ -198,8 +198,9 @@ any of them changes (`09 §4`).
|
||||
- [ ] Right-click → Options lands on `#settings` both on a fresh profile and
|
||||
with a Manager tab already open on another route (§1 uses an undocumented
|
||||
URL fragment; `02 §5`).
|
||||
- [ ] All three `_locales` load (chrome://extensions shows localized name
|
||||
when browser language switched).
|
||||
- [ ] All five `_locales` load (chrome://extensions shows the localized
|
||||
description when the browser language is switched — and a `zh_TW`
|
||||
browser shows English, `07 §1`).
|
||||
- [ ] Version bumped (semver) in `package.json` (WXT propagates to manifest).
|
||||
- [ ] Privacy tab answers unchanged, or updated + re-certified.
|
||||
- [ ] Store listing screenshots regenerated if the UI changed
|
||||
|
||||
@@ -50,7 +50,7 @@ rather than assign `undefined`. Build nodes with conditional spreads
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.6.2/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.6.4/schema.json",
|
||||
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
|
||||
// Svelte, CSS, Markdown and YAML are excluded on purpose — see the notes below.
|
||||
"files": {
|
||||
@@ -78,6 +78,15 @@ rather than assign `undefined`. Build nodes with conditional spreads
|
||||
(`switch-every-tab-hotkey`) excludes `.svelte` and `.css` instead, and we
|
||||
follow it rather than putting the build on an experimental flag.
|
||||
**`svelte-check` is the authority** for everything inside `.svelte`.
|
||||
Since v1.2.1 it runs with **`--fail-on-warnings`**: the Svelte compiler's
|
||||
accessibility warnings (`a11y_*` — a click handler with no key handler, a
|
||||
control with no label) are warnings, and through 1.2.0 a warning never
|
||||
failed anything. It is the only lint that reads the markup. A deliberate
|
||||
exception takes a `<!-- svelte-ignore a11y_… -->` with its reason in the
|
||||
same comment; there are two, on `Modal`'s backdrop click and on the tree's
|
||||
`<ul>`. (`TreeRow`'s row `<div>` avoids the same warning differently — an
|
||||
empty `onkeydown` and `role="presentation"` — because the keys are the
|
||||
tree's, not the row's.)
|
||||
- **Markdown and YAML are excluded since Biome 2.6**, which started formatting
|
||||
both. The docs and workflow files are laid out by hand (long explanatory
|
||||
comments, deliberate wrapping); letting a formatter own them would turn every
|
||||
|
||||
+87
-10
@@ -220,6 +220,42 @@ them is tested where it lives:
|
||||
from the real stylesheets, so a new component cannot opt out by forgetting.
|
||||
`motion.test.ts` first checks that it found more than 20 styled files to
|
||||
police.
|
||||
- **`styles/focus-ring.test.ts`** and **`styles/forced-colors.test.ts`**
|
||||
(v1.2.1) — the two `06 §5` rules 1.2.0 broke without a test noticing. The
|
||||
first fails on a component that insets a focus ring (`outline-offset` below
|
||||
zero) while filling a state with `--accent`, unless that ring is
|
||||
`--accent-fg`: the theme control's ring was accent on accent. The second
|
||||
holds the list of components that show state by a fill or a shadow and
|
||||
requires each to carry a `@media (forced-colors: active)` block naming a
|
||||
system colour. Both read the real `.svelte` files; the second's list is
|
||||
hand-maintained, like the contrast pairs.
|
||||
- **`edit/tree-keyboard.test.ts`**, **`edit/tree-keys.test.ts`** and
|
||||
**`stores/edit-session.test.ts`** — since v1.2.1 also Alt+↑/↓ (`05 §10`):
|
||||
`nudgeTarget` at both ends of a folder, stepping over an open neighbour's
|
||||
children, in a filtered list; the key reaching the command only with Alt
|
||||
alone; the move itself by Chrome's index rule, refused for a root, a managed
|
||||
node and while busy, one at a time, and returning the row's place among the
|
||||
siblings on screen — under a search too, where it passes hidden items.
|
||||
- **`stores/edit-live.test.ts`** (v1.2.1) — the wiring that used to sit
|
||||
untested in `EditTab`'s `onMount`, with `wxt/browser` mocked to seven
|
||||
hand-fired event emitters and a hand-fired frame: a frame's events land as
|
||||
one patch; a created node with no parent is ignored; nothing is patched
|
||||
during Chrome's own import, and its end re-reads once; a wholesale reorder
|
||||
re-reads; teardown detaches every listener and drops what was queued.
|
||||
SonarCloud's new-code gate is what asked for it — moving code out of a
|
||||
component makes it count.
|
||||
- **`components/focus-heading.test.ts`** — since v1.2.1 also
|
||||
`focusOwningTree`: a click on a row's control hands focus to the tree it
|
||||
sits in, and does nothing outside one.
|
||||
- **`links.test.ts`** — since v1.2.1 also `ACCESSIBILITY.md`: the file exists
|
||||
and the About link ends at it.
|
||||
- **`accessibility-statement.test.ts`** (v1.2.1) — the statement is a public
|
||||
promise nothing in the build reads, so its routes and its key table are
|
||||
pinned: the README links to it; the issue form exists and carries the
|
||||
`accessibility` label; the address is the same in the statement, the README
|
||||
and the issue chooser; every key `tree-keyboard.ts` switches on has a row;
|
||||
it states a goal and an untested list, and it is dated. It cannot tell
|
||||
whether a sentence is *true* — that is `§5`'s last item.
|
||||
- **`tests/unit/scripts/`** — the repo's own gates, tested like code. New in
|
||||
v1.1.0: `guard.test.ts` (`08 §3`), `check-manifest.test.ts` (a correct build
|
||||
passes, one without the CSP fails) and `sanitize-formats.test.ts` (the
|
||||
@@ -234,11 +270,12 @@ first — on `http://localhost:4318` with a fake `chrome`: neutral sample
|
||||
bookmarks, so no real profile ever appears, and in-memory storage. Every HTML
|
||||
page is served with the production CSP as a `<meta>`, so a violation shows in
|
||||
the console exactly as it would in the extension. Pages take
|
||||
`?theme=light|dark&lang=en|vi|ja&legal=0|1` and the route as the hash —
|
||||
`?theme=light|dark&lang=en|vi|ja|zh-CN|ro&legal=0|1` and the route as the hash —
|
||||
`manager.html?theme=dark&lang=vi#edit`; `legal=0` shows the gate. `--shoot`
|
||||
photographs every route × theme × language at 1280×800 with a local headless
|
||||
Chrome (`CHROME_PATH`, or the usual install paths), plus the store set
|
||||
(`13 §2`). Use it to sweep layout, translation overflow and both themes in
|
||||
photographs every route × theme × language at 1280×800 and the popup per theme
|
||||
× language at 360×420 with a local headless Chrome (`CHROME_PATH`, or the usual
|
||||
install paths), plus the README and store sets (`13 §2`). It does not shoot
|
||||
the gate (`legal=0`) — open that by hand in each language. Use it to sweep layout, translation overflow and both themes in
|
||||
minutes. It is **not** the pass below: each page has its own fake tree and
|
||||
storage, nothing written survives a reload, and the popup's tiles open nothing.
|
||||
|
||||
@@ -257,7 +294,8 @@ storage, nothing written survives a reload, and the popup's tiles open nothing.
|
||||
- [ ] **A Firefox JSON backup** (`bookmarks-YYYY-MM-DD.json`, or
|
||||
`tests/fixtures/firefox-bookmarks-2026-07-25.json`): format pill "Firefox
|
||||
backup"; in new-folder mode its roots arrive under localized names (check
|
||||
VI and JA too); `place:` smart bookmarks are skipped and counted.
|
||||
every non-English locale too); `place:` smart bookmarks are skipped and
|
||||
counted.
|
||||
- [ ] **Merge reuses folders:** import a file holding `Bookmarks bar/Dev/…`
|
||||
into a profile that already has `Dev` — no second `Dev`; the new items
|
||||
land at the end of the existing one, and the report says how many
|
||||
@@ -296,10 +334,49 @@ storage, nothing written survives a reload, and the popup's tiles open nothing.
|
||||
**and** Shift+F10 open **Move to…** with focus in its filter — type to
|
||||
narrow, Tab to a folder, Enter moves the item there; Esc closes it and
|
||||
focus returns to the tree. Ctrl+C copies the focused link. Every dialog
|
||||
opens with focus inside and returns it on close.
|
||||
- [ ] Language switch EN→VI→JA live-updates all tabs; dates/numbers
|
||||
localized; restart persists. Header switcher and the `#settings` row
|
||||
agree at all times (one state, two views).
|
||||
opens with focus inside and returns it on close. **Alt+↑ / Alt+↓** moves
|
||||
the focused row one place among its siblings and stops at either end;
|
||||
a permanent root does not move. After clicking a row button or a
|
||||
chevron with the mouse, the arrow keys still work.
|
||||
- [ ] **Focus is never lost:** Tab to the theme control — the ring is visible
|
||||
on the selected segment, in the header and in `#settings`, in both
|
||||
themes. After "Keep the first of each" and after a toolbar Sort A→Z,
|
||||
focus is on something visible. After "Open in Edit" from an import
|
||||
report it is on the page's main region, which shows no ring: the test is
|
||||
that the next Tab goes into the tab's content, not back to the header.
|
||||
- [ ] **Screen reader** (Narrator on Windows, or NVDA; VoiceOver on macOS):
|
||||
the tree announces each row's name, level and "n of m"; a dialog reads
|
||||
its title and body; the import's steps and outcome are spoken; Alt+↓
|
||||
speaks the row's new position, once. Record the reader and its version
|
||||
in `ACCESSIBILITY.md`'s "What has been tested".
|
||||
- [ ] **Contrast themes** (Windows: Settings → Accessibility → Contrast
|
||||
themes; or DevTools → Rendering → `forced-colors: active`): the tree's
|
||||
focused row, the drop line of a drag, the selected theme segment, the
|
||||
current tab, the selected import-mode and export-format cards and the
|
||||
progress bar's fill are all still distinguishable.
|
||||
- [ ] **Zoom and narrow windows:** at 200 % zoom and at a 400 px-wide window,
|
||||
every route still works without a horizontal scrollbar on the page, and
|
||||
no control is clipped or covered.
|
||||
- [ ] **`ACCESSIBILITY.md` is still true:** its key table matches `06 §5`, its
|
||||
known limitations still exist (and nothing new belongs there), and its
|
||||
"last reviewed" date is this release's.
|
||||
- [ ] Language switch EN→VI→JA→简体中文→Română live-updates all tabs;
|
||||
dates/numbers localized; restart persists. Header switcher and the
|
||||
`#settings` row agree at all times (one state, two views).
|
||||
- [ ] **Romanian plurals read right** at all three forms: import or select 1,
|
||||
then 2–19, then 20 or more items and read the counts — "1 marcaj",
|
||||
"5 marcaje", "20 de marcaje" — in the import stats, the Start button and
|
||||
the popup tiles.
|
||||
- [ ] **Chinese renders as Chinese**: with 简体中文 selected, `<html lang>` is
|
||||
`zh-CN` and characters such as 设置 / 导入 use Simplified Chinese glyphs,
|
||||
not Japanese ones. With the browser in Traditional Chinese (`zh-TW`)
|
||||
and the setting on Automatic, the UI is English, and so is the name in
|
||||
chrome://extensions (`07 §1`).
|
||||
- [ ] Romanian and Chinese in the popup, the tab bar, the status bar and
|
||||
every button: nothing truncated, wrapped mid-word or overlapping. The
|
||||
sweep photographs each route at 1280×800 and the popup at 360×420; this
|
||||
item covers what it cannot — narrower windows, open dialogs, the import
|
||||
preview, a running import and the Legal Gate.
|
||||
- [ ] Theme: system/light/dark. In **both** light and dark, read text on every
|
||||
surface — page, panels, inputs and the status bar, a selected row or
|
||||
card — and check the focus ring, control borders and disabled controls
|
||||
@@ -340,7 +417,7 @@ storage, nothing written survives a reload, and the popup's tiles open nothing.
|
||||
already open. The deep-link is refused by the same guard; confirm it
|
||||
behaves as `02 §5` describes rather than appearing to do nothing.
|
||||
- [ ] The import report states that imported bookmarks carry today's date — in
|
||||
EN, VI **and** JA.
|
||||
every locale.
|
||||
- [ ] chrome://extensions → no errors logged during the whole pass.
|
||||
- [ ] Edge (or Brave): smoke test install + import/export.
|
||||
|
||||
|
||||
+10
-5
@@ -64,7 +64,8 @@ Three jobs. The two whose names branch protection requires (§5) are
|
||||
|
||||
- **`quality` — "Quality gates".** Local, because the ops reusable runs no
|
||||
quality gates at all (§1). In order: `lint`, `check` (svelte-check on the
|
||||
TS 6 API, then the TS 7 `tsc`), `knip`, `coverage` (`11 §1` thresholds),
|
||||
TS 6 API — failing on warnings too since v1.2.1, which is what makes Svelte's
|
||||
`a11y_*` checks a gate, `10 §3` — then the TS 7 `tsc`), `knip`, `coverage` (`11 §1` thresholds),
|
||||
`guard` (`08 §3`), `npm audit --omit=dev --audit-level=low` (the
|
||||
zero-runtime-dependencies claim, `09 T5`), `build`, `check:manifest`. The last
|
||||
two exist because the unit test over `wxt.config.ts` proves what we *asked*
|
||||
@@ -199,7 +200,7 @@ Added 2026-10-28, replacing SonarCloud's Automatic Analysis so the project gets
|
||||
- The price of that isolation: the scan job has no `node_modules`, so Sonar's
|
||||
type-aware rules resolve our own modules (through `.wxt/`) but not the
|
||||
dependencies' types.
|
||||
- The scan action is **pinned to a commit** (`v8.3.0`): it is the step that
|
||||
- The scan action is **pinned to a commit** (`v8.4.0`): it is the step that
|
||||
holds `SONAR_TOKEN`. Dependabot and fork PRs get no repository secrets, so the
|
||||
scan is skipped with a notice instead of failing.
|
||||
- Coverage: `vitest.config.ts` measures every `src/**/*.ts` module and reports
|
||||
@@ -244,9 +245,13 @@ release: bump package.json (semver) → CHANGELOG.md (Keep a Changelog) →
|
||||
git tag -s vX.Y.Z → push tag → release.yml
|
||||
```
|
||||
|
||||
- Patch = fixes/translations · Minor = features / any permission or
|
||||
privacy-tab change (per `09 §4`) · Major = breaking format/schema changes
|
||||
(BM JSON version bump).
|
||||
- Patch = fixes / translation fixes / **accessibility fixes** — including a
|
||||
keyboard or assistive-technology route to something the product could
|
||||
already do (v1.2.1's Alt+↑/↓ beside drag-to-reorder): it closes a barrier, it
|
||||
does not add a capability · Minor = features, **a new UI language**
|
||||
(it changes the listing and what the switcher offers — `07 §6`) / any
|
||||
permission or privacy-tab change (per `09 §4`) · Major = breaking
|
||||
format/schema changes (BM JSON version bump).
|
||||
|
||||
## 5. Repo settings checklist (one-time ⚠️)
|
||||
|
||||
|
||||
@@ -49,6 +49,10 @@ privacy and distribution tabs are already filled; you are replacing the package.
|
||||
new `[X.Y.Z]` line must be added). Forgetting the link refs is the easy
|
||||
half to miss.
|
||||
|
||||
A third when the interface changed, or a new check was run:
|
||||
- `ACCESSIBILITY.md` — its "Last reviewed" line (date and version) and its
|
||||
"What has been tested" table, once `11 §5`'s last item has been done.
|
||||
|
||||
`wxt.config.ts` declares no `version` key — WXT derives it from
|
||||
`package.json` (`08 §5`). If it appears in your diff, something is wrong.
|
||||
3. PR → CI green → merge to `main`. **The bump must be on `main` before the
|
||||
@@ -121,14 +125,15 @@ call (⚠️ `13 §1b`).
|
||||
|
||||
## 3. Store listing — EN (canonical)
|
||||
|
||||
**The listing copy lives in `store/listing.{en,vi,ja}.md`** — name, summary,
|
||||
**The listing copy lives in `store/listing.*.md`** — one file per locale
|
||||
(`en`, `vi`, `ja`, `zh_CN`, `ro`, named by Chrome's locale code) — name, summary,
|
||||
description, category and the privacy-policy URL, exactly as pasted into the
|
||||
dashboard. This section used to carry a second copy of the English text, and
|
||||
for v1.1.0 the two had already diverged (the store files gained the Chrome and
|
||||
Firefox imports, Merge reuse, the Replace confirmation and Sort A→Z; the copy
|
||||
here still described v1.0). A copy in two places is a copy that drifts.
|
||||
|
||||
When the description changes: edit all three `store/listing.*.md` in the same
|
||||
When the description changes: edit every `store/listing.*.md` in the same
|
||||
pull request as the feature, keep claims to what the CHANGELOG says shipped,
|
||||
and paste them into the dashboard as part of `§1b`. The summary must stay ≤132
|
||||
characters in every language.
|
||||
@@ -137,10 +142,20 @@ characters in every language.
|
||||
|
||||
**VI summary:** `Nhập, xuất & chỉnh sửa bookmark giữa các trình duyệt — offline, không tài khoản, không cloud. Dữ liệu không rời khỏi máy bạn.`
|
||||
**JA summary:** `ブラウザ間でブックマークをインポート・エクスポート・編集。オフライン、アカウント不要、クラウド不要。データは端末から出ません。`
|
||||
Full VI/JA descriptions: translate §3 keeping structure. The canonical copy
|
||||
lives in `store/listing.{en,vi,ja}.md` so listing text is version-controlled and
|
||||
reviewable — a listing edit made straight into the dashboard has no diff and no
|
||||
history.
|
||||
**ZH-CN summary:** `在浏览器之间导入、导出和编辑书签——离线运行,无需账户,无需云端。您的数据绝不会离开您的设备。`
|
||||
**RO summary:** `Import, export și editare de marcaje între browsere — offline, fără cont, fără cloud. Datele nu vă părăsesc dispozitivul.`
|
||||
Full descriptions: translate `store/listing.en.md` keeping its structure. The
|
||||
canonical copy lives in `store/listing.*.md` so listing text is
|
||||
version-controlled and reviewable — a listing edit made straight into the
|
||||
dashboard has no diff and no history.
|
||||
|
||||
**Adding a listing language** (v1.2.0 did two): in the dashboard, Store listing
|
||||
→ the language selector → add the language, then paste name, summary and
|
||||
description from its file. The "Languages" line in the public listing is not
|
||||
typed by anyone — CWS derives it from the package's `_locales/`, so it changes
|
||||
only when the new package is live. The `LANGUAGES` paragraph inside every
|
||||
description *is* typed, so a new locale means re-pasting the description of
|
||||
every existing language too.
|
||||
|
||||
⚠️ Those files were written from §3 **after** the listing went live, so they are
|
||||
a reconstruction, not a transcript. Owner: diff them against what the dashboard
|
||||
@@ -167,6 +182,11 @@ actually shows and correct the files, not the dashboard.
|
||||
requires a sanitized sample (`scripts/sanitize-bookmarks.mjs`) plus explicit
|
||||
consent to commit it as a GPL-3.0 fixture, because that is what turns a report
|
||||
into a regression test (`11 §2`, `15 §v1.0.x`).
|
||||
- Accessibility reports — their own form (`accessibility.yml`, label
|
||||
`accessibility`) and `accessibility@poli0981.dev` for people without a
|
||||
GitHub account. `ACCESSIBILITY.md` promises an acknowledgement within about
|
||||
a week and a patch for a blocking barrier (`15`, release trigger); a report
|
||||
that is not fixed at once goes into its Known limitations.
|
||||
- Discord servers (`#support` in the OSS server) — pin an FAQ post.
|
||||
⚠️ The invite URL is not recorded anywhere in the repo.
|
||||
- Review flow for feature requests: label → roadmap doc PR → milestone.
|
||||
|
||||
@@ -15,7 +15,7 @@ the user accepts, once, with links to canonical documents on GitHub.
|
||||
`<LegalGate>` overlay.
|
||||
- **Blocks:** `#import`, `#export`, `#edit`. **`#settings` and `#about` stay
|
||||
reachable** — `#about` so users can read the linked documents before
|
||||
accepting, `#settings` so a VI/JA user can switch language and theme first
|
||||
accepting, `#settings` so a non-English user can switch language and theme first
|
||||
(which is why `<LegalGate>` needs no language switcher of its own). Popup is
|
||||
never blocked (it only launches the Manager). Same list in `03 §4` and the
|
||||
`11 §5` QA checklist.
|
||||
|
||||
+108
-12
@@ -27,7 +27,15 @@ Build-phase breakdown lives in `CLAUDE.md` (single source for sequencing).
|
||||
| **v1.0.1 published** | ✔ observed 2026-10-28 | listing shows version 1.0.1 (`Updated: August 3, 2026`), 5 users. ⚠️ Exact approval date not recorded; `13 §1b` step 10 (clean-profile install of the published build + upgrade re-check) has no recorded result |
|
||||
| 7 — v1.1.0 | ✔ 2026-10-29 | PR-A toolchain/CI/Sonar (#26); PR-B import redesign, Chrome/Firefox formats, Merge reuse, Edit store + Sort A→Z + reorder, technical UI, diagnostics, docs/legal (#27); the second review's fixes, which missed the #27 merge (#28); the release workflow's artifact fix (#29) |
|
||||
| **v1.1.0 released** | ✔ 2026-10-29 | signed tag on `9040f84`, GitHub Release with a `sha256sum -c`-verified zip (`104f020c…2dd6c94`, 94 091 bytes). Its manifest differs from 1.0.1's only in `version`, `minimum_chrome_version` (120 → 136) and the new CSP; permissions unchanged. The first tag run failed before publishing anything (`12 §2.3`); fixed in #29 and the tag moved while no Release existed. `announce` and store publish skipped (variables unset) |
|
||||
| **v1.1.0 submitted** | ⚠️ pending | owner: the `11 §5` manual pass on real Chrome, including the **1.0.1 → 1.1.0 upgrade over an existing profile**, then upload the Release zip by hand (`13 §1b`) |
|
||||
| **v1.1.0 submitted** | ✔ by 2026-11-06 | uploaded to the CWS dashboard by hand (`13 §1b` step 6) |
|
||||
| **v1.1.0 published** | ✔ observed 2026-11-06 | owner reported the review passed; the listing shows version 1.1.0 (`Updated: October 29, 2026`), 6 users, "3 languages". ⚠️ As for 1.0.1, `13 §1b` step 10 (clean-profile install of the published build + upgrade re-check) has no recorded result |
|
||||
| 8 — v1.2.0 languages | ✔ 2026-11-06 | Simplified Chinese (`zh-CN`) and Romanian (`ro`): one `LOCALES` list, a third plural form for Romanian, manifest `_locales`, store listings, intake form (`07`). One PR (#33); a code review and a native-style translation review before the bump, every finding fixed — the worst a Romanian CSV note saying the bookmarks-bar folder itself is lost on export |
|
||||
| **v1.2.0 released** | ✔ 2026-11-06 | signed tag on `e2f36bc`, GitHub Release with a `sha256sum -c`-verified zip (`0b4a268c…f8617b`, 105 284 bytes). Its manifest differs from 1.1.0's only in `version`; the package gains `_locales/zh_CN` and `_locales/ro`. `announce` and store publish skipped (variables unset) |
|
||||
| **v1.2.0 submitted** | ✔ by 2026-11-07 | uploaded to the CWS dashboard by hand, with the 简体中文 and Română listing languages (`13 §1b` step 6, `13 §4`) |
|
||||
| **v1.2.0 published** | ✔ observed 2026-11-10 | the listing shows version 1.2.0 (`Updated: November 7, 2026`), 3 users, "5 languages" — English, Tiếng Việt, română, 中文(中国), 日本語. ⚠️ As for 1.0.1 and 1.1.0, `13 §1b` step 10 (clean-profile install of the published build + upgrade re-check) has no recorded result |
|
||||
| 9 — v1.2.1 accessibility | ✔ 2026-11-10 | `ACCESSIBILITY.md` and its intake (issue form, PR checklist, `accessibility@`); the defects an audit of `src/` found that a keyboard-and-Narrator pass had not — an invisible focus ring on the theme control, no forced-colours support, drag-only reordering (Alt+↑/↓), focus dropped on `<body>` in three places, targets under 24 px; dependency sync after Dependabot #31/#32/#35/#36 (`06 §5`) |
|
||||
| **v1.2.1 released** | ✔ 2026-11-10 | PR #37, merged at the head that was reviewed. Signed tag on `d61318a`, GitHub Release with a `sha256sum -c`-verified zip (`4975b5df…ca13254`, 106 290 bytes). Its manifest differs from 1.2.0's only in `version`, and the file inventory is the same. SonarCloud's new-code gate failed the first push at 73.6 % — the live-sync wiring moved out of `EditTab` had no test — and passed once it had one. `announce` and store publish skipped (variables unset) |
|
||||
| **v1.2.1 submitted** | ⚠️ pending | owner: the `11 §5` pass incl. the **1.2.0 → 1.2.1 upgrade over an existing profile**, a Windows contrast theme and a screen-reader pass over Alt+↑/↓, then the zip upload (`13 §1b`) |
|
||||
|
||||
**Verified on real browsers 2026-07-25:** Chrome and Brave, unpacked build.
|
||||
Until that point every phase had been tested only against a hand-rolled
|
||||
@@ -103,8 +111,9 @@ There is exactly one path, and every step has an owner in the repo:
|
||||
5. `11 §2`'s inventory and `CHANGELOG.md [Unreleased]` are updated.
|
||||
|
||||
Translation fixes use `.github/ISSUE_TEMPLATE/translation.yml` and follow
|
||||
`07 §4`; the JA native review pass (`ja.ts`'s `TODO(review-ja)`) is the
|
||||
outstanding one, and it is user-facing now.
|
||||
`07 §4`. The native review passes are the outstanding ones, and all of them are
|
||||
user-facing: JA (`TODO(review-ja)`) since launch, and ZH-CN and RO
|
||||
(`TODO(review-zh)`, `TODO(review-ro)`) since v1.2.0.
|
||||
|
||||
### Release trigger
|
||||
|
||||
@@ -112,12 +121,16 @@ Cut a patch when **any** of these is true, rather than on a schedule:
|
||||
|
||||
- a parser-tolerance fix exists (a user is currently unable to import a file);
|
||||
- a data-integrity or dead-end defect is fixed;
|
||||
- an accessibility barrier is fixed — something a keyboard, screen-reader or
|
||||
contrast-theme user could not do or could not perceive (`ACCESSIBILITY.md`
|
||||
promises exactly this);
|
||||
- a batch of translation fixes has accumulated;
|
||||
- a dependency fix is needed for a real advisory.
|
||||
|
||||
Listing copy tweaks alone do **not** need a patch — the store listing is edited
|
||||
independently of the package (`13 §5`), though the copy should still go through
|
||||
`store/listing.{en,vi,ja}.md` first so it is reviewable.
|
||||
`store/listing.*.md` first so it is reviewable. A **new** UI language is not a
|
||||
patch: it is a minor (`12 §4`).
|
||||
|
||||
## v1.1 — quality of life
|
||||
|
||||
@@ -140,10 +153,12 @@ independently of the package (`13 §5`), though the copy should still go through
|
||||
block decoder, no dependency. Also: capture a real Chrome HTML + `Bookmarks`
|
||||
pair to sit beside the hand-built `chrome-156-*` fixtures, and the JA native
|
||||
review.
|
||||
3. **v1.2 — the aggressive-dedupe toggle** (deferred this round), a
|
||||
3. **v1.3 — the aggressive-dedupe toggle** (deferred this round), a
|
||||
session-scoped import undo, Biome linting of `.svelte` files, and true
|
||||
virtualization of the edit tree if 500-row chunks prove too coarse.
|
||||
4. **v1.2+ — automated CWS publishing** once the owner creates the `CHROME_*`
|
||||
virtualization of the edit tree if 500-row chunks prove too coarse. These
|
||||
were the v1.2 plan until 2026-11-06, when real installs in Chinese and
|
||||
Romanian made two languages the next minor instead (see below).
|
||||
4. **v1.3+ — automated CWS publishing** once the owner creates the `CHROME_*`
|
||||
secrets; Edge Add-ons and Firefox AMO listings through WXT's multi-target
|
||||
build (each a separate go/no-go).
|
||||
|
||||
@@ -153,17 +168,83 @@ Items found by the 2026-10-28 audit and not closed in v1.1.0, with their IDs:
|
||||
cL6 non-UTF-8 charsets in HTML imports; cL9 an extension allowlist on drop
|
||||
(content sniffing is the gate, so not planned); cL13 a newline inside a title
|
||||
for Chrome's line-based importer; sA8.1 Biome does not lint `.svelte`. From
|
||||
the post-implementation review: a keyboard way to place an item before or after
|
||||
a sibling (drag has it; "Move to…" only appends); true virtualization of the
|
||||
the post-implementation review: ~~a keyboard way to place an item before or
|
||||
after a sibling~~ (✔ v1.2.1, Alt+↑/↓); true virtualization of the
|
||||
edit tree (a 500-row window around the focus shipped — `05 §9`); a
|
||||
`require-trusted-types-for 'script'` CSP, which would make Chrome itself
|
||||
enforce the raw-HTML ban (the Svelte runtime already creates the policy;
|
||||
untested in extension pages); an input on the ops repo's reusable workflow to
|
||||
skip install scripts in the `Build + package` job (`12 §2`); whether a
|
||||
screen reader reads a focused row's button labels with its name (unconfirmed
|
||||
without one).
|
||||
screen reader reads a focused row's button labels with its name (the owner's
|
||||
Narrator pass on 1.2.0 found nothing blocking, 2026-11; the verbosity itself
|
||||
was not measured, and NVDA, JAWS and VoiceOver remain untested).
|
||||
|
||||
## v1.2 — resilience
|
||||
### Accessibility backlog (from the 2026-11-10 audit, not closed in v1.2.1)
|
||||
|
||||
`ACCESSIBILITY.md` lists the user-facing ones as known limitations; this is
|
||||
where they are scheduled. None blocks a task; each is a patch when it lands
|
||||
(`12 §4`).
|
||||
|
||||
- **Spoken results for the other edit commands.** Only Alt+↑/↓ announces what
|
||||
it did. A move, a sort, a rename, "keep first" and a new folder are silent
|
||||
on success, and so is a search (no result count, and "Nothing matches" is
|
||||
not a live region).
|
||||
- **Row semantics.** A folder and a bookmark differ only by an `aria-hidden`
|
||||
icon (an empty folder has no `aria-expanded`, so it sounds like a
|
||||
bookmark); the policy-managed lock and the child count are an icon and a
|
||||
bare number.
|
||||
- **A pointer route to reorder that is not a drag** (WCAG 2.5.7): drag and
|
||||
Alt+↑/↓ exist; a click-only one does not.
|
||||
- **The tree's keys are shown nowhere in the UI.** `ACCESSIBILITY.md` lists
|
||||
them and About links to it; an in-product key list would need a dialog.
|
||||
- **`role="toolbar"` without arrow keys** on the edit toolbar — the mismatch
|
||||
the previews' `role="tree"` was removed for.
|
||||
- **Hover-only hints** (`title` on elements that cannot take focus): the
|
||||
status bar's notes, the import target note, the busy reason on a disabled
|
||||
tab.
|
||||
- **Headings and a skip link.** Only the legal gate has an `<h1>`, `#edit` has
|
||||
no headings, and the header's five tab stops cannot be skipped. Landmarks
|
||||
exist.
|
||||
- **Settings descriptions** are not tied to their controls
|
||||
(`aria-describedby`), nor is the "dedupe is off under Replace" note.
|
||||
- **Info toasts leave after four seconds** with no pause on hover or focus.
|
||||
- **Font sizes are in px**, so Chrome's font-size setting does not scale the
|
||||
UI (zoom does).
|
||||
- **Ctrl/⌘+F always goes to the search box** on `#edit`, even with a dialog
|
||||
open.
|
||||
- **No automated check of the rendered markup** — no axe pass, no role
|
||||
queries; the harness photographs but does not inspect. (A process gap, so
|
||||
not in the statement.) The forced-colours and focus-ring tests are
|
||||
file-level text checks: they cannot see specificity, which is how three of
|
||||
the 1.2.1 review's findings got past them.
|
||||
- **Disabled without a visual cue.** The section tabs during a write, and a
|
||||
row's buttons during a bulk command, change only the cursor.
|
||||
- **Keys that cannot act are silent** — Alt+↑ at the top of a folder, Delete on
|
||||
a root. And on a Mac laptop the delete key is Backspace, which the tree
|
||||
does not handle; on ChromeOS Alt+↑/↓ may arrive as Page Up/Down.
|
||||
- **Truncated titles** have no way to be read in full in the tree.
|
||||
- **A held Alt+↑/↓ can flicker.** Moves run one at a time, but the live event
|
||||
of one can flush a frame after the next press's optimistic patch and roll
|
||||
the row back for that frame (`05 §10`). It converges; the fix is to drain
|
||||
the batcher before planning.
|
||||
|
||||
## v1.2 — languages (planned 2026-11-06)
|
||||
|
||||
The CWS dashboard showed installs and active users in Chinese and Romanian
|
||||
browsers, which the three shipped languages did not cover. v1.2.0 adds:
|
||||
|
||||
| Locale | Notes |
|
||||
|---|---|
|
||||
| **简体中文 (`zh-CN`)** | Simplified only. A Traditional Chinese browser (`zh-TW`/`HK`/`MO`) on "Automatic" gets English, matching Chrome's own manifest fallback (`07 §1–2`). A `zh-TW` dictionary is a separate, later decision; the `zh-CN` id leaves room for it. |
|
||||
| **Română (`ro`)** | The first locale with **three** plural forms (`07 §5`), so the plural machinery grows a `few` form first. Comma-below `ș ț` enforced by a test. |
|
||||
|
||||
Both are best-effort translations awaiting a native pass (`07 §4`, `00 §10`).
|
||||
The other candidates (Traditional Chinese, Russian, Polish, Arabic…) wait for
|
||||
the same dashboard evidence. Russian, Polish and Arabic also need plural forms
|
||||
beyond `few`; the guard test in `dictionaries.test.ts` fails first if one is
|
||||
attempted.
|
||||
|
||||
## v1.3 — resilience (was v1.2 until 2026-11-06)
|
||||
|
||||
- **Scheduled local snapshots**: periodic JSON backup. ⚠️ Requires `alarms`
|
||||
permission + a background service worker + `downloads` (or OPFS storage)
|
||||
@@ -299,3 +380,18 @@ without one).
|
||||
| 2026-10-29 | **Diagnostics allowlist enforced by types**: every `DiagEvent` string field is a union of fixed values, error names pass through an allowlist (`'other'` otherwise), and `@ts-expect-error` tests keep a title from compiling | 09 §7 |
|
||||
| 2026-10-29 | **SonarCloud runs in two jobs**: coverage with no secret, then a scan that installs nothing and gets the lcov report as an artifact — a job's secrets are readable by every step on its runner | 12 §2.5 |
|
||||
| 2026-10-29 | **The first `v1.1.0` tag run failed before publishing, and the tag was moved.** `upload-artifact` skips hidden paths, so the build job's `.output/*` matched nothing. Fixed in #29; since no Release or asset existed yet, `v1.1.0` was re-pointed at the fixed `main` (`9040f84`) rather than burning a version. `13 §7`'s rule — never move the tag of a published Release — is unchanged | 12 §2.3, 13 §7 |
|
||||
| 2026-11-06 | **v1.1.0 is live; v1.2.0 is two languages, not the dedupe toggle.** The dashboard showed real installs in Chinese and Romanian browsers. A new UI language is a **minor** release — it changes what the switcher offers and what the listing says — while translation *fixes* stay patches (`12 §4`). The old v1.2 items move to v1.3 unchanged | 12 §4, 15 |
|
||||
| 2026-11-06 | **Simplified Chinese only, and a Traditional Chinese browser on "Automatic" gets English.** Chrome's manifest fallback goes `zh_TW → zh → en`, never to `zh_CN`, so mapping Traditional to Simplified in the UI would make the extension's name and its UI disagree. A user can still pick 简体中文 by hand | 07 §1–2 |
|
||||
| 2026-11-06 | **The locale id is `zh-CN`, not `zh`.** It is a persisted setting value: a bare `zh` would have to be migrated the day a `zh-TW` dictionary exists. The id doubles as the `<html lang>` value, which is what makes Chrome draw Simplified glyphs rather than Japanese ones | 07 §2 |
|
||||
| 2026-11-06 | **One `LOCALES` list.** Every table keyed by locale is a `Record<Locale, …>` and every allow-list spreads `LOCALES`, so a new locale missing anywhere is a compile error. Before, adding a language meant finding six hand-written `['en', 'vi', 'ja']` lists, and missing one degraded silently to English | 07 §2, §6 |
|
||||
| 2026-11-06 | **A third plural form, only where a locale needs it.** `Dict` widens each plural branch to `{ one, other, few? }`. Whether a locale carries `few` is decided by its own `Intl.PluralRules` categories and enforced at runtime, so en/vi/ja/zh write no dead `few`. A guard fails on any shipped locale needing `two`/`many`/`zero` before a grammar the helper cannot select can ship | 07 §5 |
|
||||
| 2026-11-06 | **Romanian uses comma-below `ș ț`, enforced by a test.** The cedilla forms `ş ţ` look alike and are different letters to search and sort — the classic Romanian localization defect | 07 §4 |
|
||||
| 2026-11-06 | **ZH-CN and RO ship best-effort, like JA.** Written from Chrome's own terminology in each language and marked `TODO(review-zh)` / `TODO(review-ro)`; the translation form lists both. Waiting for native reviewers would have left users who already installed the extension on English indefinitely | 07 §4, 00 §10 |
|
||||
| 2026-11-10 | **v1.2.0 is live; v1.2.1 is accessibility.** The owner's keyboard-only and Narrator pass over 1.2.0 found nothing, and an audit of `src/` then found five things such a pass cannot see or did not reach: a focus ring drawn in the colour of the fill under it, no forced-colours support, reordering that only a drag could do, focus dropped on `<body>` in three places, and targets under 24 px. A pass by one person with one screen reader is evidence, not a verdict — which is also why the statement says what was tested and what was not | 06 §5, 11 §5 |
|
||||
| 2026-11-10 | **An accessibility statement, at the repository root.** `ACCESSIBILITY.md`, beside `SECURITY.md` and `CONTRIBUTING.md`, linked from the README and from About. It states **WCAG 2.2 AA as the goal, not as a conformance claim**: nobody has audited the product, and a claim would be the kind of sentence `14` exists to keep out of the project. Known limitations are listed in it rather than left in this backlog, because a user deciding whether the product will work for them reads that file, not this one | 06 §5, 15 |
|
||||
| 2026-11-10 | **`accessibility@poli0981.dev` for barrier reports**, the eleventh per-purpose alias (created and tested by the owner). It appears in `ACCESSIBILITY.md`, the README's contact table and the issue chooser — never in `src/`, by the 2026-08-03 rule, which the About link respects by pointing at the file instead. Reports have their own issue form and an `accessibility` label, because a barrier report needs the assistive technology and its version, which the bug form does not ask for | 06 §3.5, 13 §6 |
|
||||
| 2026-11-10 | **Svelte's accessibility warnings fail the build.** `svelte-check --fail-on-warnings`: the `a11y_*` checks are compiler warnings, a warning never failed anything, and Biome does not read `.svelte` — so nothing linted the markup. The suite was at zero warnings, which is the only cheap moment to turn it on | 10 §3, 12 §2 |
|
||||
| 2026-11-10 | **The review of 1.2.1 found what the tests could not, again.** Twelve code findings and seventeen in the docs — among them a tree that jumped to the top on the first click of a row button (the fix for one focus defect causing another), three forced-colours rules that lost to more specific ones, and an accessibility statement that promised more than the code did: "every clickable target is 24 px", "nothing times out", "focus is always a 2-pixel ring". The statement was rewritten to what the source supports, and its untested list grew. A statement written by the author of the code needs the same adversarial read as the code | 11 §5 |
|
||||
| 2026-11-10 | **Alt+↑ / Alt+↓ reorders, and it is a patch.** It reuses `planDrop` and `moveTo`, so a keyboard move and a drag cannot disagree about what is legal, and there is no second write path to test. One place at a time, among the siblings on screen, like a drag. It ships in a patch because it closes a barrier to something the product already did rather than adding a capability; `12 §4` now says so. Rejected: "Move up / Move down" row buttons (two more on a row that already hides up to five), and a position field in "Move to…" (a new dialog flow for the same result) — though a click-only route is still owed (WCAG 2.5.7, backlog) | 05 §10, 12 §4 |
|
||||
| 2026-11-10 | **Focus after a route change goes to `<main>`, not to the tree.** "Open in Edit" removes the button that was clicked. Focusing the tree when `#edit` mounts would also have fired on every first load, highlighting a row nobody chose and changing every screenshot; a route change with focus lost is the narrower condition and covers every tab | 06 §5 |
|
||||
| 2026-11-10 | **Dependabot's bumps are not the whole bump.** #31 and #36 moved Biome twice and left `biome.json`'s `$schema` behind both times, and left `vitest`'s declared range a minor behind the coverage plugin's, which must match it (the lockfile had both at 5.1.0); `01 §2` drifted with them. The sync is a human step after each Dependabot merge, and WXT still gets the built-manifest diff — 0.21.5 produced a manifest byte-identical to the 1.2.0 release asset | 01 §2, §6 |
|
||||
Generated
+188
-216
@@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "bookmarkmagic",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bookmarkmagic",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "GPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "2.6.2",
|
||||
"@biomejs/biome": "2.6.4",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
||||
"@types/node": "^26.6.5",
|
||||
"@types/node": "^26.6.6",
|
||||
"@typescript/native": "npm:typescript@~7.0.2",
|
||||
"@vitest/coverage-v8": "^5.0.5",
|
||||
"@vitest/coverage-v8": "^5.1.0",
|
||||
"@wxt-dev/module-svelte": "^2.0.5",
|
||||
"jsdom": "^30.1.3",
|
||||
"knip": "^6.42.1",
|
||||
"svelte": "^5.57.2",
|
||||
"svelte-check": "^4.7.7",
|
||||
"knip": "^6.44.1",
|
||||
"svelte": "^5.57.3",
|
||||
"svelte-check": "^4.7.8",
|
||||
"typescript": "npm:@typescript/typescript6@~6.0.2",
|
||||
"vitest": "^5.0.5",
|
||||
"wxt": "^0.21.4"
|
||||
"vitest": "^5.1.0",
|
||||
"wxt": "^0.21.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=26"
|
||||
}
|
||||
},
|
||||
"node_modules/@1natsu/wait-element": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@1natsu/wait-element/-/wait-element-4.2.0.tgz",
|
||||
"integrity": "sha512-Om0Q+WE9mNrpY4AwMTvkFiYHv8VM7TML3PvOqXy+w6kAjLjKhGYHYX+305+a6J8RVpds9s7IF2Z5aOPYwULFNw==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@1natsu/wait-element/-/wait-element-5.0.0.tgz",
|
||||
"integrity": "sha512-OY5MEgiBNTfpNJvLn1yVYil2HcSfiJfSh3T3urmO96/mlxvm+frDZxZ1ngT0HO3F9usoyNPd0SnEE0SqrVaaEQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -187,9 +187,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/biome": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.6.2.tgz",
|
||||
"integrity": "sha512-JLTFAFF9vfJcWwLhwuL4ZHflLg+XfTEC4IUnAlJRX1cMRt57++Xd1Ysb9Fdmlh9YUrvyCXfPEHjjEIqKJGdPKw==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.6.4.tgz",
|
||||
"integrity": "sha512-8sKKwaNW4ot22awZ3lBjwWLHnUFXgXnrBPYS2gNlBAXRbDC++7kqjK2H7dR/FgCDtPvO1xfKpgEhJkGxAKYkxA==",
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"bin": {
|
||||
@@ -203,22 +203,22 @@
|
||||
"url": "https://opencollective.com/biome"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@biomejs/cli-android-arm64": "2.6.2",
|
||||
"@biomejs/cli-android-x64": "2.6.2",
|
||||
"@biomejs/cli-darwin-arm64": "2.6.2",
|
||||
"@biomejs/cli-darwin-x64": "2.6.2",
|
||||
"@biomejs/cli-linux-arm64": "2.6.2",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.6.2",
|
||||
"@biomejs/cli-linux-x64": "2.6.2",
|
||||
"@biomejs/cli-linux-x64-musl": "2.6.2",
|
||||
"@biomejs/cli-win32-arm64": "2.6.2",
|
||||
"@biomejs/cli-win32-x64": "2.6.2"
|
||||
"@biomejs/cli-android-arm64": "2.6.4",
|
||||
"@biomejs/cli-android-x64": "2.6.4",
|
||||
"@biomejs/cli-darwin-arm64": "2.6.4",
|
||||
"@biomejs/cli-darwin-x64": "2.6.4",
|
||||
"@biomejs/cli-linux-arm64": "2.6.4",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.6.4",
|
||||
"@biomejs/cli-linux-x64": "2.6.4",
|
||||
"@biomejs/cli-linux-x64-musl": "2.6.4",
|
||||
"@biomejs/cli-win32-arm64": "2.6.4",
|
||||
"@biomejs/cli-win32-x64": "2.6.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-android-arm64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-arm64/-/cli-android-arm64-2.6.2.tgz",
|
||||
"integrity": "sha512-dMpdpH7zFEL5FxuIA9LJW+RoNyC3oeDB7PJyjqVVwtMNoKB5uo8OZYmrVSBikn71txzYwy/3xga7UME6bJQZ6A==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-arm64/-/cli-android-arm64-2.6.4.tgz",
|
||||
"integrity": "sha512-jwrwigP4tBcHxzuV8izioX/BOUhJL/4e2rNSOE5nCjBkVC018LQAQUGiH+CNkFYvLtQ1dcZo5/xXERmaAGc7JQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -233,9 +233,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-android-x64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-x64/-/cli-android-x64-2.6.2.tgz",
|
||||
"integrity": "sha512-XCwEhPBGYzuRA502dRkCcQ+5cefQwuxQR7f9wa4do92dvIcuBL6VMLMFB/fL9hlpZ4dGSfHdpGFSIDlp52mg0A==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-x64/-/cli-android-x64-2.6.4.tgz",
|
||||
"integrity": "sha512-HdGInPJ4nZFwHxzvEtcp2nmSBtUyJrurmtIK43upFckuS3+ZqVM05HtsxQWnqGsuy/pxckIAjyKWlEKRlBXUyA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -250,9 +250,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.6.2.tgz",
|
||||
"integrity": "sha512-rpXtabRgyZNz3aCjd/cRoSZGYi92R9eAXdUUe1sigIsRDyfMwgThaa98Yxt1fiZ7mxquqkAyIHIo08N/e1ToBA==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.6.4.tgz",
|
||||
"integrity": "sha512-0VvcUz46wbg59Q4TZ59KkIjDJrxEyu4Eoe79+F4SChxoWe+W7AEyIp6F5r72C9+p6MsB6dIovnZt1D30lGM3XA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -267,9 +267,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-x64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.6.2.tgz",
|
||||
"integrity": "sha512-7GGzlm1GxUKoQ9CNV8tQZ+XXad4sz+v+uzNsWlhaGjsnZqUOVBw1OmAMpG3uNV/Mr0UrCpRJvSK0qvfuqSQOjg==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.6.4.tgz",
|
||||
"integrity": "sha512-fxmvkF81srlS3DiMyfm+aG3J0eG+6/BjaxRyjy57KbLSafnq0PO+hHfVWmtH2ty0S7nm6yDXBRwySfFeaRJKRQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -284,9 +284,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.6.2.tgz",
|
||||
"integrity": "sha512-Qs4CofCE8MdkjZFfEjswh2NAcbyQ7IVYtGSzQBvLqFlla/CSXroGbktUFndWG/kVSTywadauzAspYWtSfqAc2g==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.6.4.tgz",
|
||||
"integrity": "sha512-6+bK1Y/evmIUiJr7auertuMbiaYVicJhqA1bZyL47lCMWugv8l0gFQCqvR/gN1vZMHYm+HwoTKgeMxdNFCoQTg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -304,9 +304,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.6.2.tgz",
|
||||
"integrity": "sha512-I+FYCLVSmR3cYfKcQ+KNeLOZ5w0wRd9fQFlw3JbSvy7bkegvTqdHaBRRcJzHQB/1ldldTLIcG21ka6X2cTWmJw==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.6.4.tgz",
|
||||
"integrity": "sha512-31ZaH/MHqPX+O+evRwRrCHQ8W5/9adY+/eMytGGWZnRx1T41QsWIF09+/WujynLBhWZUxNGS5CtsWLwgOFTAyg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -324,9 +324,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.6.2.tgz",
|
||||
"integrity": "sha512-FJKsb95418139xDdbv9XnNJsIIwvsgR21Of0aE9B9U+nQlOtRq5gJl2ps0jZUmYBxTaOlP9BKo8N+Ff8+Rui1g==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.6.4.tgz",
|
||||
"integrity": "sha512-tbFZMdL6dP/ws4edXxYG9WhvaVa1ZDzL4G5DzahnWW7Psib9H+VTdyU4XXVxpJk5j/nYZroSbvSNyYlpW3yCIw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -344,9 +344,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.6.2.tgz",
|
||||
"integrity": "sha512-wnjEXAK2pDd2j8r9gKI3L+44sIxjkYzS5aHmD1+K57RNJ3sFyT4n22NH6QFPqqeVdRBxN54H3kckUUCrFKCcJw==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.6.4.tgz",
|
||||
"integrity": "sha512-bomSa2XdQAGGj6Cwdm4M13qE+lN9+AOlW8KtI4hdyVyRRF/Z71qPAi95T4wtdZK0QpBbkTW8hgbZZCwPi4xzIw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -364,9 +364,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-arm64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.6.2.tgz",
|
||||
"integrity": "sha512-/PEOo6evlgrQOfKhMNtC/4Gk8ai3hySXXEtjUzCqZe/4iAbMdqelpp7qvZEDyLxlZS+BjOMQFpq2gXI/BPaAqw==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.6.4.tgz",
|
||||
"integrity": "sha512-eCsqt8Ma3eVap+oyJCDnJZH60SIU464B66n3y38EUTJdM1T/HfZol1FJC9vb+sHToX0ix8XzqPcwJnOzyAJz0g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -381,9 +381,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-x64": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.6.2.tgz",
|
||||
"integrity": "sha512-FVlWD+mDDz8nN5LWKRWUhhb7wKIK0VE3oXQvQBX7Fwwj00CvqMVhMyiz1iz8O5aZGmnkhFlKSwJPrUvMh5prQw==",
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.6.4.tgz",
|
||||
"integrity": "sha512-pYsMy5AThiHFOZAsngg8qN4PurM6nInKBhVX7sbj3eNpRQqo1Hb0MgCwPL7VqVMrmcEEMj9Ks3qbkallR65e8g==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -675,9 +675,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-android-arm-eabi": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.154.0.tgz",
|
||||
"integrity": "sha512-sDdEtDl7vKdCvf54j72RJbowE3jCmyRz/+oOB6IAwQxAHZ0eI+Dcj4hvVnm0b9Dy31plUkdmfds9C+/Zt895Tg==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.155.0.tgz",
|
||||
"integrity": "sha512-A6xv7hDtnTm+xlZ7utn6rRQpRMJHRhVr3gjRGqlx0RUX84mNk0pAsy6YN/wWhuOTkaZhRrrzaLxf0NfbH77j2w==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -692,9 +692,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-android-arm64": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.154.0.tgz",
|
||||
"integrity": "sha512-UHrDPELzvWZoVkIDdSycj4bzcTMCJG3IbN++mSUgVBaUtNtWHjQ98U6Vz5bpF/1Ic3FYJyYhMr74huO5tVvpZw==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.155.0.tgz",
|
||||
"integrity": "sha512-T1wWwH9/JI5g7Z4kEQwDOwhToxdDhRyOTklH+uuNpJ16m3MZFmGl+l2rKc0NHQdbVRG2LTOBsNjpW3h1BWytPA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -709,9 +709,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-darwin-arm64": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.154.0.tgz",
|
||||
"integrity": "sha512-mokYzajOSXxtSRDWCdHARGdntrKH+rZZ24Jzo8AtafyNzz0NARmpMm26Tc5B6qiGrr6UliWibHCOif1qRN2vaA==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.155.0.tgz",
|
||||
"integrity": "sha512-ZoRB3qJxJ8DWA41jHja+YeB0lLfjBy4T+Kr15vnN1k65X3zbJt3rPZftEwN4Ju4tmA4K/T9dWWD7Z8ewQLnrVA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -726,9 +726,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-darwin-x64": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.154.0.tgz",
|
||||
"integrity": "sha512-WbtUBrclOVItWfLRSvs+Z/WLtXxJ2Ctv50PyuX894HzDN5/e0qzxVpTNPIVMzOerBhgKtFsSMcfxlYIAbvdVgg==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.155.0.tgz",
|
||||
"integrity": "sha512-vxtL86BtM+IgrpejA86nbTk5j0HKTIMeuaJ1fQciw6p9RfavPtIPjI7gN34owap0yG9txXBaAWpGdxokNwdqIw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -743,9 +743,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-freebsd-x64": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.154.0.tgz",
|
||||
"integrity": "sha512-YooHZSLawOe2fqm+lDdG8oAaQh2NYV/RMYTYzWRLy72stm2BgE9O/8Al6kFENjkmzyyBccDLLBirGxVtpzQfrw==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.155.0.tgz",
|
||||
"integrity": "sha512-tN6Ru5e0UVnWaIuiH8jEwnvxuxg7FvhWwSd3oe5oDhOD4ObsSr9/N6WfHLjilUWlPPj65ptwrSDH0Y7lzwTzmw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -760,9 +760,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm-gnueabihf": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.154.0.tgz",
|
||||
"integrity": "sha512-hKOwhZbrXdTwc4bGVfbLCXl9f2swl6zWdISocLQSNX9MgPmwHE3qGzOUkCrkuGpwdCVHPnkfOwsqTuYsrP5uNg==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.155.0.tgz",
|
||||
"integrity": "sha512-h4ozA5n6L6lwolsz9iwunEhKWnIVbmFRots5QxEix0H6nJ5ICpuDa7PuShuhfpIDFe3+Qvyscioyiv+9g+4Syg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -777,9 +777,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm-musleabihf": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.154.0.tgz",
|
||||
"integrity": "sha512-tnjiooXEU013349O/yxKbF5Cusp1CfHWQ8kYR8tGeRzR/P4sOpQGQo21fsS71M0fMD6ESLq+lbvXFWi43PuKeQ==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.155.0.tgz",
|
||||
"integrity": "sha512-058/+LardpfuUlsKIvBGk/CYoakEVcMgqYx8GgyUZeOxFWTojYLlCc1Gb60/y21v3esDhHidgiY/Zbq9LpBhaQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -794,9 +794,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm64-gnu": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.154.0.tgz",
|
||||
"integrity": "sha512-Cao2kj+8d7BT6XJU1gV9eVQjV+Cr+e8vQm3tddDRZiM2hHrMDxwy3j6t+ofaSl0idyuPPCZ4AlpmQoj8yOT1QA==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.155.0.tgz",
|
||||
"integrity": "sha512-nrOt2Y3xIAzu+lSPzH0864ieO+iCCXgoo9qFlGANE8Xh0cQ+RP8Wstfp+/wXN2YCyb98cAGzX0VruKYw7it/jw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -814,9 +814,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm64-musl": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.154.0.tgz",
|
||||
"integrity": "sha512-uiwA0V3q8llWA7/8r+a9BBjk4j5YMDmi6wfOsyQfGOJMQSLHEiZ3HI8ulea766ykUa9wJFWk9XWEl4uJrZLQqw==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.155.0.tgz",
|
||||
"integrity": "sha512-KYAayyN5hQbJPtGKtRxlyc8XYmyntOplyXSQzTDrmbz7l/GCrzQbSswvyJFBTH1LGtsZrbXOAfN52i/Kz6kLKg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -834,9 +834,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-ppc64-gnu": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.154.0.tgz",
|
||||
"integrity": "sha512-LICfN0Xs4Zdko+bJy6eOAEQojDuIR26suF2JtOsMaXjgbCrpRSH7/NCvJhY13YvYBx12V6hnwrL8n0lk0rbNJQ==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.155.0.tgz",
|
||||
"integrity": "sha512-CSuSY5hfjtsBnHXydOj8jiNfS1qHbdPZuPz1YL1cSgK7VmNYP+QlZIbG0BBYYBgX/vYEgZwbG9mBdW4YairZ5w==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -854,9 +854,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-riscv64-gnu": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.154.0.tgz",
|
||||
"integrity": "sha512-gbbSYxLF8ssRbQ2qQPy+2EhGNwNH1bAoRdkk6cnWaKHqmCikpSIPtpXjFbCCtjTi0uojqOM3ghFQwQPbDQsU0Q==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.155.0.tgz",
|
||||
"integrity": "sha512-7KCfOQm+Nz2N8trAXbQkal4TQ5756WVEmhm35y816YHvyFnEfVsICsiV5k0pEszNf/fRm4cm2i6i18SJ6/iCWg==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -874,9 +874,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-riscv64-musl": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.154.0.tgz",
|
||||
"integrity": "sha512-nSnRYYDLCcRVjSQzF3g6rKqCNYwo5o+aQgnn8BBXfe+ofCgMGlGqkfRyvXm6ptZvoxNkkWtLlqM8W7Xc3j6ZnQ==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.155.0.tgz",
|
||||
"integrity": "sha512-JSlhgoK+/g1TGJI5NuADx2+6syhxnQNLCWLXyO5QLFyetomcr/vIxSdiNlmyAv963YXUzCuwAwRG6npZ5xyJ1A==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -894,9 +894,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-s390x-gnu": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.154.0.tgz",
|
||||
"integrity": "sha512-BxBQoJKtzRQgZEKQIt6CDUm8RGKC5T8Qo4576yDa5/xgc10X3fBDItMbRabzLtbUBfTqKLl+8AVr/H6CF7W22g==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.155.0.tgz",
|
||||
"integrity": "sha512-WFIX+dPokWp64mi434Md3U3lJaTwNxAphvGjpltoyQjGUsdXavOIRrnp9dOS34Hd75HOAwDxAI+YwWOwqmJbtg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -914,9 +914,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-x64-gnu": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.154.0.tgz",
|
||||
"integrity": "sha512-/whkust2vYy+GjRUVL5cWaJmEu6jkdFfo5mkxgckyeOX61eMwo4iBoiwzeJZeMWAdzb/XOtQyLApHhFht3sOWA==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.155.0.tgz",
|
||||
"integrity": "sha512-g6xSDC/JpbnVOz5uafMGyK3txBVRFMQTx8opv/yHXGxqV3ZMVl3bf7W8XrSnF68dmy3gM4dgReNryuE53+WkeQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -934,9 +934,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-x64-musl": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.154.0.tgz",
|
||||
"integrity": "sha512-EXURTyW9riw4B/kZnnE+58emAtw6+3VEszQfXUZkRqGaKIcmWDYkZtKB+xY/blHvuZ+Qy/fDclc31nmUCgtkSA==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.155.0.tgz",
|
||||
"integrity": "sha512-6/4xlxKlZJWrQ0uwDFPc0H9+xLu7068CKhX3vIDW3SbvP/lVgnVuT5v6dyugeWskWpuxqF/WJ4WKwhxjU3pG2w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -954,9 +954,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-openharmony-arm64": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.154.0.tgz",
|
||||
"integrity": "sha512-ZRFooyH3qsR6vuR4jFGlG3XM36490SvvXtNaUahBK4zHpooMdTHNaOMtGGJI0EW38m5hi4rOco9kw7ZwCIp28w==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.155.0.tgz",
|
||||
"integrity": "sha512-tltklL0J0XjDxIRTBXWOBhvc2mitcmES45pIxhwDWfxRyqz7Vkeu0NekTZEIxGE4f/lXgq3vZcjjffteQOVorg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -971,9 +971,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-win32-arm64-msvc": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.154.0.tgz",
|
||||
"integrity": "sha512-U0Vp+4lvwUa/PnOCJTZOjydj1rX2+VLHz4Y2vSFqlN8/7LTiURgD7z4uQ9yNv9O/NlU3mELBnPDlu7aaSYG1zQ==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.155.0.tgz",
|
||||
"integrity": "sha512-alAb9TzjatUEsOeoncAziUnfdTDxfyswhalFZ9sC6plUgATIUx2NIZ0+bMn6aJ28AduS1OpG/OAisr/YISn4Ig==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -988,9 +988,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-win32-ia32-msvc": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.154.0.tgz",
|
||||
"integrity": "sha512-Hc8QgsFY5eUUP25we8TISUruibG2cDt0H4IcPG9RKdabb6odkCzIqjV6Gk9beGWGuOwMVCr81H/Su1q363LCCg==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.155.0.tgz",
|
||||
"integrity": "sha512-yc5cbSfcGmRv/KpxDFuyk8adEBaWd/9HilWvBbQ4bFbus1V2PUh2mGB2Cfq9rqZTqLeiMT8x0skV+LKp9hOMgQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -1005,9 +1005,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-win32-x64-msvc": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.154.0.tgz",
|
||||
"integrity": "sha512-hD7judkUMA/hZPoamvKADs6+an1smp8UTK0aMYRijkvi00K/1vl7vEtmyn2JyQ9S+vibtnfcNzxqTLGyJUZCRQ==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.155.0.tgz",
|
||||
"integrity": "sha512-8heq6jGq+rfpTDRDjoQiBHw0maQZf3IXkS99pdHQZPoTL5kyF5qyPS0RidUlSdnWDIqxXb5nux7GBD9cT+imUw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1022,9 +1022,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz",
|
||||
"integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz",
|
||||
"integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -1733,9 +1733,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "26.6.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz",
|
||||
"integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==",
|
||||
"version": "26.6.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz",
|
||||
"integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -2134,15 +2134,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/coverage-v8": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-5.0.5.tgz",
|
||||
"integrity": "sha512-4KpkGdIrSqBihx/JyP/e+S+IKB98etg1XDQiLAxksLfcShnwi1VReGeOT9NI43hLHbknosKp/1CCLn9Zgcs8mg==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-5.1.0.tgz",
|
||||
"integrity": "sha512-OY9aShBQG5KOIw2zCo9fDoCHI9RHliNHJ//nM7m6jGg41Hyke9JOGWmeMlK74xYErsxMoK8mIB3gAeEyFVA7LA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@bcoe/v8-coverage": "^1.0.2",
|
||||
"@vitest/istanbul-lib-coverage": "^1.0.2",
|
||||
"@vitest/istanbul-lib-report": "^1.0.2",
|
||||
"@vitest/istanbul-lib-coverage": "^2.1.0",
|
||||
"@vitest/istanbul-lib-report": "^2.1.0",
|
||||
"ast-v8-to-istanbul": "^1.0.7",
|
||||
"magicast": "^0.5.5",
|
||||
"obug": "^3.0.0",
|
||||
@@ -2153,8 +2153,8 @@
|
||||
"url": "https://opencollective.com/vitest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vitest/browser": "5.0.5",
|
||||
"vitest": "5.0.5"
|
||||
"@vitest/browser": "5.1.0",
|
||||
"vitest": "5.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@vitest/browser": {
|
||||
@@ -2177,9 +2177,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/istanbul-lib-coverage": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.2.tgz",
|
||||
"integrity": "sha512-9J/JMwOf9AoJhAywhrn7ScKTL38hsWQP/qPG60OtaAFcQ5OXPwKsxZFlbnuCKmZ61m8/lGgHYnFpdyQZUvG/iA==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/istanbul-lib-coverage/-/istanbul-lib-coverage-2.1.0.tgz",
|
||||
"integrity": "sha512-WOjuS+xcjSIy7ruYBQ+9BUcV7XZQ0FyVcbWbWxW9TRx/kLGx5SQaeFRIFDJxjNplb6YsT7SpKo2zuXXUo91OIQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2187,27 +2187,27 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/istanbul-lib-report": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/istanbul-lib-report/-/istanbul-lib-report-1.0.2.tgz",
|
||||
"integrity": "sha512-gUsfXZJbzPamoIY5TvHFiMMoXESBrUMo+xqaj+rYrWI69+EnvRlYBlP96ZnHPY4vX8kyUpgAnFUCg5wZG/HkDQ==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/istanbul-lib-report/-/istanbul-lib-report-2.1.0.tgz",
|
||||
"integrity": "sha512-+ZFta25nWtGCOBG9/IET8w1RO5Oawsd6H8Uf6AJ9EA/StFuKVtKAEJEJ6uRt84OH+T4YkI0ASmIHAhRA+0KVxw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/istanbul-lib-coverage": "1.0.2"
|
||||
"@vitest/istanbul-lib-coverage": "2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.5.tgz",
|
||||
"integrity": "sha512-xLL3lkDegJZw+MGoGaCCsFayDZthGgpAtr3Vziyfc4p7xH89K7KRPcRBBh/kEYm0Aqkt5DtTmkYpBtRV/FrHZg==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz",
|
||||
"integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "0.3.31",
|
||||
"@vitest/spy": "5.0.5",
|
||||
"@vitest/spy": "5.1.0",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^1.4.3"
|
||||
},
|
||||
@@ -2228,9 +2228,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.5.tgz",
|
||||
"integrity": "sha512-lwJRExuH417257Q5wv9QYugN9IMJkoxcrKrYxGPQkBzl7wlNpTUxD/5yNX4ESKVUIShKPgkGchYPFMWOOk0wzw==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz",
|
||||
"integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -2791,22 +2791,6 @@
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv-expand": {
|
||||
"version": "13.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-13.0.0.tgz",
|
||||
"integrity": "sha512-aBfBS8eYIeXmpHI9ThIlA7/WLq+SLt18iXUZhb52rW89QLKQFoIpPG1bPeewoPZsTyjSSO3T7234FBVUM1V2rA==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"dotenv": "^17.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
@@ -3272,9 +3256,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/knip": {
|
||||
"version": "6.42.1",
|
||||
"resolved": "https://registry.npmjs.org/knip/-/knip-6.42.1.tgz",
|
||||
"integrity": "sha512-gKJVsiT4LJQ0lfc8uSHOCzkOY8adAXNFGarIeODZbJOkBnQRVsG3e0UZFnO4LMwjA82A5tBWX/VgoeTYcjdKiQ==",
|
||||
"version": "6.44.1",
|
||||
"resolved": "https://registry.npmjs.org/knip/-/knip-6.44.1.tgz",
|
||||
"integrity": "sha512-Hbd8nvkIsNgFfXgC7Jsb5LHv7jj6VwA3tmfHd53XPX2z9Vc9RnAZqV0BIiP4OrtYqKwCoLseFHQZerb1bNlbSw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -3291,13 +3275,13 @@
|
||||
"formatly": "^0.11.4",
|
||||
"get-tsconfig": "4.14.3",
|
||||
"jiti": "^2.7.0",
|
||||
"oxc-parser": "^0.154.0",
|
||||
"oxc-parser": "^0.155.0",
|
||||
"oxc-resolver": "11.24.2",
|
||||
"picomatch": "^4.0.7",
|
||||
"smol-toml": "^1.9.0",
|
||||
"strip-json-comments": "5.0.3",
|
||||
"tinyglobby": "^0.2.17",
|
||||
"unbash": "^6.0.0",
|
||||
"unbash": "^6.0.1",
|
||||
"yaml": "^2.9.1",
|
||||
"zod": "^4.6.5"
|
||||
},
|
||||
@@ -3840,13 +3824,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/oxc-parser": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.154.0.tgz",
|
||||
"integrity": "sha512-Gr/6fkjZwi937c4Tsz8y0iO4U0FLPkZI6JSVucLAIvQyqh379px7RS8ORIc0HOORbFjXZ6zyqWLl53qxhSeofw==",
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.155.0.tgz",
|
||||
"integrity": "sha512-C/ReSf1JUFukK/zvk6jhcNibSssvas5+ktIzK7fbKVd3CedWe59C3QwHEOrEZj/4Rt9+xg0Jeis/Jv1F/KM1mw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "^0.154.0"
|
||||
"@oxc-project/types": "^0.155.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
@@ -3855,25 +3839,25 @@
|
||||
"url": "https://github.com/sponsors/oxc-project"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@oxc-parser/binding-android-arm-eabi": "0.154.0",
|
||||
"@oxc-parser/binding-android-arm64": "0.154.0",
|
||||
"@oxc-parser/binding-darwin-arm64": "0.154.0",
|
||||
"@oxc-parser/binding-darwin-x64": "0.154.0",
|
||||
"@oxc-parser/binding-freebsd-x64": "0.154.0",
|
||||
"@oxc-parser/binding-linux-arm-gnueabihf": "0.154.0",
|
||||
"@oxc-parser/binding-linux-arm-musleabihf": "0.154.0",
|
||||
"@oxc-parser/binding-linux-arm64-gnu": "0.154.0",
|
||||
"@oxc-parser/binding-linux-arm64-musl": "0.154.0",
|
||||
"@oxc-parser/binding-linux-ppc64-gnu": "0.154.0",
|
||||
"@oxc-parser/binding-linux-riscv64-gnu": "0.154.0",
|
||||
"@oxc-parser/binding-linux-riscv64-musl": "0.154.0",
|
||||
"@oxc-parser/binding-linux-s390x-gnu": "0.154.0",
|
||||
"@oxc-parser/binding-linux-x64-gnu": "0.154.0",
|
||||
"@oxc-parser/binding-linux-x64-musl": "0.154.0",
|
||||
"@oxc-parser/binding-openharmony-arm64": "0.154.0",
|
||||
"@oxc-parser/binding-win32-arm64-msvc": "0.154.0",
|
||||
"@oxc-parser/binding-win32-ia32-msvc": "0.154.0",
|
||||
"@oxc-parser/binding-win32-x64-msvc": "0.154.0"
|
||||
"@oxc-parser/binding-android-arm-eabi": "0.155.0",
|
||||
"@oxc-parser/binding-android-arm64": "0.155.0",
|
||||
"@oxc-parser/binding-darwin-arm64": "0.155.0",
|
||||
"@oxc-parser/binding-darwin-x64": "0.155.0",
|
||||
"@oxc-parser/binding-freebsd-x64": "0.155.0",
|
||||
"@oxc-parser/binding-linux-arm-gnueabihf": "0.155.0",
|
||||
"@oxc-parser/binding-linux-arm-musleabihf": "0.155.0",
|
||||
"@oxc-parser/binding-linux-arm64-gnu": "0.155.0",
|
||||
"@oxc-parser/binding-linux-arm64-musl": "0.155.0",
|
||||
"@oxc-parser/binding-linux-ppc64-gnu": "0.155.0",
|
||||
"@oxc-parser/binding-linux-riscv64-gnu": "0.155.0",
|
||||
"@oxc-parser/binding-linux-riscv64-musl": "0.155.0",
|
||||
"@oxc-parser/binding-linux-s390x-gnu": "0.155.0",
|
||||
"@oxc-parser/binding-linux-x64-gnu": "0.155.0",
|
||||
"@oxc-parser/binding-linux-x64-musl": "0.155.0",
|
||||
"@oxc-parser/binding-openharmony-arm64": "0.155.0",
|
||||
"@oxc-parser/binding-win32-arm64-msvc": "0.155.0",
|
||||
"@oxc-parser/binding-win32-ia32-msvc": "0.155.0",
|
||||
"@oxc-parser/binding-win32-x64-msvc": "0.155.0"
|
||||
}
|
||||
},
|
||||
"node_modules/oxc-resolver": {
|
||||
@@ -4145,17 +4129,6 @@
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.15"
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown/node_modules/@oxc-project/types": {
|
||||
"version": "0.155.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz",
|
||||
"integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/oxc-project"
|
||||
}
|
||||
},
|
||||
"node_modules/sade": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
|
||||
@@ -4294,9 +4267,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte": {
|
||||
"version": "5.57.2",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.57.2.tgz",
|
||||
"integrity": "sha512-1YiPCAXT0Ct6g1vOMmSLa0Nsc3QRMvtDF32ihgglGVrugIuIK38RyDiFNXVDhtQ81TJjSO57NdMw6DyYLqSGDQ==",
|
||||
"version": "5.57.3",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.57.3.tgz",
|
||||
"integrity": "sha512-5mAftM3SoDV9X0zdF386F9p2pv8iKOwi/KfBS1XnBAkVCKFzVOLHUoa8iGWAt4buoicLmyWVRpuuD5wplXOQsg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -4321,9 +4294,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte-check": {
|
||||
"version": "4.7.7",
|
||||
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.7.tgz",
|
||||
"integrity": "sha512-Ge2IMdeTpbJuzNFGRiiMg0RWgbScysKQu7xwcyFJ22+DU9F5nPX51+Q3gHmGqRxYQMx2knreVWt5oCtfe0vf2g==",
|
||||
"version": "4.7.8",
|
||||
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.8.tgz",
|
||||
"integrity": "sha512-laZ49GFHZ3b0z2PWinJWL0syehc/PTR8aHaUaTiBkWJ+4Y38nhxjmXsSz7CbGa3VdKopViVbrBH3bGNqIAI0bQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -4742,14 +4715,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.5.tgz",
|
||||
"integrity": "sha512-cPODOMF8YnkiiYtDdHo6n4wWmBrOBBbOIYH2d33M4l3CdNn72h+qMmO6uXffUN6A5AZFXNND/d+krS9mgkXRfg==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz",
|
||||
"integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/mocker": "5.0.5",
|
||||
"@vitest/mocker": "5.1.0",
|
||||
"chai": "^6.3.0",
|
||||
"es-module-lexer": "^2.3.2",
|
||||
"expect-type": "^1.4.0",
|
||||
@@ -4775,12 +4748,12 @@
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/node": "^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "5.0.5",
|
||||
"@vitest/browser-preview": "5.0.5",
|
||||
"@vitest/browser-playwright": "5.1.0",
|
||||
"@vitest/browser-preview": "5.1.0",
|
||||
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
|
||||
"@vitest/coverage-istanbul": "5.0.5",
|
||||
"@vitest/coverage-v8": "5.0.5",
|
||||
"@vitest/ui": "5.0.5",
|
||||
"@vitest/coverage-istanbul": "5.1.0",
|
||||
"@vitest/coverage-v8": "5.1.0",
|
||||
"@vitest/ui": "5.1.0",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*",
|
||||
"vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
|
||||
@@ -4935,13 +4908,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/wxt": {
|
||||
"version": "0.21.4",
|
||||
"resolved": "https://registry.npmjs.org/wxt/-/wxt-0.21.4.tgz",
|
||||
"integrity": "sha512-iyVMTXb37BQAbsPHCuPzrK3ZxnO9pZmvbKl7VJWIHe3RG40On2NyP2FOjArtOITO96plEYnh3o+iUlRp9qE90w==",
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/wxt/-/wxt-0.21.5.tgz",
|
||||
"integrity": "sha512-naPKDK3LlU0M2LFJO3udw8ZEAB7DVQCGo26wllvSJQRVd3VaL9kiChjP8zWiVqm851uYkQ5pVI51hA5wjssO4g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@1natsu/wait-element": "^4.1.2",
|
||||
"@1natsu/wait-element": "^5.0.0",
|
||||
"@aklinker1/rollup-plugin-visualizer": "5.12.0",
|
||||
"@aklinker1/zero-zip": "^1.0.1",
|
||||
"@topcli/prompts": "^4.0.0",
|
||||
@@ -4955,7 +4928,6 @@
|
||||
"chokidar": "^5.0.0",
|
||||
"consola": "^3.4.2",
|
||||
"defu": "^6.1.4",
|
||||
"dotenv-expand": "^13.0.0",
|
||||
"filesize": "^11.0.17",
|
||||
"giget": "^1.2.3 || ^2.0.0 || ^3.0.0",
|
||||
"hookable": "^6.1.0",
|
||||
@@ -4964,7 +4936,7 @@
|
||||
"magicast": "^0.5.2",
|
||||
"nypm": "^0.6.5",
|
||||
"picomatch": "^4.0.3",
|
||||
"publish-browser-extension": "^5.1.0 || ^6.0.0",
|
||||
"publish-browser-extension": "^6.0.0",
|
||||
"superlock": "^1.3.2",
|
||||
"tiny-open": "^1.3.0",
|
||||
"tinyexec": "^1.2.4",
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "bookmarkmagic",
|
||||
"private": true,
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.1",
|
||||
"type": "module",
|
||||
"description": "Import, export & edit bookmarks between browsers — offline, no account, no cloud.",
|
||||
"license": "GPL-3.0-or-later",
|
||||
@@ -23,7 +23,7 @@
|
||||
"dev:firefox": "wxt -b firefox",
|
||||
"build": "wxt build",
|
||||
"zip": "wxt zip",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && tsc --noEmit && tsc -p tsconfig.scripts.json",
|
||||
"lint": "biome check .",
|
||||
"lint:fix": "biome check --write .",
|
||||
"knip": "knip",
|
||||
@@ -37,18 +37,18 @@
|
||||
"verify:full": "npm run verify && npm run coverage && npm run build && npm run check:manifest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "2.6.2",
|
||||
"@biomejs/biome": "2.6.4",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
||||
"@types/node": "^26.6.5",
|
||||
"@types/node": "^26.6.6",
|
||||
"@typescript/native": "npm:typescript@~7.0.2",
|
||||
"@vitest/coverage-v8": "^5.0.5",
|
||||
"@vitest/coverage-v8": "^5.1.0",
|
||||
"@wxt-dev/module-svelte": "^2.0.5",
|
||||
"jsdom": "^30.1.3",
|
||||
"knip": "^6.42.1",
|
||||
"svelte": "^5.57.2",
|
||||
"svelte-check": "^4.7.7",
|
||||
"knip": "^6.44.1",
|
||||
"svelte": "^5.57.3",
|
||||
"svelte-check": "^4.7.8",
|
||||
"typescript": "npm:@typescript/typescript6@~6.0.2",
|
||||
"vitest": "^5.0.5",
|
||||
"wxt": "^0.21.4"
|
||||
"vitest": "^5.1.0",
|
||||
"wxt": "^0.21.5"
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,8 @@ const REQUIRED_FILES = [
|
||||
'_locales/en/messages.json',
|
||||
'_locales/vi/messages.json',
|
||||
'_locales/ja/messages.json',
|
||||
'_locales/zh_CN/messages.json',
|
||||
'_locales/ro/messages.json',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
+58
-61
@@ -13,13 +13,14 @@
|
||||
* npm run build && node scripts/screenshots.mjs # serve on :4318
|
||||
* node scripts/screenshots.mjs --shoot # also capture PNGs
|
||||
*
|
||||
* Page URLs take `?theme=light|dark&lang=en|vi|ja&legal=0|1`, and the route as
|
||||
* the hash: http://localhost:4318/manager.html?theme=dark&lang=vi#edit
|
||||
* Page URLs take `?theme=light|dark&lang=en|vi|ja|zh-CN|ro&legal=0|1`, and the
|
||||
* route as the hash: http://localhost:4318/manager.html?theme=dark&lang=vi#edit
|
||||
*
|
||||
* `--shoot` drives a locally installed Chrome (CHROME_PATH, or the usual
|
||||
* install paths) headless, on a throwaway profile — never the user's own:
|
||||
* every route × theme × language at 1280×800 into `.output/qa-screens/` (for
|
||||
* review, git-ignored), the README set into `capture/`, and the store set into
|
||||
* every route × theme × language at 1280×800, plus the popup per theme ×
|
||||
* language at 360×420, into `.output/qa-screens/` (for review, git-ignored),
|
||||
* the README set into `capture/`, and the store set into
|
||||
* `store/screenshots/`. Dev tool only: nothing here ships, the server listens
|
||||
* on 127.0.0.1 alone, and it never touches the network beyond it.
|
||||
*/
|
||||
@@ -80,6 +81,11 @@ function shim() {
|
||||
] },
|
||||
{ id: '3', title: 'Mobile bookmarks', children: [b('Read later', 'https://later.example.com/')] },
|
||||
] }];
|
||||
// Chrome gives every node but the root a parentId, and the product relies on
|
||||
// it: without one, nothing can be placed beside a sibling (drag, Alt+↑/↓) and
|
||||
// the toolbar's Sort has no folder to act on.
|
||||
const adopt = (nodes, parentId) => { for (const n of nodes) { if (parentId !== undefined) n.parentId = parentId; if (n.children) adopt(n.children, n.id); } };
|
||||
adopt(tree);
|
||||
const byId = (id, nodes = tree) => { for (const n of nodes) { if (n.id === id) return n; const hit = n.children && byId(id, n.children); if (hit) return hit; } };
|
||||
const parentOf = (id, nodes = tree) => { for (const n of nodes) { if (n.children?.some((c) => c.id === id)) return n; const hit = n.children && parentOf(id, n.children); if (hit) return hit; } };
|
||||
const clone = (v) => structuredClone(v);
|
||||
@@ -88,7 +94,7 @@ function shim() {
|
||||
getTree: async () => clone(tree),
|
||||
create: async ({ parentId, title, url, index }) => { const p = byId(parentId); const n = url ? { id: String(next++), parentId, title, url, dateAdded: Date.now() } : { id: String(next++), parentId, title, dateAdded: Date.now(), children: [] }; const at = index ?? p.children.length; p.children.splice(at, 0, n); events.onCreated.fire(n.id, clone({ ...n, index: at })); return clone(n); },
|
||||
update: async (id, changes) => { Object.assign(byId(id), changes); events.onChanged.fire(id, changes); },
|
||||
move: async (id, { parentId, index }) => { const from = parentOf(id); const n = byId(id); const old = from.children.indexOf(n); from.children.splice(old, 1); const to = byId(parentId ?? from.id); let at = index ?? to.children.length; if (to === from && at > old) at--; to.children.splice(at, 0, n); events.onMoved.fire(id, { parentId: to.id, index: at, oldParentId: from.id, oldIndex: old }); },
|
||||
move: async (id, { parentId, index }) => { const from = parentOf(id); const n = byId(id); const old = from.children.indexOf(n); from.children.splice(old, 1); const to = byId(parentId ?? from.id); let at = index ?? to.children.length; if (to === from && at > old) at--; to.children.splice(at, 0, n); n.parentId = to.id; events.onMoved.fire(id, { parentId: to.id, index: at, oldParentId: from.id, oldIndex: old }); },
|
||||
remove: async (id) => { const p = parentOf(id); p.children = p.children.filter((c) => c.id !== id); events.onRemoved.fire(id, {}); },
|
||||
};
|
||||
bookmarks.removeTree = bookmarks.remove;
|
||||
@@ -214,21 +220,51 @@ function findChrome() {
|
||||
* @param {string} file @param {string} size
|
||||
*/
|
||||
async function shoot(chrome, profile, url, file, size) {
|
||||
await run(
|
||||
chrome,
|
||||
[
|
||||
'--headless=new',
|
||||
`--user-data-dir=${profile}`,
|
||||
'--no-first-run',
|
||||
'--disable-gpu',
|
||||
'--hide-scrollbars',
|
||||
`--window-size=${size}`,
|
||||
'--virtual-time-budget=4000',
|
||||
`--screenshot=${file}`,
|
||||
url,
|
||||
],
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
const flags = ['--headless=new', '--no-first-run', '--disable-gpu', '--hide-scrollbars'];
|
||||
const page = [`--window-size=${size}`, '--virtual-time-budget=4000', `--screenshot=${file}`];
|
||||
await run(chrome, [...flags, `--user-data-dir=${profile}`, ...page, url], { timeout: 60_000 });
|
||||
}
|
||||
|
||||
/** `LOCALES` (resolve-locale.ts), which .mjs cannot import — touch-points.test.ts pins it. */
|
||||
const LANGS = ['en', 'vi', 'ja', 'zh-CN', 'ro'];
|
||||
|
||||
/**
|
||||
* Every screenshot `--shoot` takes, as [url, file, window size] (docs/11 §5):
|
||||
* the QA sweep — each route × theme × locale, plus the popup, the narrowest
|
||||
* surface (340 px) and where a long translation overflows first — then the
|
||||
* README set and the store set, both English.
|
||||
*
|
||||
* @param {{ qa: string, capture: string, store: string }} dirs
|
||||
* @returns {[url: string, file: string, size: string][]}
|
||||
*/
|
||||
function shotList({ qa, capture, store }) {
|
||||
const origin = `http://${HOST}:${PORT}`;
|
||||
const page = (/** @type {string} */ query, /** @type {string} */ route) =>
|
||||
`${origin}/manager.html?${query}#${route}`;
|
||||
const routes = ['import', 'export', 'edit', 'settings', 'about'];
|
||||
/** @type {[string, string, string][]} */
|
||||
const jobs = [];
|
||||
for (const lang of LANGS) {
|
||||
for (const theme of ['light', 'dark']) {
|
||||
const query = `theme=${theme}&lang=${lang}`;
|
||||
for (const route of routes) {
|
||||
jobs.push([page(query, route), join(qa, `${route}-${theme}-${lang}.png`), '1280,800']);
|
||||
}
|
||||
jobs.push([
|
||||
`${origin}/popup.html?${query}`,
|
||||
join(qa, `popup-${theme}-${lang}.png`),
|
||||
'360,420',
|
||||
]);
|
||||
}
|
||||
}
|
||||
for (const route of routes) {
|
||||
jobs.push([page('theme=light&lang=en', route), join(capture, `${route}.png`), '1280,800']);
|
||||
}
|
||||
for (const route of ['edit', 'export', 'import']) {
|
||||
jobs.push([page('theme=dark&lang=en', route), join(store, `${route}.png`), '1280,800']);
|
||||
}
|
||||
jobs.push([`${origin}/popup.html?theme=light&lang=en`, join(capture, 'popup.png'), '360,420']);
|
||||
return jobs;
|
||||
}
|
||||
|
||||
if (!existsSync(join(OUT, 'manifest.json'))) {
|
||||
@@ -248,49 +284,10 @@ if (!existsSync(join(OUT, 'manifest.json'))) {
|
||||
const store = join(ROOT, 'store', 'screenshots');
|
||||
for (const dir of [qa, capture, store]) mkdirSync(dir, { recursive: true });
|
||||
const profile = mkdtempSync(join(tmpdir(), 'bookmarkmagic-harness-'));
|
||||
const page = (/** @type {string} */ query, /** @type {string} */ route) =>
|
||||
`http://${HOST}:${PORT}/manager.html?${query}#${route}`;
|
||||
const ROUTES = ['import', 'export', 'edit', 'settings', 'about'];
|
||||
try {
|
||||
for (const lang of ['en', 'vi', 'ja']) {
|
||||
for (const theme of ['light', 'dark']) {
|
||||
for (const route of ROUTES) {
|
||||
const file = join(qa, `${route}-${theme}-${lang}.png`);
|
||||
await shoot(
|
||||
chrome,
|
||||
profile,
|
||||
page(`theme=${theme}&lang=${lang}`, route),
|
||||
file,
|
||||
'1280,800',
|
||||
);
|
||||
}
|
||||
}
|
||||
for (const [url, file, size] of shotList({ qa, capture, store })) {
|
||||
await shoot(chrome, profile, url, file, size);
|
||||
}
|
||||
for (const route of ROUTES) {
|
||||
await shoot(
|
||||
chrome,
|
||||
profile,
|
||||
page('theme=light&lang=en', route),
|
||||
join(capture, `${route}.png`),
|
||||
'1280,800',
|
||||
);
|
||||
}
|
||||
for (const route of ['edit', 'export', 'import']) {
|
||||
await shoot(
|
||||
chrome,
|
||||
profile,
|
||||
page('theme=dark&lang=en', route),
|
||||
join(store, `${route}.png`),
|
||||
'1280,800',
|
||||
);
|
||||
}
|
||||
await shoot(
|
||||
chrome,
|
||||
profile,
|
||||
`http://${HOST}:${PORT}/popup.html?theme=light&lang=en`,
|
||||
join(capture, 'popup.png'),
|
||||
'360,420',
|
||||
);
|
||||
} finally {
|
||||
rmSync(profile, { recursive: true, force: true });
|
||||
server.close();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { onMount, tick } from 'svelte';
|
||||
import AboutTab from '@/lib/components/AboutTab.svelte';
|
||||
import EditTab from '@/lib/components/EditTab.svelte';
|
||||
import ExportTab from '@/lib/components/ExportTab.svelte';
|
||||
@@ -11,6 +11,7 @@
|
||||
import TabBar from '@/lib/components/TabBar.svelte';
|
||||
import ThemeToggle from '@/lib/components/ThemeToggle.svelte';
|
||||
import Toast from '@/lib/components/Toast.svelte';
|
||||
import { focusIfLost } from '@/lib/components/focus-heading';
|
||||
import Icon from '@/lib/components/icons/Icon.svelte';
|
||||
import { t } from '@/lib/i18n/index.svelte';
|
||||
import { isWriting } from '@/lib/stores/import-session.svelte';
|
||||
@@ -52,6 +53,20 @@
|
||||
document.title = `${t(ROUTE_KEYS[getRoute()])} · ${t('common.appName')}`;
|
||||
});
|
||||
|
||||
// A route change can take the focused control with it — "Open in Edit" on
|
||||
// the import report unmounts the button that was clicked — and focus then
|
||||
// falls to <body>, back at the top of the page. It goes to <main> instead.
|
||||
// Only when it was lost — the tab and status-bar buttons keep theirs — and
|
||||
// never while the page is loading: `startRouting` reads the hash on mount,
|
||||
// which is a route change to this effect and not to the user, and a fresh
|
||||
// load must not move focus by itself.
|
||||
let routeSettled = false;
|
||||
$effect(() => {
|
||||
void getRoute();
|
||||
if (!routeSettled) return;
|
||||
void tick().then(() => focusIfLost(mainEl));
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
// The tab bar and the footer already refuse to navigate mid-write. This
|
||||
// closes the third door: browser Back, which fires `hashchange` directly
|
||||
@@ -61,6 +76,10 @@
|
||||
isBlocked: isWriting,
|
||||
onBlocked: () => pushToast(t('common.busy'), 'info'),
|
||||
});
|
||||
// After the route the hash named has rendered (see the effect above).
|
||||
void tick().then(() => {
|
||||
routeSettled = true;
|
||||
});
|
||||
|
||||
// Leaving mid-write would kill the queue with the tab (docs/03 §5).
|
||||
const onBeforeUnload = (event: BeforeUnloadEvent): void => {
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
|
||||
.settings {
|
||||
display: inline-flex;
|
||||
padding: 3px;
|
||||
padding: 4px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius-sm);
|
||||
background: none;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import { browser } from 'wxt/browser';
|
||||
import type { CsvDelimiter } from '../core/csv-dialect';
|
||||
import type { MarkdownStyle } from '../core/serialize/markdown';
|
||||
import type { Locale } from '../i18n/resolve-locale';
|
||||
import { LOCALES, type Locale } from '../i18n/resolve-locale';
|
||||
import { record } from './diagnostics';
|
||||
|
||||
export type ThemePreference = 'system' | 'light' | 'dark';
|
||||
@@ -55,7 +55,7 @@ function coerceSettings(raw: unknown): Settings {
|
||||
allowed.includes(raw[key] as Settings[K]) ? (raw[key] as Settings[K]) : DEFAULT_SETTINGS[key];
|
||||
|
||||
return {
|
||||
locale: pick('locale', ['auto', 'en', 'vi', 'ja']),
|
||||
locale: pick('locale', ['auto', ...LOCALES]),
|
||||
theme: pick('theme', ['system', 'light', 'dark']),
|
||||
defaultExportFormat: pick('defaultExportFormat', [
|
||||
'netscape-html',
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { getAppVersion } from '../browser/app-info';
|
||||
import { dateTime, t } from '../i18n/index.svelte';
|
||||
import { CHANGELOG_URL, DONATE_LINKS, ISSUES_URL, LEGAL_URLS, REPO_URL, STORE_URL } from '../links';
|
||||
import {
|
||||
ACCESSIBILITY_URL,
|
||||
CHANGELOG_URL,
|
||||
DONATE_LINKS,
|
||||
ISSUES_URL,
|
||||
LEGAL_URLS,
|
||||
REPO_URL,
|
||||
STORE_URL,
|
||||
} from '../links';
|
||||
import { copyToClipboard } from '../browser/clipboard';
|
||||
import { snapshot } from '../browser/diagnostics';
|
||||
import { getAcceptance } from '../stores/legal.svelte';
|
||||
@@ -47,6 +55,11 @@
|
||||
{t('about.changelog')}<Icon name="external" size={12} />
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href={ACCESSIBILITY_URL} target="_blank" rel="noopener noreferrer">
|
||||
{t('about.accessibility')}<Icon name="external" size={12} />
|
||||
</a>
|
||||
</li>
|
||||
<li><a href={STORE_URL} target="_blank" rel="noopener noreferrer">{t('about.store')}<Icon name="external" size={12} /></a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<script lang="ts">
|
||||
/**
|
||||
* The chevron that opens a folder — docs/06 §5. One component for the #edit
|
||||
* tree, the import preview and the export picker, so the three cannot drift.
|
||||
*
|
||||
* With a `label` it is a real disclosure button: `aria-expanded`, a name,
|
||||
* a tab stop. Without one it is the #edit tree's mouse shortcut — the tree
|
||||
* itself carries `aria-expanded` and the arrow keys, so the button is hidden
|
||||
* from assistive technology and is not a tab stop. With no `expanded` at all
|
||||
* the row has nothing to open, and an empty slot keeps the columns aligned.
|
||||
*
|
||||
* The glyph is 16 px; the target is 24 (WCAG 2.5.8), grown by a pseudo-element
|
||||
* so the row's layout does not change.
|
||||
*/
|
||||
import Icon from './icons/Icon.svelte';
|
||||
|
||||
interface Props {
|
||||
expanded?: boolean | undefined;
|
||||
label?: string | undefined;
|
||||
onclick?: (event: MouseEvent) => void;
|
||||
}
|
||||
|
||||
let { expanded, label, onclick }: Props = $props();
|
||||
</script>
|
||||
|
||||
{#if expanded === undefined}
|
||||
<span class="disclosure" aria-hidden="true"></span>
|
||||
{:else if label === undefined}
|
||||
<button class="disclosure" tabindex="-1" aria-hidden="true" {onclick}>
|
||||
<Icon name="chevron" size={12} turned={expanded} />
|
||||
</button>
|
||||
{:else}
|
||||
<button class="disclosure" aria-expanded={expanded} aria-label={label} {onclick}>
|
||||
<Icon name="chevron" size={12} turned={expanded} />
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.disclosure {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
flex: none;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--fg-muted);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -4px;
|
||||
}
|
||||
</style>
|
||||
@@ -91,6 +91,18 @@
|
||||
background-color: var(--accent-subtle);
|
||||
}
|
||||
|
||||
/* The dashed edge is four background gradients, and a contrast theme removes
|
||||
background images: the zone lost its boundary altogether (docs/06 §5). */
|
||||
@media (forced-colors: active) {
|
||||
.zone {
|
||||
border: 2px dashed ButtonText;
|
||||
}
|
||||
|
||||
.dragging {
|
||||
border-color: Highlight;
|
||||
}
|
||||
}
|
||||
|
||||
.glyph {
|
||||
display: inline-flex;
|
||||
padding: var(--sp-3);
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<script lang="ts">
|
||||
/**
|
||||
* The #edit tab's dialogs — docs/06 §3.3: "Move to…" and the three
|
||||
* confirmations (delete, keep the first of each, Sort A→Z). Markup only:
|
||||
* what each one asks comes from the session, and what happens after a
|
||||
* confirmation — the command, and where focus goes once it is done
|
||||
* (docs/06 §5) — is the tab's, passed in.
|
||||
*/
|
||||
import { countDescendants, displayTitle } from '../edit/edit-node';
|
||||
import { moveTargets } from '../edit/move-target';
|
||||
import { t, tPlural } from '../i18n/index.svelte';
|
||||
import type { EditSession } from '../stores/edit-session.svelte';
|
||||
import ConfirmDialog from './ConfirmDialog.svelte';
|
||||
import MoveToDialog from './MoveToDialog.svelte';
|
||||
|
||||
interface Props {
|
||||
session: EditSession;
|
||||
ondelete: () => void;
|
||||
onkeepFirst: () => void;
|
||||
onsort: () => void;
|
||||
}
|
||||
|
||||
let { session, ondelete, onkeepFirst, onsort }: Props = $props();
|
||||
|
||||
// Only while the dialog is open: it walks every folder in the tree.
|
||||
const targets = $derived(
|
||||
session.movingNode === undefined ? [] : moveTargets(session.roots, session.movingNode),
|
||||
);
|
||||
const descendantCount = $derived(countDescendants(session.pendingDelete));
|
||||
const pendingTitle = $derived(displayTitle(session.pendingDelete, t('edit.untitled')));
|
||||
</script>
|
||||
|
||||
<MoveToDialog
|
||||
node={session.movingNode}
|
||||
{targets}
|
||||
onpick={(parentId) => {
|
||||
const id = session.movingNode?.id;
|
||||
session.movingNode = undefined;
|
||||
if (id !== undefined) void session.moveTo(id, { parentId });
|
||||
}}
|
||||
oncancel={() => (session.movingNode = undefined)}
|
||||
/>
|
||||
|
||||
<ConfirmDialog
|
||||
open={session.pendingDelete !== undefined}
|
||||
danger
|
||||
title={t('edit.deleteTitle')}
|
||||
body={descendantCount > 0
|
||||
? tPlural('edit.deleteFolderBody', descendantCount, { title: pendingTitle })
|
||||
: t('edit.deleteBody', { title: pendingTitle })}
|
||||
confirmLabel={t('edit.delete')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onconfirm={ondelete}
|
||||
oncancel={() => (session.pendingDelete = undefined)}
|
||||
/>
|
||||
|
||||
<ConfirmDialog
|
||||
open={session.pendingKeepFirst}
|
||||
danger
|
||||
title={t('edit.keepFirstTitle')}
|
||||
body={tPlural(
|
||||
'edit.keepFirstBody',
|
||||
session.duplicateGroups.reduce((n, g) => n + g.nodes.length - 1, 0),
|
||||
)}
|
||||
confirmLabel={t('edit.delete')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onconfirm={onkeepFirst}
|
||||
oncancel={() => (session.pendingKeepFirst = false)}
|
||||
/>
|
||||
|
||||
<ConfirmDialog
|
||||
open={session.pendingSort !== undefined}
|
||||
title={t('edit.sortTitle', { title: displayTitle(session.pendingSort?.folder, t('edit.untitled')) })}
|
||||
body={tPlural('edit.sortBody', session.pendingSort?.moves.length ?? 0)}
|
||||
confirmLabel={t('edit.sort')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onconfirm={onsort}
|
||||
oncancel={() => (session.pendingSort = undefined)}
|
||||
/>
|
||||
@@ -2,65 +2,39 @@
|
||||
/**
|
||||
* The #edit tab — docs/03 §3, docs/06 §3.3. Markup and wiring only: state
|
||||
* and commands live in `stores/edit-session.svelte.ts`, live events in
|
||||
* `edit/live-sync.ts`.
|
||||
* `edit/live-sync.ts` (wired by `stores/edit-live.ts`), the dialogs' markup
|
||||
* in `EditDialogs.svelte`.
|
||||
*/
|
||||
import { onMount, tick, untrack } from 'svelte';
|
||||
import { subscribe } from '../browser/bookmarks';
|
||||
import { copyToClipboard } from '../browser/clipboard';
|
||||
import { openBookmarkUrl } from '../browser/open-url';
|
||||
import { countDescendants, displayTitle, toEditNode } from '../edit/edit-node';
|
||||
import { createBatcher } from '../edit/live-sync';
|
||||
import { moveTargets } from '../edit/move-target';
|
||||
import { displayTitle } from '../edit/edit-node';
|
||||
import { type EditNode, findNode } from '../edit/patch-tree';
|
||||
import { onTreeKey } from '../edit/tree-keys';
|
||||
import { getLocale, num, t, tPlural } from '../i18n/index.svelte';
|
||||
import { getLocale, num, t } from '../i18n/index.svelte';
|
||||
import { connectLive } from '../stores/edit-live';
|
||||
import { EditSession } from '../stores/edit-session.svelte';
|
||||
import { pushToast } from '../stores/toast.svelte';
|
||||
import ConfirmDialog from './ConfirmDialog.svelte';
|
||||
import DuplicatePanel from './DuplicatePanel.svelte';
|
||||
import EditDialogs from './EditDialogs.svelte';
|
||||
import EditToolbar from './EditToolbar.svelte';
|
||||
import ErrorCallout from './ErrorCallout.svelte';
|
||||
import { focusIfLost } from './focus-heading';
|
||||
import MoveToDialog from './MoveToDialog.svelte';
|
||||
import TreeList from './TreeList.svelte';
|
||||
|
||||
const session = new EditSession(undefined, getLocale);
|
||||
let searchInput = $state<HTMLInputElement | undefined>();
|
||||
let treeEl = $state<HTMLElement | undefined>();
|
||||
let panelEl = $state<HTMLElement | undefined>();
|
||||
/** What Alt+↑/↓ just did, for the live region below (docs/06 §5). */
|
||||
let announcement = $state('');
|
||||
|
||||
onMount(() => {
|
||||
void session.load();
|
||||
// One patch per frame, and a single re-read for bursts — an import in
|
||||
// another tab sends an event per node (docs/03 §3 "Live sync").
|
||||
const batcher = createBatcher({
|
||||
onFlush: session.applyLiveEvents,
|
||||
onBurst: () => void session.load(),
|
||||
});
|
||||
let importing = false;
|
||||
// Listeners attach on enter and detach on leave: a tab left subscribed
|
||||
// during an import would take one event per created node.
|
||||
const unsubscribe = subscribe({
|
||||
onCreated: (_id, node) => {
|
||||
if (importing || node.parentId === undefined) return;
|
||||
batcher.push({ kind: 'created', parentId: node.parentId, index: node.index, node: toEditNode(node) });
|
||||
},
|
||||
onRemoved: (id) => batcher.push({ kind: 'removed', id }),
|
||||
onChanged: (id, changes) => batcher.push({ kind: 'changed', id, changes }),
|
||||
onMoved: (id, info) => batcher.push({ kind: 'moved', id, ...info }),
|
||||
onChildrenReordered: () => batcher.resync(),
|
||||
onImportBegan: () => {
|
||||
importing = true;
|
||||
},
|
||||
onImportEnded: () => {
|
||||
importing = false;
|
||||
batcher.resync();
|
||||
},
|
||||
});
|
||||
const disconnect = connectLive(session);
|
||||
globalThis.addEventListener('keydown', onWindowKeydown);
|
||||
return () => {
|
||||
unsubscribe();
|
||||
batcher.dispose();
|
||||
disconnect();
|
||||
session.dispose();
|
||||
globalThis.removeEventListener('keydown', onWindowKeydown);
|
||||
};
|
||||
@@ -82,12 +56,6 @@
|
||||
if (node === undefined) return undefined;
|
||||
return node.url === undefined ? node : findNode(session.roots, node.parentId ?? '');
|
||||
});
|
||||
// Only while the dialog is open: it walks every folder in the tree.
|
||||
const targets = $derived(
|
||||
session.movingNode === undefined ? [] : moveTargets(session.roots, session.movingNode),
|
||||
);
|
||||
const descendantCount = $derived(countDescendants(session.pendingDelete));
|
||||
const pendingTitle = $derived(displayTitle(session.pendingDelete, t('edit.untitled')));
|
||||
|
||||
const partialNote = $derived.by(() => {
|
||||
const partial = session.actionError?.partial;
|
||||
@@ -114,8 +82,32 @@
|
||||
pushToast(t(copied ? 'edit.copied' : 'edit.copyFailed'), copied ? 'success' : 'danger');
|
||||
}
|
||||
|
||||
/**
|
||||
* Alt+↑ / Alt+↓. The row's `aria-posinset` changes, but a screen reader does
|
||||
* not re-read the active descendant for that — so the new place is spoken.
|
||||
*/
|
||||
async function nudge(id: string, direction: -1 | 1): Promise<void> {
|
||||
const placed = await session.nudge(id, direction);
|
||||
if (placed === undefined) return;
|
||||
// Emptied first: a region set to the text it already holds says nothing,
|
||||
// and two rows of one name can land on one position.
|
||||
announcement = '';
|
||||
await tick();
|
||||
announcement = t('edit.movedPosition', {
|
||||
title: displayTitle(findNode(session.roots, id), t('edit.untitled')),
|
||||
position: num(placed.position),
|
||||
total: num(placed.total),
|
||||
});
|
||||
await tick();
|
||||
treeEl?.querySelector(`[data-node-id="${CSS.escape(id)}"]`)?.scrollIntoView({ block: 'nearest' });
|
||||
}
|
||||
|
||||
function onKeydown(event: KeyboardEvent): void {
|
||||
onTreeKey(event, session, { open: (node) => void open(node), copy: (node) => void copy(node) });
|
||||
onTreeKey(event, session, {
|
||||
open: (node) => void open(node),
|
||||
copy: (node) => void copy(node),
|
||||
nudge: (id, direction) => void nudge(id, direction),
|
||||
});
|
||||
}
|
||||
|
||||
/** ⌘/Ctrl-F focuses the search box, whatever the case of the F (docs/06 §3.3). */
|
||||
@@ -143,6 +135,18 @@
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A bulk command disables the button that started it for as long as it runs
|
||||
* (Sort A→Z), or removes it with what it deleted (keep-first), and the
|
||||
* closing dialog cannot return focus to either. Once the command is over,
|
||||
* a focus that fell to `<body>` is put somewhere deliberate.
|
||||
*/
|
||||
async function afterBulk(run: Promise<void>, target: () => HTMLElement | null | undefined): Promise<void> {
|
||||
await run;
|
||||
await tick();
|
||||
focusIfLost(target());
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if session.loadError !== undefined}
|
||||
@@ -194,52 +198,19 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<MoveToDialog
|
||||
node={session.movingNode}
|
||||
{targets}
|
||||
onpick={(parentId) => {
|
||||
const id = session.movingNode?.id;
|
||||
session.movingNode = undefined;
|
||||
if (id !== undefined) void session.moveTo(id, { parentId });
|
||||
}}
|
||||
oncancel={() => (session.movingNode = undefined)}
|
||||
/>
|
||||
<!-- Always in the page, and only its text changes: a region inserted already
|
||||
filled is not reliably announced (the same rule as ImportAnnouncer). -->
|
||||
<p class="sr-only" role="status" aria-live="polite">{announcement}</p>
|
||||
|
||||
<ConfirmDialog
|
||||
open={session.pendingDelete !== undefined}
|
||||
danger
|
||||
title={t('edit.deleteTitle')}
|
||||
body={descendantCount > 0
|
||||
? tPlural('edit.deleteFolderBody', descendantCount, { title: pendingTitle })
|
||||
: t('edit.deleteBody', { title: pendingTitle })}
|
||||
confirmLabel={t('edit.delete')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onconfirm={() => void confirmDelete()}
|
||||
oncancel={() => (session.pendingDelete = undefined)}
|
||||
/>
|
||||
|
||||
<ConfirmDialog
|
||||
open={session.pendingKeepFirst}
|
||||
danger
|
||||
title={t('edit.keepFirstTitle')}
|
||||
body={tPlural(
|
||||
'edit.keepFirstBody',
|
||||
session.duplicateGroups.reduce((n, g) => n + g.nodes.length - 1, 0),
|
||||
)}
|
||||
confirmLabel={t('edit.delete')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onconfirm={() => void session.keepFirst()}
|
||||
oncancel={() => (session.pendingKeepFirst = false)}
|
||||
/>
|
||||
|
||||
<ConfirmDialog
|
||||
open={session.pendingSort !== undefined}
|
||||
title={t('edit.sortTitle', { title: displayTitle(session.pendingSort?.folder, t('edit.untitled')) })}
|
||||
body={tPlural('edit.sortBody', session.pendingSort?.moves.length ?? 0)}
|
||||
confirmLabel={t('edit.sort')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onconfirm={() => void session.confirmSort()}
|
||||
oncancel={() => (session.pendingSort = undefined)}
|
||||
<EditDialogs
|
||||
{session}
|
||||
ondelete={() => void confirmDelete()}
|
||||
onkeepFirst={() =>
|
||||
void afterBulk(
|
||||
session.keepFirst(),
|
||||
() => panelEl?.querySelector<HTMLElement>('[data-panel-close]') ?? treeEl,
|
||||
)}
|
||||
onsort={() => void afterBulk(session.confirmSort(), () => treeEl)}
|
||||
/>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
markdownStyle = settings.markdownStyle;
|
||||
} catch (err) {
|
||||
// Was `err.detail` alone — a raw English Chrome string as the entire
|
||||
// screen, in all three languages (docs/02 §7).
|
||||
// screen, in every language (docs/02 §7).
|
||||
loadError = describeError(err);
|
||||
} finally {
|
||||
loading = false;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import type { LiveNode } from '../browser/bookmarks';
|
||||
import type { CheckState } from '../core/select';
|
||||
import { num, t, tPlural } from '../i18n/index.svelte';
|
||||
import Disclosure from './Disclosure.svelte';
|
||||
import Icon from './icons/Icon.svelte';
|
||||
import Self from './FolderPickNode.svelte';
|
||||
|
||||
@@ -40,18 +41,13 @@
|
||||
keyboard interface, and a tree role promised arrow keys it never had (uM5). -->
|
||||
<li>
|
||||
<div class="row" style:--depth={depth - 1}>
|
||||
{#if folders.length > 0}
|
||||
<button
|
||||
class="disclosure"
|
||||
aria-expanded={expanded}
|
||||
aria-label={`${expanded ? t('import.collapse') : t('import.expand')}: ${node.title}`}
|
||||
onclick={() => {
|
||||
expanded = !expanded;
|
||||
}}><Icon name="chevron" size={12} turned={expanded} /></button
|
||||
>
|
||||
{:else}
|
||||
<span class="disclosure" aria-hidden="true"></span>
|
||||
{/if}
|
||||
<Disclosure
|
||||
expanded={folders.length > 0 ? expanded : undefined}
|
||||
label={`${expanded ? t('import.collapse') : t('import.expand')}: ${node.title}`}
|
||||
onclick={() => {
|
||||
expanded = !expanded;
|
||||
}}
|
||||
/>
|
||||
|
||||
<label>
|
||||
<input
|
||||
@@ -113,20 +109,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.disclosure {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
flex: none;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--fg-muted);
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.glyph {
|
||||
display: inline-flex;
|
||||
color: var(--accent);
|
||||
@@ -156,6 +138,7 @@
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--accent);
|
||||
cursor: pointer;
|
||||
padding: 1px var(--sp-2);
|
||||
/* 24 px tall: an 18 px line, 2 px of padding, the border (WCAG 2.5.8). */
|
||||
padding: 2px var(--sp-2);
|
||||
}
|
||||
</style>
|
||||
@@ -65,6 +65,14 @@
|
||||
box-shadow: inset 3px 0 0 var(--accent);
|
||||
}
|
||||
|
||||
/* The radio still says which is chosen; the card around it should too. */
|
||||
@media (forced-colors: active) {
|
||||
.selected {
|
||||
outline: 2px solid Highlight;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
@@ -111,6 +111,14 @@
|
||||
box-shadow: inset 3px 0 0 var(--danger);
|
||||
}
|
||||
|
||||
/* The radio still says which is chosen; the card around it should too. */
|
||||
@media (forced-colors: active) {
|
||||
.mode.selected {
|
||||
outline: 2px solid Highlight;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
}
|
||||
|
||||
.mode input {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,12 @@
|
||||
onchange={(event) => select(event.currentTarget.value)}
|
||||
>
|
||||
{#each LOCALE_CHOICES as choice (choice.value)}
|
||||
<option value={choice.value}>{t(choice.labelKey)}</option>
|
||||
<!-- Each endonym in its own language: a screen reader voices "简体中文"
|
||||
as Chinese and Chrome draws it with Chinese glyphs, whatever the UI
|
||||
language is (docs/07 §2). "Automatic" is in the UI language. -->
|
||||
<option value={choice.value} lang={choice.value === 'auto' ? undefined : choice.value}>
|
||||
{t(choice.labelKey)}
|
||||
</option>
|
||||
{/each}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
// The localized recovery sentence is the message; the raw browser error
|
||||
// is the separate technical detail (docs/02 §7). Showing `detail` in its
|
||||
// place made legal.saveFailed dead in all three locales — at the one
|
||||
// place made legal.saveFailed dead in every locale — at the one
|
||||
// moment a first-run user most needs an actionable instruction.
|
||||
saveFailed = true;
|
||||
saveDetail = outcome.detail;
|
||||
|
||||
@@ -85,7 +85,9 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_noninteractive_element_interactions -->
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_noninteractive_element_interactions —
|
||||
the click is the backdrop's (it lands on the dialog element), a pointer
|
||||
shortcut for what Esc and the Dismiss button already do from the keyboard. -->
|
||||
<dialog
|
||||
bind:this={dialog}
|
||||
class:danger
|
||||
@@ -170,7 +172,8 @@
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--fg-muted);
|
||||
cursor: pointer;
|
||||
padding: 2px;
|
||||
/* 24 × 24 px with its 16 px glyph (WCAG 2.5.8). */
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.dismiss:hover {
|
||||
|
||||
@@ -107,6 +107,11 @@
|
||||
background: var(--accent-subtle);
|
||||
}
|
||||
|
||||
/* Inset: the list scrolls, so it clips the global ring drawn outside. */
|
||||
button:focus-visible {
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.label {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
const percent = $derived(total === 0 ? 0 : Math.round((done / total) * 100));
|
||||
// Announce every 10% rather than on every tick — docs/06 §5.
|
||||
const announced = $derived(Math.floor(percent / 10) * 10);
|
||||
// Not run through Intl (unlike counts elsewhere): this is 0–100, and none of
|
||||
// en-US/vi-VN/ja-JP groups a two-digit number — so it would cost a formatter
|
||||
// Not run through Intl (unlike counts elsewhere): this is 0–100, and no
|
||||
// shipped locale groups a two-digit number — so it would cost a formatter
|
||||
// lookup on the hottest render path in the app and change nothing.
|
||||
</script>
|
||||
|
||||
@@ -58,6 +58,14 @@
|
||||
background-size: 17px 17px;
|
||||
}
|
||||
|
||||
/* A contrast theme removes the fill's colour and stripes: without a system
|
||||
colour the bar is an empty box at every percentage (docs/06 §5). */
|
||||
@media (forced-colors: active) {
|
||||
.fill {
|
||||
background-color: Highlight;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
margin: 0;
|
||||
font-family: var(--font-mono);
|
||||
|
||||
@@ -5,10 +5,16 @@
|
||||
* writing ones are disabled while a bulk command runs: a second sort started
|
||||
* from a row used to fail with two false messages and re-enable the toolbar
|
||||
* mid-sort (v1.1.0 review).
|
||||
*
|
||||
* A click hands focus back to the tree: Chrome focuses a `tabindex="-1"`
|
||||
* button when it is clicked, and the tree ignores keys aimed at a row's own
|
||||
* control, so the arrow keys went dead until the next click on a row. Each
|
||||
* button is 24 × 24 px — the 14 px glyph, 4 px of padding, a 1 px border.
|
||||
*/
|
||||
import type { EditNode } from '../edit/patch-tree';
|
||||
import { t } from '../i18n/index.svelte';
|
||||
import type { EditSession } from '../stores/edit-session.svelte';
|
||||
import { focusOwningTree } from './focus-heading';
|
||||
import Icon from './icons/Icon.svelte';
|
||||
|
||||
interface Props {
|
||||
@@ -22,10 +28,18 @@
|
||||
|
||||
let { node, session, editable, onopen, oncopy, onsort }: Props = $props();
|
||||
|
||||
/** A row button must not also focus or activate the row under it. */
|
||||
/**
|
||||
* A row button must not also focus or activate the row under it. Focus moves
|
||||
* to the tree BEFORE the action runs, so a dialog the action opens remembers
|
||||
* the tree — not this button — as where to return.
|
||||
*/
|
||||
function act(run: () => void): (event: MouseEvent) => void {
|
||||
return (event) => {
|
||||
event.stopPropagation();
|
||||
// With no row focused yet, this one is: the tree would otherwise start
|
||||
// its arrow keys from the top, a screenful away from the click.
|
||||
session.focusedId ??= node.id;
|
||||
focusOwningTree(event.currentTarget);
|
||||
run();
|
||||
};
|
||||
}
|
||||
@@ -69,7 +83,7 @@
|
||||
button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 3px;
|
||||
padding: 4px;
|
||||
background: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius-sm);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
// The LOCALIZED sentence is the message; the raw browser error is the
|
||||
// separate technical detail docs/02 §7 asks for. Putting `detail` first
|
||||
// made every translation of settings.saveFailed dead code and showed a
|
||||
// VI/JA user an untranslated Chrome string.
|
||||
// non-English user an untranslated Chrome string.
|
||||
pushToast(t('settings.saveFailed'), 'danger');
|
||||
saveDetail = outcome.detail;
|
||||
});
|
||||
|
||||
@@ -113,4 +113,17 @@
|
||||
footer button:disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* The current section was a colour and a fill, both of which a contrast
|
||||
theme replaces (docs/06 §5). A border, not an outline — the focus ring is
|
||||
the outline — and not a fill, which Chrome's text backplate would cover. */
|
||||
@media (forced-colors: active) {
|
||||
/* `nav .cell`, to outrank the `:last-child` rule that removes About's
|
||||
right edge; the padding gives back what the border takes, so the bar
|
||||
does not change height between routes. */
|
||||
footer nav .cell[aria-current='page'] {
|
||||
border: 2px solid Highlight;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -117,6 +117,16 @@
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* A contrast theme leaves the pill a hairline box in the page's own colours.
|
||||
A heavier border in the highlight colour marks the current section
|
||||
(docs/06 §5) — a border, not a fill: Chrome paints a backplate behind
|
||||
forced text, so a label on a filled pill became a box of the page colour. */
|
||||
@media (forced-colors: active) {
|
||||
.indicator {
|
||||
border: 2px solid Highlight;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
nav {
|
||||
--tab-width: 2.75rem;
|
||||
|
||||
@@ -130,6 +130,39 @@
|
||||
color: var(--accent-fg);
|
||||
}
|
||||
|
||||
/* `button:hover` above is the more specific rule, and --fg on the accent
|
||||
fill is under 3:1: hovering the chosen segment dimmed its own label. */
|
||||
.selected:hover {
|
||||
color: var(--accent-fg);
|
||||
}
|
||||
|
||||
/* The inset ring sits ON the selected segment's fill — and roving focus only
|
||||
ever lands on the selected segment. In --accent it was accent on accent:
|
||||
no visible focus at all (docs/06 §5). Drawn 2px further in, so the fill
|
||||
shows on both sides of it: at the very edge, a ring in the page's own
|
||||
colour only made the segment look 2px smaller. */
|
||||
.selected:focus-visible {
|
||||
outline-color: var(--accent-fg);
|
||||
outline-offset: -4px;
|
||||
}
|
||||
|
||||
/* Contrast themes replace the fill, so the choice is said in system colours.
|
||||
`forced-color-adjust: none` because the label sits on that fill: Chrome
|
||||
paints a backplate in the page colour behind forced text, which left
|
||||
"Light" as a black box on the highlight. */
|
||||
@media (forced-colors: active) {
|
||||
.selected,
|
||||
.selected:hover {
|
||||
forced-color-adjust: none;
|
||||
background: Highlight;
|
||||
color: HighlightText;
|
||||
}
|
||||
|
||||
.selected:focus-visible {
|
||||
outline-color: HighlightText;
|
||||
}
|
||||
}
|
||||
|
||||
.compact button {
|
||||
padding: 5px 7px;
|
||||
}
|
||||
|
||||
@@ -108,10 +108,11 @@
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
/* 24 × 24 px with its 14 px glyph (WCAG 2.5.8). */
|
||||
button {
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
padding: 2px;
|
||||
padding: 5px;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
background: none;
|
||||
|
||||
@@ -76,9 +76,16 @@
|
||||
win = next(follow(win, focusIndex, rows.length), rows.length);
|
||||
}
|
||||
|
||||
/** Tabbing in with nothing focused focuses the first row, so arrows work at once (uL6). */
|
||||
/**
|
||||
* Tabbing in with nothing focused focuses the first row, so arrows work at
|
||||
* once (uL6). Only for a focus that came from the keyboard: a mouse press on
|
||||
* a row in a scrolled tree focuses this list too, and picking the first row
|
||||
* then scrolled the tree to the top under the pointer — the click that
|
||||
* followed landed on whatever row had moved there.
|
||||
*/
|
||||
function onFocus(): void {
|
||||
if (session.focusedId === undefined) session.focusedId = rows[0]?.node.id;
|
||||
if (session.focusedId !== undefined || element?.matches(':focus-visible') !== true) return;
|
||||
session.focusedId = rows[0]?.node.id;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -88,7 +95,9 @@
|
||||
{tPlural('edit.showEarlier', Math.min(range.from, WINDOW))}
|
||||
</button>
|
||||
{/if}
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions — the tree
|
||||
pattern: the focusable `role="tree"` list IS the widget that takes the
|
||||
keys, with the active row named by aria-activedescendant. -->
|
||||
<ul
|
||||
bind:this={element}
|
||||
class="tree"
|
||||
@@ -177,4 +186,10 @@
|
||||
.more:hover {
|
||||
background: var(--accent-subtle);
|
||||
}
|
||||
|
||||
/* Inset: `.frame` clips its overflow, and the global ring sits 2px outside
|
||||
the button — on these two it was cut off on every side. */
|
||||
.more:focus-visible {
|
||||
outline-offset: -2px;
|
||||
}
|
||||
</style>
|
||||
@@ -2,6 +2,7 @@
|
||||
import type { NodeStatus } from '../core/diff';
|
||||
import { type BookmarkNode, isFolder } from '../core/model';
|
||||
import { num, t, tPlural } from '../i18n/index.svelte';
|
||||
import Disclosure from './Disclosure.svelte';
|
||||
import Icon from './icons/Icon.svelte';
|
||||
import Self from './TreePreviewNode.svelte';
|
||||
|
||||
@@ -41,20 +42,13 @@
|
||||
|
||||
<li>
|
||||
<div class="row" style:--depth={depth - 1}>
|
||||
{#if folder && children.length > 0}
|
||||
<button
|
||||
class="disclosure"
|
||||
aria-expanded={expanded}
|
||||
aria-label={`${expanded ? t('import.collapse') : t('import.expand')}: ${node.title}`}
|
||||
onclick={() => {
|
||||
expanded = !expanded;
|
||||
}}
|
||||
>
|
||||
<Icon name="chevron" size={12} turned={expanded} />
|
||||
</button>
|
||||
{:else}
|
||||
<span class="disclosure" aria-hidden="true"></span>
|
||||
{/if}
|
||||
<Disclosure
|
||||
expanded={folder && children.length > 0 ? expanded : undefined}
|
||||
label={`${expanded ? t('import.collapse') : t('import.expand')}: ${node.title}`}
|
||||
onclick={() => {
|
||||
expanded = !expanded;
|
||||
}}
|
||||
/>
|
||||
<span class="glyph" class:folder aria-hidden="true">
|
||||
<Icon name={folder ? (expanded && children.length > 0 ? 'folder-open' : 'folder') : 'link'} size={14} />
|
||||
</span>
|
||||
@@ -111,20 +105,6 @@
|
||||
background: var(--bg-raised);
|
||||
}
|
||||
|
||||
.disclosure {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
flex: none;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--fg-muted);
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.glyph {
|
||||
display: inline-flex;
|
||||
color: var(--fg-muted);
|
||||
@@ -183,6 +163,7 @@
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--accent);
|
||||
cursor: pointer;
|
||||
padding: 1px var(--sp-2);
|
||||
/* 24 px tall: an 18 px line, 2 px of padding, the border (WCAG 2.5.8). */
|
||||
padding: 2px var(--sp-2);
|
||||
}
|
||||
</style>
|
||||
@@ -6,6 +6,8 @@
|
||||
import type { VisibleRow } from '../edit/tree-keyboard';
|
||||
import { t } from '../i18n/index.svelte';
|
||||
import type { EditSession } from '../stores/edit-session.svelte';
|
||||
import Disclosure from './Disclosure.svelte';
|
||||
import { focusOwningTree } from './focus-heading';
|
||||
import Icon from './icons/Icon.svelte';
|
||||
import RenameInput from './RenameInput.svelte';
|
||||
import RowActions from './RowActions.svelte';
|
||||
@@ -89,22 +91,17 @@
|
||||
if (at !== undefined) void session.drop(node.id, at);
|
||||
}}
|
||||
>
|
||||
{#if row.expandable}
|
||||
<button
|
||||
class="disclosure"
|
||||
tabindex="-1"
|
||||
aria-hidden="true"
|
||||
onclick={(event) => {
|
||||
// The row under it must not also take the click.
|
||||
event.stopPropagation();
|
||||
session.toggle(node.id);
|
||||
}}
|
||||
>
|
||||
<Icon name="chevron" size={12} turned={row.expanded} />
|
||||
</button>
|
||||
{:else}
|
||||
<span class="disclosure" aria-hidden="true"></span>
|
||||
{/if}
|
||||
<Disclosure
|
||||
expanded={row.expandable ? row.expanded : undefined}
|
||||
onclick={(event) => {
|
||||
// The row under it must not also take the click — and the tree, not
|
||||
// this button, keeps the keyboard (docs/06 §5).
|
||||
event.stopPropagation();
|
||||
session.toggle(node.id);
|
||||
session.focusedId ??= node.id;
|
||||
focusOwningTree(event.currentTarget);
|
||||
}}
|
||||
/>
|
||||
|
||||
<span class="glyph" class:folder={isFolder}>
|
||||
{#if node.unmodifiable !== undefined}
|
||||
@@ -189,25 +186,45 @@
|
||||
box-shadow: inset 0 -2px 0 var(--accent);
|
||||
}
|
||||
|
||||
/* Contrast themes drop every fill and shadow above, which is all that marked
|
||||
the focused row and a drop's place (docs/06 §5). */
|
||||
@media (forced-colors: active) {
|
||||
.focused {
|
||||
outline: 2px solid Highlight;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
/* After `.focused`: a drop INTO the focused folder must still show. */
|
||||
.drop-into {
|
||||
outline: 2px dashed Highlight;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
/* A line laid over the row's edge: a real border would change the row's
|
||||
height mid-drag and move the very zones the drop is measured against. */
|
||||
.drop-before::after,
|
||||
.drop-after::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset-inline: 0;
|
||||
border-top: 2px solid Highlight;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.drop-before::after {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.drop-after::after {
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.matched .title {
|
||||
color: var(--accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.disclosure {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
flex: none;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--fg-muted);
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.glyph {
|
||||
display: inline-flex;
|
||||
color: var(--fg-muted);
|
||||
|
||||
@@ -35,3 +35,18 @@ export function focusLost(): boolean {
|
||||
export function focusIfLost(target: HTMLElement | null | undefined): void {
|
||||
if (target !== null && target !== undefined && focusLost()) target.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hand focus to the tree a row control sits in — docs/06 §5.
|
||||
*
|
||||
* The #edit tree's row buttons and chevron are mouse shortcuts, not tab stops
|
||||
* (`tabindex="-1"`), but Chrome still focuses one when it is clicked. The
|
||||
* tree's key handler ignores keys aimed at a row's own control, so a single
|
||||
* click used to switch the arrow keys off until the next click on a row; and
|
||||
* "Move to…" opened from the button returned focus to a button on a row that
|
||||
* had since moved. Called from the click, before any dialog opens, so the
|
||||
* dialog remembers the tree as the place to return to.
|
||||
*/
|
||||
export function focusOwningTree(from: EventTarget | null): void {
|
||||
if (from instanceof Element) from.closest<HTMLElement>('[role="tree"]')?.focus();
|
||||
}
|
||||
@@ -116,6 +116,27 @@ export function resolveKey(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The sibling shown just above (`-1`) or below (`+1`) a row — what Alt+↑ and
|
||||
* Alt+↓ move it past (docs/05 §10).
|
||||
*
|
||||
* The VISIBLE siblings: under a search only the matches count, because the
|
||||
* user places the row relative to one they can see, exactly as a drag does. A
|
||||
* collapsed neighbour's children are not rows, so they are skipped for free.
|
||||
*
|
||||
* @returns the neighbour's id, or `undefined` at either end of the folder.
|
||||
*/
|
||||
export function nudgeTarget(
|
||||
rows: readonly VisibleRow[],
|
||||
id: string | undefined,
|
||||
direction: -1 | 1,
|
||||
): string | undefined {
|
||||
const row = rows.find((candidate) => candidate.node.id === id);
|
||||
if (row === undefined) return undefined;
|
||||
const siblings = rows.filter((candidate) => candidate.parentId === row.parentId);
|
||||
return siblings[siblings.indexOf(row) + direction]?.node.id;
|
||||
}
|
||||
|
||||
function focusAt(rows: readonly VisibleRow[], index: number): TreeAction {
|
||||
const row = rows[Math.max(0, Math.min(index, rows.length - 1))];
|
||||
return row === undefined ? NONE : { kind: 'focus', id: row.node.id };
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
* Purpose: the tree's keyboard contract applied to the session. Arrows, Home,
|
||||
* End and type-ahead move the focus; → and ← open and close; Enter opens;
|
||||
* F2, Delete and the menu key (or Shift+F10) rename, delete and "Move to…";
|
||||
* Ctrl/⌘+C copies the link. Kept out of EditTab so the component stays
|
||||
* Alt+↑ and Alt+↓ move the row one place among its siblings; Ctrl/⌘+C
|
||||
* copies the link. Kept out of EditTab so the component stays
|
||||
* wiring (docs/10 §1); the key → action mapping itself is `tree-keyboard`.
|
||||
* Guarantees: does nothing while a rename box is open or for keys aimed at a
|
||||
* row's own control, and the session refuses writes while a bulk command
|
||||
@@ -17,6 +18,15 @@ import { resolveKey } from './tree-keyboard';
|
||||
export interface TreeKeyEffects {
|
||||
open: (node: EditNode) => void;
|
||||
copy: (node: EditNode) => void;
|
||||
/** Alt+↑ (`-1`) or Alt+↓ (`+1`) on the focused row. */
|
||||
nudge: (id: string, direction: -1 | 1) => void;
|
||||
}
|
||||
|
||||
/** Alt alone with ↑ or ↓: Alt+Shift+↓, AltGr and the like belong to the browser or the OS. */
|
||||
function nudgeDirection(event: KeyboardEvent): -1 | 1 | undefined {
|
||||
if (!event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return undefined;
|
||||
if (event.key === 'ArrowUp') return -1;
|
||||
return event.key === 'ArrowDown' ? 1 : undefined;
|
||||
}
|
||||
|
||||
export function onTreeKey(
|
||||
@@ -34,6 +44,12 @@ export function onTreeKey(
|
||||
effects.copy(focused);
|
||||
return;
|
||||
}
|
||||
const direction = nudgeDirection(event);
|
||||
if (direction !== undefined && session.focusedId !== undefined) {
|
||||
event.preventDefault();
|
||||
effects.nudge(session.focusedId, direction);
|
||||
return;
|
||||
}
|
||||
if (event.ctrlKey || event.metaKey || event.altKey) return;
|
||||
const key = event.shiftKey && event.key === 'F10' ? 'ContextMenu' : event.key;
|
||||
|
||||
|
||||
+33
-13
@@ -10,12 +10,15 @@
|
||||
import type { Locale } from './resolve-locale';
|
||||
|
||||
/** BCP 47 tags docs/07 §3 pins per locale. */
|
||||
export type LocaleTag = 'en-US' | 'vi-VN' | 'ja-JP';
|
||||
export type LocaleTag = 'en-US' | 'vi-VN' | 'ja-JP' | 'zh-CN' | 'ro-RO';
|
||||
|
||||
/** A `Record`, so a new locale without a tag fails to compile (docs/07 §6). */
|
||||
const TAGS: Record<Locale, LocaleTag> = {
|
||||
en: 'en-US',
|
||||
vi: 'vi-VN',
|
||||
ja: 'ja-JP',
|
||||
'zh-CN': 'zh-CN',
|
||||
ro: 'ro-RO',
|
||||
};
|
||||
|
||||
// Constructing an Intl formatter is expensive relative to a render, and
|
||||
@@ -24,31 +27,48 @@ const numberFormats = new Map<LocaleTag, Intl.NumberFormat>();
|
||||
const dateFormats = new Map<LocaleTag, Intl.DateTimeFormat>();
|
||||
const pluralRules = new Map<LocaleTag, Intl.PluralRules>();
|
||||
|
||||
/** The two forms docs/07 §5 requires every plural key to carry. */
|
||||
export type PluralForm = 'one' | 'other';
|
||||
|
||||
/**
|
||||
* Pick a plural form for a count.
|
||||
*
|
||||
* Narrowed to `one`/`other` deliberately: `Intl.PluralRules` can return `zero`,
|
||||
* `two`, `few` and `many` for other languages, but en yields only one/other and
|
||||
* vi/ja only ever yield other — so the two-form dictionaries docs/07 §5
|
||||
* specifies are sufficient for exactly the locales we ship.
|
||||
* The plural forms a dictionary may carry (docs/07 §5): every locale has `one`
|
||||
* and `other`; a locale whose rules use `few` (Romanian) carries that too.
|
||||
*/
|
||||
export function selectPluralForm(count: number, tag: LocaleTag): PluralForm {
|
||||
export type PluralForm = 'one' | 'few' | 'other';
|
||||
|
||||
/** The CLDR categories `PluralForm` can represent — the guard test's bound. */
|
||||
export const PLURAL_FORMS: readonly PluralForm[] = ['one', 'few', 'other'];
|
||||
|
||||
function rulesFor(tag: LocaleTag): Intl.PluralRules {
|
||||
let rules = pluralRules.get(tag);
|
||||
if (rules === undefined) {
|
||||
rules = new Intl.PluralRules(tag);
|
||||
pluralRules.set(tag, rules);
|
||||
}
|
||||
return rules.select(count) === 'one' ? 'one' : 'other';
|
||||
return rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pick a plural form for a count.
|
||||
*
|
||||
* Narrowed to `one`/`few`/`other`: `Intl.PluralRules` can also return `zero`,
|
||||
* `two` and `many`, which fold into `other`. No shipped locale produces them —
|
||||
* `dictionaries.test.ts` fails if one ever does, before a grammar this cannot
|
||||
* select reaches a user.
|
||||
*/
|
||||
export function selectPluralForm(count: number, tag: LocaleTag): PluralForm {
|
||||
const category = rulesFor(tag).select(count);
|
||||
return category === 'one' || category === 'few' ? category : 'other';
|
||||
}
|
||||
|
||||
/** The forms a locale's plural keys must carry: `one`, `other`, plus any it uses. */
|
||||
export function requiredPluralForms(tag: LocaleTag): PluralForm[] {
|
||||
const used = new Set<string>(rulesFor(tag).resolvedOptions().pluralCategories);
|
||||
return PLURAL_FORMS.filter((form) => form !== 'few' || used.has(form));
|
||||
}
|
||||
|
||||
export function localeTag(locale: Locale): LocaleTag {
|
||||
return TAGS[locale];
|
||||
}
|
||||
|
||||
/** Group a count for display — VI uses `.` thousands, EN `,`, JA `,`. */
|
||||
/** Group a count for display — VI and RO use `.` thousands, EN, JA and ZH `,`. */
|
||||
export function formatCount(value: number, tag: LocaleTag): string {
|
||||
let format = numberFormats.get(tag);
|
||||
if (format === undefined) {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { formatCount, formatDateTime, localeTag, selectPluralForm } from './format';
|
||||
import en from './locales/en';
|
||||
import en, { type Dict } from './locales/en';
|
||||
import ja from './locales/ja';
|
||||
import ro from './locales/ro';
|
||||
import vi from './locales/vi';
|
||||
import zhCN from './locales/zh-CN';
|
||||
import type { Locale } from './resolve-locale';
|
||||
|
||||
/**
|
||||
@@ -10,10 +12,13 @@ import type { Locale } from './resolve-locale';
|
||||
* chrome.i18n always follows the browser UI language and cannot be switched at
|
||||
* runtime, so every in-app string resolves through this store instead. The
|
||||
* dictionaries are static imports, never loaded over the network — network
|
||||
* calls are banned repo-wide (docs/08 §3), and bundling three small dicts costs
|
||||
* calls are banned repo-wide (docs/08 §3), and bundling a few small dicts costs
|
||||
* nothing at our size.
|
||||
*
|
||||
* A `Record<Locale, Dict>`, so a locale added to `LOCALES` without a dictionary
|
||||
* is a compile error here rather than an English UI at runtime.
|
||||
*/
|
||||
const dicts = { en, vi, ja };
|
||||
const dicts: Record<Locale, Dict> = { en, vi, ja, 'zh-CN': zhCN, ro };
|
||||
|
||||
let locale = $state<Locale>('en');
|
||||
|
||||
@@ -22,7 +27,7 @@ export function setLocale(next: Locale): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* The *resolved* locale (`en|vi|ja`).
|
||||
* The *resolved* locale — always one of `LOCALES`, never `'auto'`.
|
||||
*
|
||||
* Not to be confused with `getSettings().locale`, the *preference*, which also
|
||||
* carries `'auto'`. Language controls must bind to the preference — binding to
|
||||
@@ -45,7 +50,7 @@ export function dateTime(iso: string): string | undefined {
|
||||
/**
|
||||
* Resolve a dotted key path, falling back to English, then to the key itself.
|
||||
* Interpolation is `{token}` replacement only — never concatenate sentence
|
||||
* fragments, or VI/JA word order breaks (docs/07 §2).
|
||||
* fragments, or word order breaks in other languages (docs/07 §2).
|
||||
*/
|
||||
export function t(path: string, params?: Record<string, string | number>): string {
|
||||
const raw = lookup(dicts[locale], path) ?? lookup(dicts.en, path) ?? path;
|
||||
@@ -53,12 +58,13 @@ export function t(path: string, params?: Record<string, string | number>): strin
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a plural key — an object of `{ one, other }` per docs/07 §5.
|
||||
* Resolve a plural key — an object of `{ one, other }`, plus `few` in a locale
|
||||
* that uses it (Romanian), per docs/07 §5.
|
||||
*
|
||||
* `{n}` is supplied automatically, already grouped for the locale, so callers
|
||||
* pass the raw count and never have to format it themselves. VI and JA carry
|
||||
* both forms with the same text (one grammatical form), which is what keeps the
|
||||
* `satisfies Dict` shape check meaningful.
|
||||
* pass the raw count and never have to format it themselves. One-form locales
|
||||
* (vi, ja, zh) carry `one` and `other` with the same text, which is what keeps
|
||||
* the `satisfies Dict` shape check meaningful.
|
||||
*/
|
||||
export function tPlural(
|
||||
path: string,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* English strings for the Import tab — split out of en.ts so both files stay
|
||||
* under the size limit (docs/10 §1), exactly like the notices. en.ts
|
||||
* re-assembles them; vi/ja mirror this file.
|
||||
* re-assembles them; every other locale mirrors this file.
|
||||
*
|
||||
* Same rules as en.ts: NEVER `as const`, full sentences, `{token}` interpolation.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* English warnings and errors — split out of en.ts so both files stay under the
|
||||
* size limit (docs/10 §1). en.ts re-assembles them; vi/ja mirror this file.
|
||||
* size limit (docs/10 §1). en.ts re-assembles them; every other locale mirrors
|
||||
* this file.
|
||||
*
|
||||
* Same rules as en.ts: NEVER `as const`, full sentences, `{token}` interpolation.
|
||||
*/
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
/**
|
||||
* English dictionary — the schema source of truth (docs/07 §2).
|
||||
*
|
||||
* vi.ts and ja.ts mirror this exact shape via `satisfies Dict`, so a missing
|
||||
* key fails `tsc`. That is the whole completeness check; no i18n framework.
|
||||
* Every other locale mirrors this exact shape via `satisfies Dict`, so a
|
||||
* missing key fails `tsc`. That is the whole completeness check; no i18n
|
||||
* framework.
|
||||
*
|
||||
* NEVER write `as const` here. It would make `Dict` a tree of *string literal*
|
||||
* types, so `satisfies Dict` would demand `vi.common.import === 'Import'` and
|
||||
* every correct translation would become a compile error.
|
||||
*
|
||||
* Interpolation is `{token}` replacement only — full sentences per key, never
|
||||
* concatenated fragments, so VI/JA word order works.
|
||||
* concatenated fragments, so word order works in every language.
|
||||
*/
|
||||
|
||||
import { importTab } from './en-import';
|
||||
@@ -137,6 +138,7 @@ const dict = {
|
||||
sortPartial:
|
||||
'Moved {done} of {total} items before the browser refused. The folder shows its real order now.',
|
||||
alreadySorted: 'This folder is already in order.',
|
||||
movedPosition: '{title}: position {position} of {total}',
|
||||
},
|
||||
settings: {
|
||||
autosave: 'Changes are saved as you make them.',
|
||||
@@ -144,11 +146,14 @@ const dict = {
|
||||
languageNote: 'Applies to this extension only, not to the browser.',
|
||||
localeAuto: 'Automatic (follow the browser)',
|
||||
lang: {
|
||||
// Endonyms, deliberately identical in all three dictionaries: a Japanese
|
||||
// user hunting for Vietnamese looks for "Tiếng Việt", not "ベトナム語".
|
||||
// Endonyms, deliberately identical in every dictionary: a Japanese user
|
||||
// hunting for Vietnamese looks for "Tiếng Việt", not "ベトナム語".
|
||||
// dictionaries.test.ts holds them equal.
|
||||
en: 'English',
|
||||
vi: 'Tiếng Việt',
|
||||
ja: '日本語',
|
||||
'zh-CN': '简体中文',
|
||||
ro: 'Română',
|
||||
},
|
||||
theme: 'Theme',
|
||||
themes: {
|
||||
@@ -187,6 +192,7 @@ const dict = {
|
||||
repo: 'GitHub repository',
|
||||
issues: 'Report an issue',
|
||||
changelog: 'Releases and changelog',
|
||||
accessibility: 'Accessibility',
|
||||
store: 'Chrome Web Store listing',
|
||||
thirdParty: 'Third-party code',
|
||||
thirdPartyNote:
|
||||
@@ -225,5 +231,25 @@ const dict = {
|
||||
|
||||
export default dict;
|
||||
|
||||
/** Widened shape (string, not the literal). vi/ja are typed against this. */
|
||||
export type Dict = typeof dict;
|
||||
/** A plural key as English writes it (docs/07 §5). */
|
||||
type Plural = { one: string; other: string };
|
||||
|
||||
/**
|
||||
* `T` with every plural branch opened to a third, optional form — the `few`
|
||||
* Romanian needs (docs/07 §5). The only thing it adds; every other leaf stays
|
||||
* `string`. Whether a locale must carry `few` depends on its own plural rules,
|
||||
* which a type cannot see, so dictionaries.test.ts enforces that part.
|
||||
*/
|
||||
type Localized<T> = {
|
||||
[K in keyof T]: T[K] extends string
|
||||
? string
|
||||
: T[K] extends Plural
|
||||
? Plural & { few?: string }
|
||||
: Localized<T[K]>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Widened shape (string, not the literal). Every other locale is typed against
|
||||
* this; plural branches may carry `few`.
|
||||
*/
|
||||
export type Dict = Localized<typeof dict>;
|
||||
@@ -126,6 +126,7 @@ export default {
|
||||
sortPartial:
|
||||
'ブラウザが拒否する前に {total} 件中 {done} 件を移動しました。フォルダは現在の実際の順序で表示されています。',
|
||||
alreadySorted: 'このフォルダはすでに並んでいます。',
|
||||
movedPosition: '{title}:{total} 件中 {position} 番目',
|
||||
},
|
||||
settings: {
|
||||
autosave: '変更は自動的に保存されます。',
|
||||
@@ -137,6 +138,8 @@ export default {
|
||||
en: 'English',
|
||||
vi: 'Tiếng Việt',
|
||||
ja: '日本語',
|
||||
'zh-CN': '简体中文',
|
||||
ro: 'Română',
|
||||
},
|
||||
theme: 'テーマ',
|
||||
themes: {
|
||||
@@ -175,6 +178,7 @@ export default {
|
||||
repo: 'GitHub リポジトリ',
|
||||
issues: '問題を報告',
|
||||
changelog: 'リリースと変更履歴',
|
||||
accessibility: 'アクセシビリティ',
|
||||
store: 'Chrome ウェブストアのページ',
|
||||
thirdParty: 'サードパーティのコード',
|
||||
thirdPartyNote:
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
import type { Dict } from './en';
|
||||
|
||||
/** Romanian strings for the Import tab — mirrors en-import.ts; plurals carry `few`. */
|
||||
export const importTab = {
|
||||
dropHint: 'Plasați aici un fișier de marcaje sau dați clic pentru a-l alege · maximum {size}',
|
||||
dropFormats:
|
||||
'Exporturi HTML din browsere, CSV, copii de rezervă JSON din BookmarkMagic și Firefox, precum și fișierul Bookmarks din Chrome (nu are extensie de fișier).',
|
||||
reading: 'Se citește {name}…',
|
||||
preview: 'Previzualizare',
|
||||
// TODO(review-ro): Chrome ro may say „Importate” for its own import folder.
|
||||
folderName: 'Importat {date}',
|
||||
start: {
|
||||
one: 'Importați {n} marcaj',
|
||||
few: 'Importați {n} marcaje',
|
||||
other: 'Importați {n} de marcaje',
|
||||
},
|
||||
backingUp:
|
||||
'Se salvează o copie de rezervă de siguranță înainte de a înlocui ceva. Confirmați în fereastra de salvare pentru a continua.',
|
||||
keepTabOpen: 'Păstrați această filă deschisă până se termină importul.',
|
||||
progress: 'Se importă… {done} / {total}',
|
||||
doneSummary: 'Gata — au fost create {bookmarks} și {folders}.',
|
||||
skipped: 'Omise — deja în acest browser: {existing}; repetate în fișier: {inFile}.',
|
||||
stepSource: 'Sursă',
|
||||
stepOptions: 'Opțiuni',
|
||||
stepWriting: 'Scriere',
|
||||
stepResult: 'Rezultat',
|
||||
format: {
|
||||
'netscape-html': 'HTML',
|
||||
'bm-json': 'BookmarkMagic JSON',
|
||||
csv: 'CSV',
|
||||
'chrome-json': 'Fișierul Bookmarks din Chrome',
|
||||
'firefox-json': 'Copie de rezervă Firefox',
|
||||
},
|
||||
countBookmarks: { one: '{n} marcaj', few: '{n} marcaje', other: '{n} de marcaje' },
|
||||
countFolders: { one: '{n} dosar', few: '{n} dosare', other: '{n} de dosare' },
|
||||
countPair: '{bookmarks} și {folders}',
|
||||
whereNewFolder:
|
||||
'Totul se află în dosarul „{folder}” din Alte marcaje — ștergerea acelui singur dosar anulează importul.',
|
||||
whereMerge: 'Elementele noi au fost adăugate la sfârșitul dosarelor din care fac parte.',
|
||||
whereReplace: 'Marcajele conțin acum exact ce conține fișierul.',
|
||||
replaceConfirmTitle: 'Înlocuiți tot?',
|
||||
replaceConfirmBody:
|
||||
'Vor fi șterse din acest browser: {current}, după salvarea unei copii de rezervă de siguranță. Apoi se scrie conținutul din {name}: {incoming}.',
|
||||
replaceConfirm: 'Salvați copia și înlocuiți',
|
||||
target: { bar: 'bară', unfiled: 'Alte marcaje', mobile: 'Mobile' },
|
||||
targetNote:
|
||||
'La îmbinare și la înlocuire, conținutul acestui dosar ajunge direct în dosarul respectiv al browserului, nu într-o copie a lui.',
|
||||
reused: {
|
||||
one: 'Elementele au fost adăugate în {n} dosar pe care îl aveați deja, fără a crea o copie.',
|
||||
few: 'Elementele au fost adăugate în {n} dosare pe care le aveați deja, fără a crea copii.',
|
||||
other:
|
||||
'Elementele au fost adăugate în {n} de dosare pe care le aveați deja, fără a crea copii.',
|
||||
},
|
||||
// Firefox's own ro names for its roots. TODO(review-ro): "Marcaje mobile".
|
||||
rootTitle: {
|
||||
toolbar: 'Bara de marcaje',
|
||||
unfiled: 'Alte marcaje',
|
||||
mobile: 'Marcaje mobile',
|
||||
},
|
||||
cancelledSummary: {
|
||||
one: 'Anulat — {n} element fusese deja creat și a rămas pe loc.',
|
||||
few: 'Anulat — {n} elemente fuseseră deja create și au rămas pe loc.',
|
||||
other: 'Anulat — {n} de elemente fuseseră deja create și au rămas pe loc.',
|
||||
},
|
||||
cancelledAfterClear:
|
||||
'Ați anulat după ce marcajele existente fuseseră deja șterse, așa că a rămas doar partea care a fost refăcută.',
|
||||
dateNotice:
|
||||
'Marcajele importate poartă data de azi. Chrome nu permite unei extensii să seteze data originală a unui marcaj — fișierele exportate păstrează datele reale.',
|
||||
partialCreated: {
|
||||
one: '{n} element fusese deja creat înainte de eroare și a rămas pe loc.',
|
||||
few: '{n} elemente fuseseră deja create înainte de eroare și au rămas pe loc.',
|
||||
other: '{n} de elemente fuseseră deja create înainte de eroare și au rămas pe loc.',
|
||||
},
|
||||
partialCleared: {
|
||||
one: '{n} element de pe primul nivel fusese deja șters înainte de eroare. Restaurați-l din copia de rezervă.',
|
||||
few: '{n} elemente de pe primul nivel fuseseră deja șterse înainte de eroare. Restaurați-le din copia de rezervă.',
|
||||
other:
|
||||
'{n} de elemente de pe primul nivel fuseseră deja șterse înainte de eroare. Restaurați-le din copia de rezervă.',
|
||||
},
|
||||
backupFileType: 'Copie de rezervă a marcajelor',
|
||||
backupHint:
|
||||
'Copia de rezervă de siguranță a fost salvată ca {name}. O puteți restaura importând acel fișier JSON.',
|
||||
openEdit: 'Deschideți fila Editare',
|
||||
another: 'Importați alt fișier',
|
||||
dedupe: 'Omiteți duplicatele deja existente în acest browser (găsite: {n})',
|
||||
dedupeDisabled: 'Nu se aplică: „Înlocuire completă” șterge mai întâi marcajele actuale.',
|
||||
replaceWarning:
|
||||
'Această acțiune șterge TOATE marcajele actuale. Mai întâi se salvează o copie de rezervă JSON; ștergerea începe doar după ce aceasta a fost salvată cu succes.',
|
||||
attest:
|
||||
'Browserul nu a putut confirma că a fost salvată copia de rezervă. Căutați {name} în dosarul de descărcări, apoi confirmați — încă nu s-a șters nimic.',
|
||||
attestConfirm: 'Am copia de rezervă — ștergeți și înlocuiți',
|
||||
clearing: 'Se șterg marcajele actuale. Nu închideți această filă.',
|
||||
badgeNew: 'nou',
|
||||
badgeDup: 'duplicat',
|
||||
expand: 'Extindeți dosarul',
|
||||
collapse: 'Restrângeți dosarul',
|
||||
stats: {
|
||||
bookmarks: 'Marcaje',
|
||||
folders: 'Dosare',
|
||||
depth: 'Adâncime maximă',
|
||||
duplicates: 'Duplicate',
|
||||
},
|
||||
mode: {
|
||||
legend: 'Cum să fie adăugate?',
|
||||
newFolder: 'Într-un dosar nou (recomandat)',
|
||||
merge: 'Îmbinare cu dosarele existente',
|
||||
replace: 'Înlocuire completă',
|
||||
newFolderNote:
|
||||
'Nu se atinge nimic din ce există; dacă vă răzgândiți, ștergeți un singur dosar cu dată.',
|
||||
mergeNote:
|
||||
'Dosarele pe care le aveți deja sunt refolosite; elementele noi ajung la sfârșitul lor.',
|
||||
replaceNote:
|
||||
'Salvează mai întâi o copie de rezervă, apoi șterge tot. Pentru restaurarea unei copii de rezervă.',
|
||||
},
|
||||
warnings: {
|
||||
title: { one: '{n} avertisment', few: '{n} avertismente', other: '{n} de avertismente' },
|
||||
},
|
||||
} satisfies Dict['import'];
|
||||
@@ -0,0 +1,103 @@
|
||||
import type { Dict } from './en';
|
||||
|
||||
/**
|
||||
* Romanian warnings and errors — mirrors en-notices.ts (docs/07 §2). Every
|
||||
* plural carries `few` (0, 2–19, …01–19) as well as `one` and `other`, and
|
||||
* `other` takes "de": "20 de intrări" (docs/07 §5).
|
||||
*/
|
||||
|
||||
export const warnings = {
|
||||
NO_BOOKMARKS: {
|
||||
one: 'Acest fișier nu conține niciun marcaj.',
|
||||
few: 'Acest fișier nu conține niciun marcaj.',
|
||||
other: 'Acest fișier nu conține niciun marcaj.',
|
||||
},
|
||||
DESCRIPTIONS_DROPPED: {
|
||||
one: '{n} descriere a fost eliminată — nu are loc în modelul de marcaje.',
|
||||
few: '{n} descrieri au fost eliminate — nu au loc în modelul de marcaje.',
|
||||
other: '{n} de descrieri au fost eliminate — nu au loc în modelul de marcaje.',
|
||||
},
|
||||
FAVICONS_IGNORED: {
|
||||
one: '{n} pictogramă de site a fost ignorată — API-ul pentru marcaje nu poate seta pictograme.',
|
||||
few: '{n} pictograme de site au fost ignorate — API-ul pentru marcaje nu poate seta pictograme.',
|
||||
other:
|
||||
'{n} de pictograme de site au fost ignorate — API-ul pentru marcaje nu poate seta pictograme.',
|
||||
},
|
||||
INVALID_DATE: {
|
||||
one: '{n} dată ilizibilă a fost lăsată necompletată.',
|
||||
few: '{n} date ilizibile au fost lăsate necompletate.',
|
||||
other: '{n} de date ilizibile au fost lăsate necompletate.',
|
||||
},
|
||||
MISSING_URL: {
|
||||
one: '{n} intrare nu avea adresă și a fost omisă.',
|
||||
few: '{n} intrări nu aveau adresă și au fost omise.',
|
||||
other: '{n} de intrări nu aveau adresă și au fost omise.',
|
||||
},
|
||||
NEWER_VERSION: {
|
||||
one: 'Acest fișier a fost scris de o versiune mai nouă — îl citim cât de bine putem.',
|
||||
few: 'Acest fișier a fost scris de o versiune mai nouă — îl citim cât de bine putem.',
|
||||
other: 'Acest fișier a fost scris de o versiune mai nouă — îl citim cât de bine putem.',
|
||||
},
|
||||
EMPTY_TITLE: {
|
||||
one: '{n} marcaj nu are titlu — browserul va afișa în schimb adresa lui.',
|
||||
few: '{n} marcaje nu au titlu — browserul va afișa în schimb adresele lor.',
|
||||
other: '{n} de marcaje nu au titlu — browserul va afișa în schimb adresele lor.',
|
||||
},
|
||||
INVALID_URL: {
|
||||
one: '{n} intrare are o adresă pe care browserul nu o poate stoca, așa că a fost omisă.',
|
||||
few: '{n} intrări au adrese pe care browserul nu le poate stoca, așa că au fost omise.',
|
||||
other: '{n} de intrări au adrese pe care browserul nu le poate stoca, așa că au fost omise.',
|
||||
},
|
||||
PLACE_QUERIES_SKIPPED: {
|
||||
one: '{n} marcaj inteligent Firefox (o căutare salvată, nu o pagină web) a fost omis — aici ar fi un link nefuncțional.',
|
||||
few: '{n} marcaje inteligente Firefox (căutări salvate, nu pagini web) au fost omise — aici ar fi linkuri nefuncționale.',
|
||||
other:
|
||||
'{n} de marcaje inteligente Firefox (căutări salvate, nu pagini web) au fost omise — aici ar fi linkuri nefuncționale.',
|
||||
},
|
||||
EXTRA_ROOTS_SKIPPED: {
|
||||
one: '{n} marcaj dintr-un dosar specific unui browser (cum ar fi Speed Dial sau Coșul de gunoi din Opera) nu a fost importat.',
|
||||
few: '{n} marcaje din dosare specifice unui browser (cum ar fi Speed Dial sau Coșul de gunoi din Opera) nu au fost importate.',
|
||||
other:
|
||||
'{n} de marcaje din dosare specifice unui browser (cum ar fi Speed Dial sau Coșul de gunoi din Opera) nu au fost importate.',
|
||||
},
|
||||
UNREADABLE_ENTRIES: {
|
||||
one: '{n} intrare din acest fișier nu a putut fi citită și a fost omisă.',
|
||||
few: '{n} intrări din acest fișier nu au putut fi citite și au fost omise.',
|
||||
other: '{n} de intrări din acest fișier nu au putut fi citite și au fost omise.',
|
||||
},
|
||||
} satisfies Dict['warnings'];
|
||||
|
||||
export const errors = {
|
||||
NOT_NETSCAPE: 'Acesta nu pare a fi un fișier HTML de marcaje.',
|
||||
NOT_BM_JSON:
|
||||
'Acest fișier JSON nu este un fișier de marcaje pe care BookmarkMagic îl poate citi. BookmarkMagic citește propriile copii de rezervă, copiile de rezervă JSON din Firefox și fișierul Bookmarks din Chrome.',
|
||||
MALFORMED_JSON: 'Acest fișier nu este un JSON valid.',
|
||||
INVALID_NODE: 'Acest fișier conține o intrare pe care BookmarkMagic nu o poate citi.',
|
||||
BAD_CSV_HEADER:
|
||||
'Rândul de antet CSV lipsește sau coloanele lui sunt în altă ordine decât trebuie.',
|
||||
CSV_ROW_MISMATCH: 'Un rând CSV are un număr greșit de coloane.',
|
||||
CSV_UNCLOSED_QUOTE:
|
||||
'Un câmp CSV deschis cu ghilimele nu este închis niciodată, așa că restul fișierului nu poate fi citit corect.',
|
||||
UNKNOWN_FORMAT:
|
||||
'Fișier nerecunoscut — se aștepta un export HTML de marcaje, un CSV, o copie de rezervă JSON BookmarkMagic sau Firefox ori fișierul Bookmarks din Chrome.',
|
||||
FILE_TOO_LARGE: 'Acest fișier este prea mare pentru a fi importat.',
|
||||
TOO_MANY_NODES: 'Acest fișier conține prea multe marcaje pentru a fi importat în siguranță.',
|
||||
TOO_DEEP: 'Acest fișier are dosare imbricate mult prea adânc.',
|
||||
BACKUP_SERIALIZE_FAILED:
|
||||
'Copia de rezervă de siguranță nu a putut fi pregătită, așa că nu s-a modificat nimic.',
|
||||
BACKUP_EXCEEDS_LIMITS:
|
||||
'Marcajele actuale depășesc ce ar putea BookmarkMagic să recitească dintr-o copie de rezervă, așa că „Înlocuire completă” s-a oprit înainte de a șterge ceva. Folosiți în schimb „Îmbinare cu dosarele existente” sau „Într-un dosar nou”.',
|
||||
BACKUP_STALE:
|
||||
'Marcajele s-au tot modificat în timp ce se salva copia de rezervă de siguranță (le edita altă fereastră, altă filă sau sincronizarea), așa că nu s-a șters nimic. Încercați din nou peste câteva momente.',
|
||||
BACKUP_CANCELLED: 'Ați anulat copia de rezervă de siguranță, așa că nu s-a șters nimic.',
|
||||
BACKUP_WRITE_FAILED:
|
||||
'Copia de rezervă de siguranță nu a putut fi salvată, așa că nu s-a șters nimic.',
|
||||
BROWSER: 'Browserul a refuzat o operație cu marcaje.',
|
||||
WRITE_LOCKED:
|
||||
'O altă filă BookmarkMagic scrie marcaje chiar acum. Așteptați să termine, apoi încercați din nou — nu s-a modificat nimic.',
|
||||
NO_WRITABLE_ROOTS:
|
||||
'Acest profil de browser nu are niciun dosar de marcaje în care BookmarkMagic să aibă voie să scrie. Marcajele gestionate de o organizație nu pot fi modificate.',
|
||||
PARTIAL_WRITE: 'Browserul a încetat să mai accepte marcaje în timpul importului.',
|
||||
PARTIAL_CLEAR: 'Browserul s-a oprit în timpul înlocuirii marcajelor.',
|
||||
UNKNOWN: 'Ceva nu a funcționat.',
|
||||
} satisfies Dict['errors'];
|
||||
@@ -0,0 +1,247 @@
|
||||
import type { Dict } from './en';
|
||||
import { importTab } from './ro-import';
|
||||
import { errors, warnings } from './ro-notices';
|
||||
|
||||
/**
|
||||
* Romanian — Chrome's own ro terms (marcaj, Bara de marcaje, dosar), polite
|
||||
* plural address ("Importați"), comma-below ș ț never the cedilla look-alikes
|
||||
* (U+015F, U+0163), „…” quotes,
|
||||
* and three plural forms: `one`, `few` and `other` — "1 marcaj", "5 marcaje",
|
||||
* "20 de marcaje" (docs/07 §4–§5). A count-less label repeats the bare noun in
|
||||
* `few` and `other`.
|
||||
* TODO(review-ro): best-effort until a native pass (docs/00 §10).
|
||||
*/
|
||||
export default {
|
||||
common: {
|
||||
appName: 'BookmarkMagic',
|
||||
import: 'Import',
|
||||
export: 'Export',
|
||||
edit: 'Editare',
|
||||
settings: 'Setări',
|
||||
about: 'Despre',
|
||||
busy: 'Un import este în curs',
|
||||
cancel: 'Anulați',
|
||||
dismiss: 'Închideți',
|
||||
sections: 'Secțiuni',
|
||||
detail: 'Detalii tehnice',
|
||||
},
|
||||
popup: {
|
||||
import: 'Importați marcaje…',
|
||||
importHint: 'HTML, CSV, copii de rezervă JSON, fișierul Bookmarks din Chrome',
|
||||
export: 'Exportați marcaje…',
|
||||
exportHint: 'HTML, JSON, CSV sau Markdown',
|
||||
manage: 'Deschideți managerul',
|
||||
manageHint: 'Editați, sortați, găsiți duplicate',
|
||||
bookmarks: { one: 'marcaj', few: 'marcaje', other: 'marcaje' },
|
||||
folders: { one: 'dosar', few: 'dosare', other: 'dosare' },
|
||||
},
|
||||
status: {
|
||||
local: 'doar local',
|
||||
localNote: 'Fără rețea: extensia nu poate trimite nimic nicăieri.',
|
||||
permissionsNote: 'Singurele două permisiuni pe care le are această extensie.',
|
||||
more: 'Mai multe',
|
||||
},
|
||||
import: importTab,
|
||||
export: {
|
||||
scope: 'Ce se exportă',
|
||||
everything: 'Tot',
|
||||
format: 'Format',
|
||||
start: {
|
||||
one: 'Exportați {n} marcaj',
|
||||
few: 'Exportați {n} marcaje',
|
||||
other: 'Exportați {n} de marcaje',
|
||||
},
|
||||
started: 'Descărcarea a început: {name}',
|
||||
markdownNote: 'Markdown este doar pentru partajare — BookmarkMagic nu îl poate importa înapoi.',
|
||||
csvNote:
|
||||
'CSV este o vedere aplatizată: nu se păstrează dosarele goale și nici care dosar este bara de marcaje.',
|
||||
csvDelimiter: 'Delimitator',
|
||||
comma: 'Virgulă ( , )',
|
||||
semicolon: 'Punct și virgulă ( ; )',
|
||||
markdownStyle: 'Aranjare',
|
||||
nested: 'Listă imbricată',
|
||||
flat: 'Câte un titlu pentru fiecare dosar',
|
||||
formats: {
|
||||
'netscape-html': {
|
||||
name: 'HTML',
|
||||
note: 'Funcționează cu Chrome, Edge, Brave, Firefox, Safari, Vivaldi și Opera.',
|
||||
},
|
||||
'bm-json': {
|
||||
name: 'JSON',
|
||||
note: 'Copie de rezervă fără pierderi — cea mai bună alegere pentru o restaurare ulterioară.',
|
||||
},
|
||||
csv: { name: 'CSV', note: 'Pentru foi de calcul. Aplatizat.' },
|
||||
markdown: {
|
||||
name: 'Markdown',
|
||||
note: 'Pentru partajare într-un README, o postare pe blog sau un chat.',
|
||||
},
|
||||
},
|
||||
},
|
||||
edit: {
|
||||
tree: 'Arborele de marcaje',
|
||||
loading: 'Se citesc marcajele…',
|
||||
search: 'Căutați în marcaje',
|
||||
filterFolders: 'Filtrați dosarele',
|
||||
newFolder: 'Dosar nou',
|
||||
newFolderTitle: 'Dosar nou',
|
||||
findDuplicates: 'Găsiți duplicatele',
|
||||
expandAll: 'Extindeți tot',
|
||||
collapseAll: 'Restrângeți tot',
|
||||
rename: 'Redenumiți',
|
||||
open: 'Deschideți',
|
||||
copyUrl: 'Copiați linkul',
|
||||
unsafeUrl: 'Această adresă folosește o schemă pe care BookmarkMagic nu o deschide.',
|
||||
copied: 'Linkul a fost copiat',
|
||||
copyFailed: 'Linkul nu a putut fi copiat.',
|
||||
moveTo: 'Mutați în…',
|
||||
moveToBody: 'În ce dosar mutați „{title}”?',
|
||||
noMoveTargets: 'Nu este disponibil niciun alt dosar.',
|
||||
delete: 'Ștergeți',
|
||||
untitled: '(fără titlu)',
|
||||
empty: 'Încă nu există marcaje — importați câteva pentru a începe.',
|
||||
noMatches: 'Nimic nu corespunde căutării.',
|
||||
showMore: {
|
||||
one: 'Afișați încă {n} rând · ascunse: {total}',
|
||||
few: 'Afișați încă {n} rânduri · ascunse: {total}',
|
||||
other: 'Afișați încă {n} de rânduri · ascunse: {total}',
|
||||
},
|
||||
showEarlier: {
|
||||
one: 'Afișați {n} rând anterior',
|
||||
few: 'Afișați {n} rânduri anterioare',
|
||||
other: 'Afișați {n} de rânduri anterioare',
|
||||
},
|
||||
deleteTitle: 'Ștergeți acest element?',
|
||||
deleteBody: 'Ștergeți „{title}”? Acțiunea nu poate fi anulată.',
|
||||
deleteFolderBody: {
|
||||
one: 'Ștergeți „{title}” și {n} element din el? Acțiunea nu poate fi anulată.',
|
||||
few: 'Ștergeți „{title}” și cele {n} elemente din el? Acțiunea nu poate fi anulată.',
|
||||
other: 'Ștergeți „{title}” și cele {n} de elemente din el? Acțiunea nu poate fi anulată.',
|
||||
},
|
||||
duplicates: 'Duplicate',
|
||||
duplicateSummary: '{links} · {copies}',
|
||||
duplicateLinks: {
|
||||
one: '{n} link duplicat',
|
||||
few: '{n} linkuri duplicate',
|
||||
other: '{n} de linkuri duplicate',
|
||||
},
|
||||
extraCopies: {
|
||||
one: '{n} copie în plus',
|
||||
few: '{n} copii în plus',
|
||||
other: '{n} de copii în plus',
|
||||
},
|
||||
noDuplicates: 'Nu s-au găsit linkuri duplicate.',
|
||||
keepFirst: {
|
||||
one: 'Păstrați primul din fiecare, ștergeți {n} copie',
|
||||
few: 'Păstrați primul din fiecare, ștergeți {n} copii',
|
||||
other: 'Păstrați primul din fiecare, ștergeți {n} de copii',
|
||||
},
|
||||
keeps: 'păstrat',
|
||||
deleteCopy: 'Ștergeți copia „{title}” din {path}',
|
||||
keepFirstTitle: 'Ștergeți copiile duplicate?',
|
||||
keepFirstBody: {
|
||||
one: 'Păstrați prima copie a fiecărui link și ștergeți {n} copie în plus? Acțiunea nu poate fi anulată.',
|
||||
few: 'Păstrați prima copie a fiecărui link și ștergeți celelalte {n} copii? Acțiunea nu poate fi anulată.',
|
||||
other:
|
||||
'Păstrați prima copie a fiecărui link și ștergeți celelalte {n} de copii? Acțiunea nu poate fi anulată.',
|
||||
},
|
||||
keepFirstPartial:
|
||||
'Copii șterse înainte de eroare: {done} din {total}. Nimic altceva nu a fost eliminat.',
|
||||
sort: 'Sortați A→Z',
|
||||
sortTitle: 'Sortați „{title}”?',
|
||||
sortBody: {
|
||||
one: 'Întâi dosarele, apoi marcajele, după nume. Se mută {n} element; nimic nu este redenumit sau șters, iar browserul nu poate anula operația.',
|
||||
few: 'Întâi dosarele, apoi marcajele, după nume. Se mută {n} elemente; nimic nu este redenumit sau șters, iar browserul nu poate anula operația.',
|
||||
other:
|
||||
'Întâi dosarele, apoi marcajele, după nume. Se mută {n} de elemente; nimic nu este redenumit sau șters, iar browserul nu poate anula operația.',
|
||||
},
|
||||
sortPartial:
|
||||
'Elemente mutate înainte ca browserul să refuze: {done} din {total}. Dosarul arată acum ordinea reală.',
|
||||
alreadySorted: 'Acest dosar este deja în ordine.',
|
||||
movedPosition: '{title}: poziția {position} din {total}',
|
||||
},
|
||||
settings: {
|
||||
autosave: 'Modificările se salvează pe măsură ce le faceți.',
|
||||
language: 'Limbă',
|
||||
languageNote: 'Se aplică doar acestei extensii, nu browserului.',
|
||||
localeAuto: 'Automat (ca browserul)',
|
||||
lang: {
|
||||
en: 'English',
|
||||
vi: 'Tiếng Việt',
|
||||
ja: '日本語',
|
||||
'zh-CN': '简体中文',
|
||||
ro: 'Română',
|
||||
},
|
||||
theme: 'Temă',
|
||||
// TODO(review-ro): "Sistem" is a noun beside two adjectives agreeing with „temă”.
|
||||
themes: {
|
||||
system: 'Sistem',
|
||||
light: 'Luminoasă',
|
||||
dark: 'Întunecată',
|
||||
},
|
||||
defaultExportFormat: 'Format de export implicit',
|
||||
defaultExportFormatNote: 'Preselectat când deschideți fila Export.',
|
||||
defaultImportMode: 'Mod de import implicit',
|
||||
defaultImportModeNote: 'Preselectat când deschideți fila Import.',
|
||||
csvDelimiter: 'Delimitator CSV',
|
||||
csvDelimiterNote: 'Folosiți punct și virgulă dacă foaia de calcul așteaptă acest separator.',
|
||||
markdownStyle: 'Aranjare Markdown',
|
||||
markdownStyleNote: 'Cum sunt aranjate dosarele în fișierele Markdown exportate.',
|
||||
saved: 'Setările au fost salvate',
|
||||
saveFailed: 'Setările nu au putut fi salvate.',
|
||||
reset: 'Reveniți la valorile implicite',
|
||||
resetTitle: 'Resetați toate setările?',
|
||||
resetBody:
|
||||
'Limba, tema și fiecare alegere implicită revin la valorile inițiale. Marcajele nu sunt afectate.',
|
||||
resetConfirm: 'Resetați',
|
||||
resetDone: 'Setările au revenit la valorile implicite',
|
||||
},
|
||||
about: {
|
||||
diagnostics: 'Diagnosticare',
|
||||
copyDiagnostics: 'Copiați datele de diagnosticare',
|
||||
diagnosticsNote:
|
||||
'Un scurt jurnal local cu ce a făcut această filă — coduri de eroare și numere, niciodată titluri sau adrese. Vă părăsește computerul doar dacă îl lipiți undeva.',
|
||||
diagnosticsCopied: 'Datele de diagnosticare au fost copiate',
|
||||
diagnosticsCopyFailed: 'Datele de diagnosticare nu au putut fi copiate.',
|
||||
tagline:
|
||||
'Import, export și editare de marcaje între browsere — offline, fără cont, fără cloud. Datele nu vă părăsesc niciodată dispozitivul.',
|
||||
version: 'Versiunea {version}',
|
||||
links: 'Linkuri',
|
||||
repo: 'Depozitul GitHub',
|
||||
issues: 'Raportați o problemă',
|
||||
changelog: 'Versiuni și jurnalul modificărilor',
|
||||
accessibility: 'Accesibilitate',
|
||||
store: 'Pagina din Magazinul Chrome Web',
|
||||
thirdParty: 'Cod terț',
|
||||
thirdPartyNote:
|
||||
'Nu este instalată nicio dependență de rulare. Câteva componente mici cu licență MIT sunt compilate în extensie: runtime-ul Svelte cu utilitarul său clsx și adaptorul de browser de o linie al WXT — consultați THIRD_PARTY_NOTICES.txt din pachet.',
|
||||
donate: 'Susțineți dezvoltarea',
|
||||
donateNote: 'Complet opțional — BookmarkMagic este software liber oricum.',
|
||||
legal: 'Informații juridice',
|
||||
accepted: 'Termenii juridici au fost acceptați pe {date} · versiunea {version}',
|
||||
acceptedUndated: 'Termenii juridici au fost acceptați · versiunea {version}',
|
||||
notAccepted: 'Nu ați acceptat încă termenii juridici.',
|
||||
},
|
||||
legal: {
|
||||
title: 'Înainte de a începe',
|
||||
summary:
|
||||
'BookmarkMagic rulează în întregime pe dispozitivul dumneavoastră. Nu are servere, nu face cereri în rețea și nu colectează nimic — marcajele și setările nu părăsesc niciodată acest browser. Este software liber sub licența GPL-3.0 și este furnizat fără nicio garanție. Operațiile cu marcaje modifică datele browserului, iar modul „Înlocuire completă” șterge marcajele actuale, așa că păstrați propriile copii de rezervă pentru tot ce contează pentru dumneavoastră.',
|
||||
updatedTitle: 'Termenii au fost actualizați',
|
||||
updatedBody:
|
||||
'Aceste documente s-au modificat de când le-ați acceptat. Citiți-le din nou pentru a continua.',
|
||||
documents: 'Documente',
|
||||
eula: 'Acord de licență pentru utilizatorul final',
|
||||
license: 'Licență (GPL-3.0)',
|
||||
disclaimer: 'Declinarea răspunderii',
|
||||
privacy: 'Politica de confidențialitate',
|
||||
englishNote: 'Documentele cu valoare juridică sunt cele în limba engleză.',
|
||||
accept: 'Am citit și accept termenii de mai sus',
|
||||
continue: 'Acceptați și continuați',
|
||||
close: 'Închideți fila',
|
||||
closeManually: 'Acum puteți închide această filă.',
|
||||
saveFailed:
|
||||
'Acceptarea nu a putut fi salvată, așa că nu s-a înregistrat nimic. Verificați dacă browserul permite stocarea pentru extensii, apoi încercați din nou.',
|
||||
blocked: 'Acceptați termenii pentru a folosi filele Import, Export și Editare.',
|
||||
},
|
||||
warnings,
|
||||
errors,
|
||||
} satisfies Dict;
|
||||
@@ -124,6 +124,7 @@ export default {
|
||||
sortPartial:
|
||||
'Đã di chuyển {done} trong số {total} mục trước khi trình duyệt từ chối. Thư mục đang hiển thị đúng thứ tự thực tế.',
|
||||
alreadySorted: 'Thư mục này đã được sắp xếp.',
|
||||
movedPosition: '{title}: vị trí thứ {position} trên {total}',
|
||||
},
|
||||
settings: {
|
||||
autosave: 'Thay đổi được lưu ngay khi bạn chỉnh.',
|
||||
@@ -135,6 +136,8 @@ export default {
|
||||
en: 'English',
|
||||
vi: 'Tiếng Việt',
|
||||
ja: '日本語',
|
||||
'zh-CN': '简体中文',
|
||||
ro: 'Română',
|
||||
},
|
||||
theme: 'Giao diện',
|
||||
themes: {
|
||||
@@ -173,6 +176,7 @@ export default {
|
||||
repo: 'Kho mã trên GitHub',
|
||||
issues: 'Báo lỗi',
|
||||
changelog: 'Bản phát hành và nhật ký thay đổi',
|
||||
accessibility: 'Hỗ trợ tiếp cận',
|
||||
store: 'Trang trên Chrome Web Store',
|
||||
thirdParty: 'Mã của bên thứ ba',
|
||||
thirdPartyNote:
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
import type { Dict } from './en';
|
||||
|
||||
/** Simplified Chinese strings for the Import tab — mirrors en-import.ts. */
|
||||
export const importTab = {
|
||||
dropHint: '将书签文件拖放到此处,或点击浏览 · 最大 {size}',
|
||||
dropFormats:
|
||||
'支持浏览器导出的 HTML、CSV、BookmarkMagic 和 Firefox 的 JSON 备份,以及 Chrome 自带的 Bookmarks 文件(该文件没有扩展名)。',
|
||||
reading: '正在读取 {name}…',
|
||||
preview: '预览',
|
||||
folderName: '已导入 {date}',
|
||||
start: { one: '导入 {n} 个书签', other: '导入 {n} 个书签' },
|
||||
backingUp: '替换前正在保存安全备份。请在保存对话框中确认以继续。',
|
||||
keepTabOpen: '导入完成前,请勿关闭此标签页。',
|
||||
progress: '正在导入… {done} / {total}',
|
||||
doneSummary: '完成——已创建 {bookmarks}和 {folders}。',
|
||||
skipped: '已跳过此浏览器中已有的 {existing} 项,以及文件中重复的 {inFile} 项。',
|
||||
stepSource: '来源',
|
||||
stepOptions: '选项',
|
||||
stepWriting: '写入',
|
||||
stepResult: '结果',
|
||||
format: {
|
||||
'netscape-html': 'HTML',
|
||||
'bm-json': 'BookmarkMagic JSON',
|
||||
csv: 'CSV',
|
||||
'chrome-json': 'Chrome Bookmarks 文件',
|
||||
'firefox-json': 'Firefox 备份',
|
||||
},
|
||||
countBookmarks: { one: '{n} 个书签', other: '{n} 个书签' },
|
||||
countFolders: { one: '{n} 个文件夹', other: '{n} 个文件夹' },
|
||||
countPair: '{bookmarks}和 {folders}',
|
||||
whereNewFolder:
|
||||
'所有内容都在“其他书签”下的“{folder}”文件夹中——删除这一个文件夹即可撤销本次导入。',
|
||||
whereMerge: '新项目已添加到各自所属文件夹的末尾。',
|
||||
whereReplace: '书签现在与文件中的内容完全一致。',
|
||||
replaceConfirmTitle: '要全部替换吗?',
|
||||
replaceConfirmBody:
|
||||
'保存安全备份后,将删除此浏览器中的 {current}。然后写入 {name} 中的 {incoming}。',
|
||||
replaceConfirm: '备份并替换',
|
||||
target: { bar: '书签栏', unfiled: '其他书签', mobile: '移动设备书签' },
|
||||
targetNote:
|
||||
'在合并和替换模式下,此文件夹中的内容会直接放入对应的浏览器文件夹,而不是创建它的副本。',
|
||||
reused: {
|
||||
one: '已添加到您原有的 {n} 个文件夹中,没有创建副本。',
|
||||
other: '已添加到您原有的 {n} 个文件夹中,没有创建副本。',
|
||||
},
|
||||
// Firefox's own zh-CN names for its roots. TODO(review-zh): confirm 移动设备上的书签.
|
||||
rootTitle: {
|
||||
toolbar: '书签工具栏',
|
||||
unfiled: '其他书签',
|
||||
mobile: '移动设备上的书签',
|
||||
},
|
||||
cancelledSummary: {
|
||||
one: '已取消——已创建的 {n} 项保持原样。',
|
||||
other: '已取消——已创建的 {n} 项保持原样。',
|
||||
},
|
||||
cancelledAfterClear: '您是在现有书签已被删除之后取消的,因此剩下的只有已重建的部分。',
|
||||
dateNotice:
|
||||
'导入的书签日期均为今天。Chrome 不允许扩展程序设置书签的原始日期——您导出的文件会保留真实日期。',
|
||||
partialCreated: {
|
||||
one: '操作失败前已创建 {n} 项,这些项保持原样。',
|
||||
other: '操作失败前已创建 {n} 项,这些项保持原样。',
|
||||
},
|
||||
partialCleared: {
|
||||
one: '操作失败前已删除 {n} 个顶层项目。请从备份中恢复。',
|
||||
other: '操作失败前已删除 {n} 个顶层项目。请从备份中恢复。',
|
||||
},
|
||||
backupFileType: '书签备份',
|
||||
backupHint: '您的安全备份已保存为 {name}。导入该 JSON 文件即可恢复。',
|
||||
openEdit: '打开“编辑”标签页',
|
||||
another: '导入其他文件',
|
||||
dedupe: '跳过此浏览器中已有的重复项(找到 {n} 个)',
|
||||
dedupeDisabled: '不适用:“全部替换”会先删除您当前的书签。',
|
||||
replaceWarning:
|
||||
'此操作会删除当前的全部书签。会先保存一份 JSON 安全备份,备份成功之前不会删除任何内容。',
|
||||
attest:
|
||||
'您的浏览器无法确认备份已保存。请在下载文件夹中查找 {name},然后确认——目前尚未删除任何内容。',
|
||||
attestConfirm: '我已有备份——删除并替换',
|
||||
clearing: '正在删除当前的书签。请勿关闭此标签页。',
|
||||
badgeNew: '新',
|
||||
badgeDup: '重复',
|
||||
expand: '展开文件夹',
|
||||
collapse: '折叠文件夹',
|
||||
stats: {
|
||||
bookmarks: '书签',
|
||||
folders: '文件夹',
|
||||
depth: '最大深度',
|
||||
duplicates: '重复项',
|
||||
},
|
||||
mode: {
|
||||
legend: '要如何添加这些内容?',
|
||||
newFolder: '放入新文件夹(推荐)',
|
||||
merge: '合并到现有文件夹',
|
||||
replace: '全部替换',
|
||||
newFolderNote: '不会改动任何现有内容;如果改变主意,只需删除一个带日期的文件夹。',
|
||||
mergeNote: '沿用您已有的文件夹;新项目添加到这些文件夹的末尾。',
|
||||
replaceNote: '先保存备份,再删除所有内容。用于恢复备份。',
|
||||
},
|
||||
warnings: {
|
||||
title: { one: '{n} 条警告', other: '{n} 条警告' },
|
||||
},
|
||||
} satisfies Dict['import'];
|
||||
@@ -0,0 +1,80 @@
|
||||
import type { Dict } from './en';
|
||||
|
||||
/** Simplified Chinese warnings and errors — mirrors en-notices.ts (docs/07 §2). */
|
||||
|
||||
export const warnings = {
|
||||
NO_BOOKMARKS: {
|
||||
one: '此文件不包含任何书签。',
|
||||
other: '此文件不包含任何书签。',
|
||||
},
|
||||
DESCRIPTIONS_DROPPED: {
|
||||
one: '已丢弃 {n} 条描述——书签模型中没有存放描述的位置。',
|
||||
other: '已丢弃 {n} 条描述——书签模型中没有存放描述的位置。',
|
||||
},
|
||||
FAVICONS_IGNORED: {
|
||||
one: '已忽略 {n} 个网站图标——书签 API 无法设置网站图标。',
|
||||
other: '已忽略 {n} 个网站图标——书签 API 无法设置网站图标。',
|
||||
},
|
||||
INVALID_DATE: {
|
||||
one: '{n} 个无法识别的日期已留空。',
|
||||
other: '{n} 个无法识别的日期已留空。',
|
||||
},
|
||||
MISSING_URL: {
|
||||
one: '{n} 个条目没有地址,已跳过。',
|
||||
other: '{n} 个条目没有地址,已跳过。',
|
||||
},
|
||||
NEWER_VERSION: {
|
||||
one: '此文件由较新的版本写入——将尽可能读取。',
|
||||
other: '此文件由较新的版本写入——将尽可能读取。',
|
||||
},
|
||||
EMPTY_TITLE: {
|
||||
one: '{n} 个书签没有标题——浏览器会改为显示其地址。',
|
||||
other: '{n} 个书签没有标题——浏览器会改为显示其地址。',
|
||||
},
|
||||
INVALID_URL: {
|
||||
one: '{n} 个条目的地址无法存入浏览器,因此已跳过。',
|
||||
other: '{n} 个条目的地址无法存入浏览器,因此已跳过。',
|
||||
},
|
||||
PLACE_QUERIES_SKIPPED: {
|
||||
one: '已跳过 {n} 个 Firefox 智能书签(已保存的搜索,而非网页)——在这里它会成为失效链接。',
|
||||
other: '已跳过 {n} 个 Firefox 智能书签(已保存的搜索,而非网页)——在这里它们会成为失效链接。',
|
||||
},
|
||||
EXTRA_ROOTS_SKIPPED: {
|
||||
one: '浏览器专用文件夹(例如 Opera 的快速拨号或回收站)中的 {n} 个书签未导入。',
|
||||
other: '浏览器专用文件夹(例如 Opera 的快速拨号或回收站)中的 {n} 个书签未导入。',
|
||||
},
|
||||
UNREADABLE_ENTRIES: {
|
||||
one: '此文件中有 {n} 个条目无法读取,已跳过。',
|
||||
other: '此文件中有 {n} 个条目无法读取,已跳过。',
|
||||
},
|
||||
} satisfies Dict['warnings'];
|
||||
|
||||
export const errors = {
|
||||
NOT_NETSCAPE: '这似乎不是书签 HTML 文件。',
|
||||
NOT_BM_JSON:
|
||||
'此 JSON 文件不是 BookmarkMagic 能读取的书签文件。它可以读取自己的备份、Firefox 的 JSON 备份和 Chrome 的 Bookmarks 文件。',
|
||||
MALFORMED_JSON: '此文件不是有效的 JSON。',
|
||||
INVALID_NODE: '此文件中有 BookmarkMagic 无法读取的条目。',
|
||||
BAD_CSV_HEADER: 'CSV 标题行缺失,或其中各列的顺序不正确。',
|
||||
CSV_ROW_MISMATCH: '某一 CSV 行的列数不正确。',
|
||||
CSV_UNCLOSED_QUOTE: '某个带引号的 CSV 字段始终没有闭合,因此无法可靠地读取文件的其余部分。',
|
||||
UNKNOWN_FORMAT:
|
||||
'无法识别此文件——应为浏览器导出的书签 HTML、CSV、BookmarkMagic 或 Firefox 的 JSON 备份,或 Chrome 的 Bookmarks 文件。',
|
||||
FILE_TOO_LARGE: '此文件太大,无法导入。',
|
||||
TOO_MANY_NODES: '此文件包含的书签过多,无法安全导入。',
|
||||
TOO_DEEP: '此文件中的文件夹嵌套层级过深。',
|
||||
BACKUP_SERIALIZE_FAILED: '无法准备安全备份,因此未做任何更改。',
|
||||
BACKUP_EXCEEDS_LIMITS:
|
||||
'您当前的书签超出了 BookmarkMagic 能从备份中读回的范围,因此“全部替换”在删除任何内容之前就已停止。请改用“合并到现有文件夹”或“放入新文件夹”。',
|
||||
BACKUP_STALE:
|
||||
'保存安全备份期间,您的书签一直在变化(另一个窗口、标签页或同步正在编辑它们),因此未删除任何内容。请稍后重试。',
|
||||
BACKUP_CANCELLED: '您取消了安全备份,因此未删除任何内容。',
|
||||
BACKUP_WRITE_FAILED: '无法保存安全备份,因此未删除任何内容。',
|
||||
BROWSER: '浏览器拒绝了一项书签操作。',
|
||||
WRITE_LOCKED: '另一个 BookmarkMagic 标签页正在写入书签。请等待其完成后重试——未做任何更改。',
|
||||
NO_WRITABLE_ROOTS:
|
||||
'此浏览器个人资料中没有 BookmarkMagic 有权写入的书签文件夹。由组织管理的书签无法更改。',
|
||||
PARTIAL_WRITE: '导入过程中,浏览器中途停止接受书签。',
|
||||
PARTIAL_CLEAR: '替换书签的过程中,浏览器中途停止了操作。',
|
||||
UNKNOWN: '出了点问题。',
|
||||
} satisfies Dict['errors'];
|
||||
@@ -0,0 +1,211 @@
|
||||
import type { Dict } from './en';
|
||||
import { importTab } from './zh-CN-import';
|
||||
import { errors, warnings } from './zh-CN-notices';
|
||||
|
||||
/**
|
||||
* Simplified Chinese — Chrome's own zh-CN terms (书签, 书签栏, 文件夹, 导入,
|
||||
* 导出), 您 used sparingly, full-width punctuation, and one half-width space
|
||||
* between Han characters and Latin text, numbers or a {token} (docs/07 §4).
|
||||
* TODO(review-zh): best-effort until a native pass (docs/00 §10).
|
||||
*/
|
||||
export default {
|
||||
common: {
|
||||
appName: 'BookmarkMagic',
|
||||
import: '导入',
|
||||
export: '导出',
|
||||
edit: '编辑',
|
||||
settings: '设置',
|
||||
about: '关于',
|
||||
busy: '导入正在进行中',
|
||||
cancel: '取消',
|
||||
dismiss: '关闭',
|
||||
sections: '页面导航',
|
||||
detail: '技术详情',
|
||||
},
|
||||
popup: {
|
||||
import: '导入书签…',
|
||||
importHint: 'HTML、CSV、JSON 备份、Chrome 的 Bookmarks 文件',
|
||||
export: '导出书签…',
|
||||
exportHint: 'HTML、JSON、CSV 或 Markdown',
|
||||
manage: '打开管理器',
|
||||
manageHint: '编辑、排序、查找重复项',
|
||||
bookmarks: { one: '书签', other: '书签' },
|
||||
folders: { one: '文件夹', other: '文件夹' },
|
||||
},
|
||||
status: {
|
||||
local: '仅限本地',
|
||||
localNote: '无网络:此扩展程序无法向任何地方发送任何内容。',
|
||||
permissionsNote: '此扩展程序仅有的两项权限。',
|
||||
more: '更多',
|
||||
},
|
||||
import: importTab,
|
||||
export: {
|
||||
scope: '导出范围',
|
||||
everything: '全部',
|
||||
format: '格式',
|
||||
start: { one: '导出 {n} 个书签', other: '导出 {n} 个书签' },
|
||||
started: '已开始下载:{name}',
|
||||
markdownNote: 'Markdown 仅供分享——BookmarkMagic 无法将其重新导入。',
|
||||
csvNote: 'CSV 是扁平化的视图:空文件夹以及哪个文件夹是书签栏都不会保留。',
|
||||
csvDelimiter: '分隔符',
|
||||
comma: '逗号(,)',
|
||||
semicolon: '分号(;)',
|
||||
markdownStyle: '布局',
|
||||
nested: '嵌套列表',
|
||||
flat: '每个文件夹一个标题',
|
||||
formats: {
|
||||
'netscape-html': {
|
||||
name: 'HTML',
|
||||
note: '适用于 Chrome、Edge、Brave、Firefox、Safari、Vivaldi 和 Opera。',
|
||||
},
|
||||
'bm-json': { name: 'JSON', note: '无损备份——日后恢复的最佳选择。' },
|
||||
csv: { name: 'CSV', note: '用于电子表格。扁平化。' },
|
||||
markdown: { name: 'Markdown', note: '用于在 README、博客文章或聊天中分享。' },
|
||||
},
|
||||
},
|
||||
edit: {
|
||||
tree: '书签树',
|
||||
loading: '正在读取书签…',
|
||||
search: '搜索书签',
|
||||
filterFolders: '筛选文件夹',
|
||||
newFolder: '新建文件夹',
|
||||
newFolderTitle: '新建文件夹',
|
||||
findDuplicates: '查找重复项',
|
||||
expandAll: '全部展开',
|
||||
collapseAll: '全部折叠',
|
||||
rename: '重命名',
|
||||
open: '打开',
|
||||
copyUrl: '复制链接',
|
||||
unsafeUrl: '此地址使用了 BookmarkMagic 不会打开的协议。',
|
||||
copied: '链接已复制',
|
||||
copyFailed: '无法复制链接。',
|
||||
moveTo: '移至…',
|
||||
moveToBody: '要将“{title}”移至哪个文件夹?',
|
||||
noMoveTargets: '没有其他可用的文件夹。',
|
||||
delete: '删除',
|
||||
untitled: '(无标题)',
|
||||
empty: '还没有书签——先导入一些吧。',
|
||||
noMatches: '没有与该搜索匹配的内容。',
|
||||
showMore: {
|
||||
one: '再显示 {n} 行 · 还有 {total} 行未显示',
|
||||
other: '再显示 {n} 行 · 还有 {total} 行未显示',
|
||||
},
|
||||
showEarlier: { one: '显示之前的 {n} 行', other: '显示之前的 {n} 行' },
|
||||
deleteTitle: '要删除此项吗?',
|
||||
deleteBody: '要删除“{title}”吗?此操作无法撤销。',
|
||||
deleteFolderBody: {
|
||||
one: '要删除“{title}”及其中的 {n} 项吗?此操作无法撤销。',
|
||||
other: '要删除“{title}”及其中的 {n} 项吗?此操作无法撤销。',
|
||||
},
|
||||
duplicates: '重复项',
|
||||
duplicateSummary: '{links} · {copies}',
|
||||
duplicateLinks: { one: '{n} 个重复链接', other: '{n} 个重复链接' },
|
||||
extraCopies: { one: '{n} 个多余副本', other: '{n} 个多余副本' },
|
||||
noDuplicates: '未发现重复的链接。',
|
||||
keepFirst: {
|
||||
one: '每个链接保留第一个,删除 {n} 个副本',
|
||||
other: '每个链接保留第一个,删除 {n} 个副本',
|
||||
},
|
||||
keeps: '已保留',
|
||||
deleteCopy: '删除 {path} 中的副本“{title}”',
|
||||
keepFirstTitle: '要删除重复的副本吗?',
|
||||
keepFirstBody: {
|
||||
one: '保留每个链接的第一个副本,并删除其余 {n} 个?此操作无法撤销。',
|
||||
other: '保留每个链接的第一个副本,并删除其余 {n} 个?此操作无法撤销。',
|
||||
},
|
||||
keepFirstPartial: '已删除 {total} 个副本中的 {done} 个,随后操作失败。没有删除其他任何内容。',
|
||||
sort: '排序 A→Z',
|
||||
sortTitle: '要对“{title}”排序吗?',
|
||||
sortBody: {
|
||||
one: '先文件夹后书签,按名称排列。将移动 {n} 项;不会重命名或删除任何内容,且浏览器无法撤销此操作。',
|
||||
other:
|
||||
'先文件夹后书签,按名称排列。将移动 {n} 项;不会重命名或删除任何内容,且浏览器无法撤销此操作。',
|
||||
},
|
||||
sortPartial:
|
||||
'已移动 {total} 项中的 {done} 项,随后浏览器拒绝了操作。文件夹现在显示的是实际顺序。',
|
||||
alreadySorted: '此文件夹已经排好序了。',
|
||||
movedPosition: '{title}:第 {position} 项,共 {total} 项',
|
||||
},
|
||||
settings: {
|
||||
autosave: '更改会随时自动保存。',
|
||||
language: '语言',
|
||||
languageNote: '仅适用于此扩展程序,不影响浏览器。',
|
||||
localeAuto: '自动(跟随浏览器)',
|
||||
lang: {
|
||||
en: 'English',
|
||||
vi: 'Tiếng Việt',
|
||||
ja: '日本語',
|
||||
'zh-CN': '简体中文',
|
||||
ro: 'Română',
|
||||
},
|
||||
theme: '主题',
|
||||
themes: {
|
||||
system: '跟随系统',
|
||||
light: '浅色',
|
||||
dark: '深色',
|
||||
},
|
||||
defaultExportFormat: '默认导出格式',
|
||||
defaultExportFormatNote: '打开“导出”标签页时预先选中。',
|
||||
defaultImportMode: '默认导入方式',
|
||||
defaultImportModeNote: '打开“导入”标签页时预先选中。',
|
||||
csvDelimiter: 'CSV 分隔符',
|
||||
csvDelimiterNote: '如果电子表格要求使用分号,请选择分号。',
|
||||
markdownStyle: 'Markdown 布局',
|
||||
markdownStyleNote: '导出的 Markdown 如何排列文件夹。',
|
||||
saved: '设置已保存',
|
||||
saveFailed: '无法保存设置。',
|
||||
reset: '恢复默认设置',
|
||||
resetTitle: '要重置所有设置吗?',
|
||||
resetBody: '语言、主题以及每项默认选择都会恢复为初始状态。书签不受影响。',
|
||||
resetConfirm: '重置',
|
||||
resetDone: '已恢复默认设置',
|
||||
},
|
||||
about: {
|
||||
diagnostics: '诊断信息',
|
||||
copyDiagnostics: '复制诊断信息',
|
||||
diagnosticsNote:
|
||||
'记录此标签页所做操作的简短本地日志——只有错误代码和数量,绝不包含标题或地址。只有当您把它粘贴到别处时,它才会离开您的电脑。',
|
||||
diagnosticsCopied: '诊断信息已复制',
|
||||
diagnosticsCopyFailed: '无法复制诊断信息。',
|
||||
tagline:
|
||||
'在浏览器之间导入、导出和编辑书签——离线运行,无需账户,无需云端。您的数据绝不会离开您的设备。',
|
||||
version: '版本 {version}',
|
||||
links: '链接',
|
||||
repo: 'GitHub 代码库',
|
||||
issues: '报告问题',
|
||||
changelog: '版本发布与更新日志',
|
||||
accessibility: '无障碍',
|
||||
store: 'Chrome 网上应用店页面',
|
||||
thirdParty: '第三方代码',
|
||||
thirdPartyNote:
|
||||
'未安装任何运行时依赖项。扩展程序中编译了几个采用 MIT 许可的小组件:Svelte 运行时及其 clsx 辅助函数,以及 WXT 的一行浏览器适配代码——详见软件包中的 THIRD_PARTY_NOTICES.txt。',
|
||||
donate: '支持开发',
|
||||
donateNote: '完全自愿——无论如何,BookmarkMagic 都是自由软件。',
|
||||
legal: '法律信息',
|
||||
accepted: '已于 {date} 接受法律条款 · 版本 {version}',
|
||||
acceptedUndated: '已接受法律条款 · 版本 {version}',
|
||||
notAccepted: '您尚未接受法律条款。',
|
||||
},
|
||||
legal: {
|
||||
title: '开始之前',
|
||||
summary:
|
||||
'BookmarkMagic 完全在您的设备上运行。它没有服务器,不发出任何网络请求,也不收集任何信息——您的书签和设置绝不会离开此浏览器。它是采用 GPL-3.0 许可证的自由软件,不提供任何形式的担保。书签操作会更改您的浏览器数据,而“全部替换”模式会删除您当前的书签,因此请自行备份您在意的任何内容。',
|
||||
updatedTitle: '条款已更新',
|
||||
updatedBody: '自您接受以来,这些文档已有更改。请重新阅读后继续。',
|
||||
documents: '文档',
|
||||
eula: '最终用户许可协议',
|
||||
license: '许可证(GPL-3.0)',
|
||||
disclaimer: '免责声明',
|
||||
privacy: '隐私政策',
|
||||
englishNote: '具有法律约束力的文档仅有英文版本。',
|
||||
accept: '我已阅读并接受上述条款',
|
||||
continue: '接受并继续',
|
||||
close: '关闭标签页',
|
||||
closeManually: '您现在可以关闭此标签页了。',
|
||||
saveFailed:
|
||||
'无法保存您的同意,因此没有记录任何内容。请检查此浏览器是否允许扩展程序使用存储空间,然后重试。',
|
||||
blocked: '接受条款后即可使用“导入”“导出”和“编辑”标签页。',
|
||||
},
|
||||
warnings,
|
||||
errors,
|
||||
} satisfies Dict;
|
||||
@@ -1,19 +1,54 @@
|
||||
/**
|
||||
* Locale resolution — pure, so it is unit-testable without the runes runtime.
|
||||
* The shipped locales and how a browser language maps onto them — docs/07 §2.
|
||||
*
|
||||
* Pure, so it is unit-testable without the runes runtime.
|
||||
* Inputs: a browser UI language tag (`chrome.i18n.getUILanguage()`).
|
||||
* Guarantees: always returns a supported locale; never throws.
|
||||
*/
|
||||
export type Locale = 'en' | 'vi' | 'ja';
|
||||
|
||||
/**
|
||||
* Every UI locale BookmarkMagic ships, in the order the language switcher
|
||||
* lists them — the single source of truth (docs/07 §2, §6).
|
||||
*
|
||||
* `as const` is right *here*: these are ids, not a dictionary (the ban in
|
||||
* docs/07 §2 is about dictionaries). Every table keyed by locale is a
|
||||
* `Record<Locale, …>`, so adding an id here and forgetting a table is a
|
||||
* compile error, not a silent fallback to English.
|
||||
*/
|
||||
export const LOCALES = ['en', 'vi', 'ja', 'zh-CN', 'ro'] as const;
|
||||
|
||||
export type Locale = (typeof LOCALES)[number];
|
||||
|
||||
/** Regions whose Chinese is written in Traditional characters. */
|
||||
const TRADITIONAL_REGIONS = new Set(['tw', 'hk', 'mo']);
|
||||
|
||||
/**
|
||||
* Map a browser UI language tag onto a supported locale (docs/07 §2).
|
||||
* Only the primary subtag matters: `vi`, `vi-VN` → vi; `ja`, `ja-JP` → ja;
|
||||
* everything else falls back to English, the default locale.
|
||||
* Only whole subtags count: `vi`, `vi-VN` → vi; `ja`, `ja-JP` → ja; `vic` or
|
||||
* `jav` are other languages. Everything else falls back to English, the
|
||||
* default locale.
|
||||
*/
|
||||
export function resolveLocale(uiLanguage: string): Locale {
|
||||
const tag = uiLanguage.toLowerCase();
|
||||
if (tag === 'vi' || tag.startsWith('vi-')) return 'vi';
|
||||
if (tag === 'ja' || tag.startsWith('ja-')) return 'ja';
|
||||
const [language = '', ...rest] = uiLanguage.toLowerCase().split(/[-_]/u);
|
||||
// Stop at the first singleton (`-u-…` extensions, `-x-…` private use): only
|
||||
// the script and region before it say which Chinese this is.
|
||||
const singleton = rest.findIndex((subtag) => subtag.length === 1);
|
||||
const subtags = singleton === -1 ? rest : rest.slice(0, singleton);
|
||||
if (language === 'vi') return 'vi';
|
||||
if (language === 'ja') return 'ja';
|
||||
if (language === 'zh') return isTraditional(subtags) ? 'en' : 'zh-CN';
|
||||
if (language === 'ro') return 'ro';
|
||||
return 'en';
|
||||
}
|
||||
|
||||
/**
|
||||
* Traditional Chinese gets English, not Simplified (docs/07 §1–2): Chrome's
|
||||
* own manifest fallback goes `zh_TW → zh → en`, so mapping it to `zh-CN` here
|
||||
* would make the extension's name and its UI disagree. An explicit script
|
||||
* subtag wins over the region (`zh-Hans-HK` is Simplified).
|
||||
*/
|
||||
function isTraditional(subtags: readonly string[]): boolean {
|
||||
if (subtags.includes('hant')) return true;
|
||||
if (subtags.includes('hans')) return false;
|
||||
return subtags.some((subtag) => TRADITIONAL_REGIONS.has(subtag));
|
||||
}
|
||||
@@ -19,6 +19,14 @@ export const ISSUES_URL = `${REPO_URL}/issues`;
|
||||
|
||||
export const CHANGELOG_URL = `${REPO_URL}/blob/main/CHANGELOG.md`;
|
||||
|
||||
/**
|
||||
* The accessibility statement (docs/06 §3.5, §5): what works, what was tested,
|
||||
* what is known not to, the tree's keys — shown nowhere in the UI — and how to
|
||||
* report a barrier. A link to the file, not an address: no email appears on an
|
||||
* in-product surface (see STORE_URL below).
|
||||
*/
|
||||
export const ACCESSIBILITY_URL = `${REPO_URL}/blob/main/ACCESSIBILITY.md`;
|
||||
|
||||
/**
|
||||
* The published Chrome Web Store listing (item id — docs/00 §9).
|
||||
*
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import type { ExportFormat, ImportMode, ThemePreference } from '../browser/storage';
|
||||
import type { CsvDelimiter } from '../core/csv-dialect';
|
||||
import type { MarkdownStyle } from '../core/serialize/markdown';
|
||||
import type { Locale } from '../i18n/resolve-locale';
|
||||
import { LOCALES, type Locale } from '../i18n/resolve-locale';
|
||||
|
||||
export interface SettingChoice<T extends string> {
|
||||
value: T;
|
||||
@@ -20,12 +20,13 @@ export interface SettingChoice<T extends string> {
|
||||
labelKey: string;
|
||||
}
|
||||
|
||||
/** `'auto'` is a first-class option: it is what `DEFAULT_SETTINGS.locale` is. */
|
||||
/**
|
||||
* `'auto'` is a first-class option: it is what `DEFAULT_SETTINGS.locale` is.
|
||||
* The rest follow `LOCALES`, so a new locale gets its row without an edit here.
|
||||
*/
|
||||
export const LOCALE_CHOICES: readonly SettingChoice<Locale | 'auto'>[] = [
|
||||
{ value: 'auto', labelKey: 'settings.localeAuto' },
|
||||
{ value: 'en', labelKey: 'settings.lang.en' },
|
||||
{ value: 'vi', labelKey: 'settings.lang.vi' },
|
||||
{ value: 'ja', labelKey: 'settings.lang.ja' },
|
||||
...LOCALES.map((locale) => ({ value: locale, labelKey: `settings.lang.${locale}` })),
|
||||
];
|
||||
|
||||
export const THEME_CHOICES: readonly SettingChoice<ThemePreference>[] = [
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
moveNode,
|
||||
removeNode,
|
||||
} from '../edit/patch-tree';
|
||||
import { nudgeTarget } from '../edit/tree-keyboard';
|
||||
import { EditView } from './edit-view.svelte';
|
||||
|
||||
/** The slice of `browser/bookmarks.ts` the tab writes through — injectable for tests. */
|
||||
@@ -55,6 +56,12 @@ export interface BulkProgress {
|
||||
/** A failed command, shown above the tree rather than replacing it. */
|
||||
export type ActionError = DescribedError & { partial?: BulkProgress };
|
||||
|
||||
/** Where a moved row ended up among the siblings on screen, 1-based — what the tab speaks. */
|
||||
export interface Placement {
|
||||
position: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
/** Where a delete was asked for: the tree (Del, a row's button) or the duplicate panel. */
|
||||
export type DeleteOrigin = 'tree' | 'panel';
|
||||
|
||||
@@ -79,6 +86,8 @@ export class EditCommands extends EditView {
|
||||
busy = $state(false);
|
||||
/** Where the pending delete was asked for. */
|
||||
private deleteOrigin: DeleteOrigin = 'tree';
|
||||
/** An Alt+↑/↓ move is in flight. */
|
||||
private nudging = false;
|
||||
|
||||
protected readonly api: EditApi;
|
||||
protected readonly locale: () => string;
|
||||
@@ -208,14 +217,19 @@ export class EditCommands extends EditView {
|
||||
});
|
||||
};
|
||||
|
||||
/** Shared by drag & drop and the keyboard "Move to…" dialog. */
|
||||
moveTo = async (id: string, plan: DropPlan): Promise<void> => {
|
||||
if (this.busy) return;
|
||||
/**
|
||||
* Shared by drag & drop, the keyboard "Move to…" dialog and Alt+↑/↓.
|
||||
*
|
||||
* @returns whether the move was made — false when it was refused here or by
|
||||
* the browser.
|
||||
*/
|
||||
moveTo = async (id: string, plan: DropPlan): Promise<boolean> => {
|
||||
if (this.busy) return false;
|
||||
const node = findNode(this.roots, id);
|
||||
if (node === undefined || !this.isEditable(node)) return;
|
||||
if (!canMoveInto(this.roots, id, plan.parentId)) return;
|
||||
if (node === undefined || !this.isEditable(node)) return false;
|
||||
if (!canMoveInto(this.roots, id, plan.parentId)) return false;
|
||||
const { parentId, position } = plan;
|
||||
await this.guard(async () => {
|
||||
return this.guard(async () => {
|
||||
this.roots = moveNode(this.roots, id, parentId, position?.local);
|
||||
await this.api.move(
|
||||
id,
|
||||
@@ -224,6 +238,36 @@ export class EditCommands extends EditView {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Alt+↑ / Alt+↓: the keyboard's "before" and "after" (docs/06 §5). It picks
|
||||
* the sibling shown above or below and hands it to the drag's own planner,
|
||||
* so a key and a drag cannot disagree about what is legal.
|
||||
*
|
||||
* One at a time: a held key repeats faster than a move completes, and a
|
||||
* second plan made before the first has landed is made from a tree that is
|
||||
* about to change.
|
||||
*
|
||||
* @returns where the row now sits among the siblings on screen — the same
|
||||
* "n of m" its `aria-posinset` and `aria-setsize` say, so under a search
|
||||
* the spoken place and the tree's agree; `undefined` when nothing moved —
|
||||
* an end of the folder, a root, a managed node, busy.
|
||||
*/
|
||||
nudge = async (id: string, direction: -1 | 1): Promise<Placement | undefined> => {
|
||||
if (this.nudging) return undefined;
|
||||
const target = nudgeTarget(this.rows, id, direction);
|
||||
if (target === undefined) return undefined;
|
||||
const plan = planDrop(this.roots, id, target, direction < 0 ? 'before' : 'after');
|
||||
if (plan?.position === undefined) return undefined;
|
||||
this.nudging = true;
|
||||
try {
|
||||
if (!(await this.moveTo(id, plan))) return undefined;
|
||||
} finally {
|
||||
this.nudging = false;
|
||||
}
|
||||
const row = this.rows.find((candidate) => candidate.node.id === id);
|
||||
return row === undefined ? undefined : { position: row.posInSet, total: row.setSize };
|
||||
};
|
||||
|
||||
/** A drag released on `targetId`; every illegal or no-op drop does nothing. */
|
||||
drop = async (targetId: string, zone: DropZone): Promise<void> => {
|
||||
const id = this.draggingId;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* The #edit tab's live sync, wired — docs/03 §3 "Live sync", docs/05 §11.
|
||||
*
|
||||
* Purpose: subscribe an `EditSession` to the browser's bookmark events for as
|
||||
* long as the tab is mounted. Out of EditTab so the component stays markup
|
||||
* and wiring (docs/10 §1); the batching itself is `edit/live-sync.ts`.
|
||||
* Guarantees: one patch per frame, and a single re-read for a burst — an
|
||||
* import in another tab sends an event per node. Listeners attach on enter
|
||||
* and detach on leave: a tab left subscribed during an import would take one
|
||||
* event per created node.
|
||||
*/
|
||||
import { subscribe } from '../browser/bookmarks';
|
||||
import { toEditNode } from '../edit/edit-node';
|
||||
import { type BatcherOptions, createBatcher } from '../edit/live-sync';
|
||||
import type { EditSession } from './edit-session.svelte';
|
||||
|
||||
/**
|
||||
* @param schedule when a batch is flushed — the next frame by default; tests
|
||||
* pass one they fire by hand.
|
||||
* @returns the teardown: unsubscribe, and drop anything still queued.
|
||||
*/
|
||||
export function connectLive(
|
||||
session: EditSession,
|
||||
schedule?: BatcherOptions['schedule'],
|
||||
): () => void {
|
||||
const batcher = createBatcher({
|
||||
onFlush: session.applyLiveEvents,
|
||||
onBurst: () => void session.load(),
|
||||
...(schedule === undefined ? {} : { schedule }),
|
||||
});
|
||||
let importing = false;
|
||||
const unsubscribe = subscribe({
|
||||
onCreated: (_id, node) => {
|
||||
if (importing || node.parentId === undefined) return;
|
||||
batcher.push({
|
||||
kind: 'created',
|
||||
parentId: node.parentId,
|
||||
index: node.index,
|
||||
node: toEditNode(node),
|
||||
});
|
||||
},
|
||||
onRemoved: (id) => batcher.push({ kind: 'removed', id }),
|
||||
onChanged: (id, changes) => batcher.push({ kind: 'changed', id, changes }),
|
||||
onMoved: (id, info) => batcher.push({ kind: 'moved', id, ...info }),
|
||||
onChildrenReordered: () => batcher.resync(),
|
||||
onImportBegan: () => {
|
||||
importing = true;
|
||||
},
|
||||
onImportEnded: () => {
|
||||
importing = false;
|
||||
batcher.resync();
|
||||
},
|
||||
});
|
||||
return () => {
|
||||
unsubscribe();
|
||||
batcher.dispose();
|
||||
};
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export type LegalStatus =
|
||||
*
|
||||
* Normative and stated identically in docs/03 §4, docs/14 §2 and the docs/15
|
||||
* decision log: `#settings` and `#about` stay reachable, `#about` so the linked
|
||||
* documents can be read before accepting and `#settings` so a VI/JA user can
|
||||
* documents can be read before accepting and `#settings` so a non-English user can
|
||||
* switch language first — which is why the gate carries no switcher of its own.
|
||||
*/
|
||||
const GATED_ROUTES: readonly Route[] = Object.freeze(['import', 'export', 'edit']);
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"appName": { "message": "BookmarkMagic" },
|
||||
"appDesc": {
|
||||
"message": "Import, export și editare de marcaje între browsere — offline, fără cont, fără cloud."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"appName": { "message": "BookmarkMagic" },
|
||||
"appDesc": {
|
||||
"message": "在浏览器之间导入、导出和编辑书签——离线运行,无需账户,无需云端。"
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,14 @@ a {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
/* The browser's default placeholder grey is not one of our tokens, so the
|
||||
contrast test never saw it: about 4:1 on --bg-sunken. --fg-muted is a tested
|
||||
pair on every surface (docs/06 §1). */
|
||||
::placeholder {
|
||||
color: var(--fg-muted);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Mono for anything machine-shaped: counts, versions, paths, addresses. */
|
||||
code,
|
||||
kbd,
|
||||
|
||||
+8
-1
@@ -15,6 +15,13 @@ treat the dashboard as authoritative and correct these files, not the listing.
|
||||
| `listing.en.md` | Name, summary, description — English is required by CWS and is the canonical version |
|
||||
| `listing.vi.md` | Vietnamese localized fields |
|
||||
| `listing.ja.md` | Japanese localized fields |
|
||||
| `listing.zh_CN.md` | Simplified Chinese localized fields (since v1.2.0) |
|
||||
| `listing.ro.md` | Romanian localized fields (since v1.2.0) |
|
||||
|
||||
Files are named by **Chrome's** locale code (`zh_CN`, with an underscore), the
|
||||
same spelling as `src/public/_locales/`. Adding a language: `docs/07 §6` and
|
||||
`docs/13 §4` — the `LANGUAGES` paragraph inside *every* description lists the
|
||||
languages, so all of them are re-pasted when one is added.
|
||||
|
||||
The summary field is capped at **132 characters** by the dashboard. Each file
|
||||
records its own count; re-check after any edit, because the limit is enforced at
|
||||
@@ -22,4 +29,4 @@ submission time and a rejection there costs a round trip.
|
||||
|
||||
Legal documents are English-only by design (`docs/07 §5`, `docs/14`), so there
|
||||
is no localized privacy policy to keep in step — the privacy-policy URL is the
|
||||
same in all three listings.
|
||||
same in every listing.
|
||||
+1
-1
@@ -38,7 +38,7 @@ PRIVACY BY DESIGN
|
||||
• Free & open source (GPL-3.0) — read the code on GitHub.
|
||||
|
||||
LANGUAGES
|
||||
English · Tiếng Việt · 日本語
|
||||
English · Tiếng Việt · 日本語 · 简体中文 · Română
|
||||
|
||||
LIMITATIONS (HONESTY CORNER)
|
||||
• Favicons can't be imported — the extensions API for bookmarks has no
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ native pass (`docs/00 §10.9`). Review before relying on it for a listing edit.
|
||||
• 無料・オープンソース(GPL-3.0)です。コードは GitHub で確認できます。
|
||||
|
||||
対応言語
|
||||
English · Tiếng Việt · 日本語
|
||||
English · Tiếng Việt · 日本語 · 简体中文 · Română
|
||||
|
||||
制限事項(正直に)
|
||||
• ファビコンはインポートできません。ブラウザのブックマーク API に
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
# Chrome Web Store listing — Română
|
||||
|
||||
Translated from `listing.en.md`, keeping its structure. Chrome's own ro terms
|
||||
(marcaj, Bara de marcaje, dosar), comma-below ș ț only, „…” quotes, per
|
||||
`docs/07 §4`. The summary is a noun phrase ("Import, export și editare…"):
|
||||
a bare verb would read as the informal *tu* command next to the polite "vă".
|
||||
Under "CE FACE" the bullets speak *about* the extension in the third person
|
||||
("Importă…"); the UI itself uses the polite plural ("Importați").
|
||||
|
||||
⚠️ `TODO(review-ro)` — like the in-app dictionary, this is best-effort until a
|
||||
native pass (`docs/00 §10.13`). Review before relying on it for a listing edit.
|
||||
|
||||
**Name:** `BookmarkMagic` (brand name — never translated)
|
||||
|
||||
**Summary** (121 / 132 characters — 11 to spare, check after any edit):
|
||||
|
||||
```
|
||||
Import, export și editare de marcaje între browsere — offline, fără cont, fără cloud. Datele nu vă părăsesc dispozitivul.
|
||||
```
|
||||
|
||||
**Description:**
|
||||
|
||||
```
|
||||
Mutați marcajele între browsere în cel mai simplu mod: cu un fișier. Fără cont.
|
||||
Fără sincronizare în cloud. 100% offline.
|
||||
|
||||
CE FACE
|
||||
• Importă fișiere de marcaje (HTML, JSON, CSV) — inclusiv fișierul
|
||||
„Bookmarks” din Chrome, aflat în dosarul profilului și copiile de rezervă JSON din
|
||||
Firefox — cu o previzualizare completă înainte de a scrie ceva: numărul de
|
||||
marcaje, dosarele și duplicatele, de la început.
|
||||
• Alegeți cum se face importul: într-un dosar nou cu dată (varianta sigură,
|
||||
implicită), prin îmbinare cu dosarele pe care le aveți deja sau prin
|
||||
înlocuirea completă (arată exact ce se va șterge și salvează mai întâi o
|
||||
copie de rezervă de siguranță).
|
||||
• Poate omite linkurile pe care le aveți deja.
|
||||
• Exportă tot — sau doar dosarele alese — în HTML (funcționează cu Chrome,
|
||||
Edge, Brave, Firefox, Safari, Vivaldi, Opera), JSON, CSV sau Markdown.
|
||||
• Editează arborele de marcaje: căutare, redenumire, mutare și reordonare
|
||||
prin tragere, sortarea unui dosar A→Z, dosare noi, ștergere și găsirea
|
||||
linkurilor duplicate.
|
||||
|
||||
CONFIDENȚIALITATE PRIN DESIGN
|
||||
• Funcționează în întregime pe dispozitivul dumneavoastră. Fără servere, fără
|
||||
statistici, fără urmărire.
|
||||
• Doar două permisiuni: „bookmarks” (rostul extensiei) și „storage” (setările
|
||||
dumneavoastră). Nimic altceva.
|
||||
• Gratuit și open source (GPL-3.0) — puteți citi codul pe GitHub.
|
||||
|
||||
LIMBI
|
||||
English · Tiếng Việt · 日本語 · 简体中文 · Română
|
||||
|
||||
LIMITĂRI (CU SINCERITATE)
|
||||
• Pictogramele site-urilor nu pot fi importate — API-ul pentru marcaje al
|
||||
extensiilor nu are un câmp pentru ele.
|
||||
• Marcajele importate primesc data de azi — Chrome nu permite extensiilor să
|
||||
seteze data originală de creare a unui marcaj. Fișierele exportate păstrează
|
||||
datele reale.
|
||||
• CSV este o vedere aplatizată: dosarele goale și „care dosar este bara de
|
||||
marcaje” nu se păstrează. Pentru o copie de rezervă fidelă, folosiți HTML sau
|
||||
JSON.
|
||||
|
||||
Cod sursă, raportarea problemelor și politica de confidențialitate:
|
||||
https://github.com/poli0981/bookmarkmagic
|
||||
```
|
||||
|
||||
Documentele juridice există doar în limba engleză (`docs/14`); URL-ul politicii
|
||||
de confidențialitate este același ca în versiunea în engleză.
|
||||
+1
-1
@@ -39,7 +39,7 @@ RIÊNG TƯ NGAY TỪ THIẾT KẾ
|
||||
• Miễn phí & mã nguồn mở (GPL-3.0) — bạn có thể đọc mã trên GitHub.
|
||||
|
||||
NGÔN NGỮ
|
||||
English · Tiếng Việt · 日本語
|
||||
English · Tiếng Việt · 日本語 · 简体中文 · Română
|
||||
|
||||
GIỚI HẠN (NÓI THẲNG)
|
||||
• Không thể nhập favicon — API bookmark của trình duyệt không có trường
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# Chrome Web Store listing — 简体中文
|
||||
|
||||
Translated from `listing.en.md`, keeping its structure. Chrome's own zh-CN terms
|
||||
(书签, 书签栏, 文件夹, 导入, 导出), full-width punctuation, and a half-width space
|
||||
between Han characters and Latin text or numbers, per `docs/07 §4`.
|
||||
|
||||
⚠️ `TODO(review-zh)` — like the in-app dictionary, this is best-effort until a
|
||||
native pass (`docs/00 §10.13`). Review before relying on it for a listing edit.
|
||||
|
||||
**Name:** `BookmarkMagic` (brand name — never translated)
|
||||
|
||||
**Summary** (47 / 132 characters — CJK counts by character, so this is short):
|
||||
|
||||
```
|
||||
在浏览器之间导入、导出和编辑书签——离线运行,无需账户,无需云端。您的数据绝不会离开您的设备。
|
||||
```
|
||||
|
||||
**Description:**
|
||||
|
||||
```
|
||||
在浏览器之间转移书签,最简单的方式就是用一个文件。无需账户,没有云同步,
|
||||
100% 离线运行。
|
||||
|
||||
功能
|
||||
• 导入书签文件(HTML、JSON、CSV)——包括您个人资料文件夹中 Chrome 自己的
|
||||
“Bookmarks”文件和 Firefox 的 JSON 备份。写入任何内容之前都会先完整预览:
|
||||
数量、文件夹和重复项一目了然。
|
||||
• 自选导入方式:放入一个带日期的新文件夹(安全的默认选项)、合并到您已有的
|
||||
文件夹,或全部替换(会准确显示将删除的内容,并先保存一份安全备份)。
|
||||
• 可以跳过您已有的链接。
|
||||
• 导出全部书签,或只导出您选择的文件夹,格式可选 HTML(适用于 Chrome、
|
||||
Edge、Brave、Firefox、Safari、Vivaldi、Opera)、JSON、CSV 或 Markdown。
|
||||
• 编辑书签树:搜索、重命名、拖动以移动或重新排序、将文件夹按 A→Z 排序、
|
||||
新建文件夹、删除,以及查找重复的链接。
|
||||
|
||||
隐私至上的设计
|
||||
• 完全在您的设备上运行。没有服务器,没有分析,没有跟踪。
|
||||
• 只有两项权限:“bookmarks”(核心功能)和“storage”(保存您的设置)。
|
||||
仅此而已。
|
||||
• 免费且开源(GPL-3.0)——可在 GitHub 上查看代码。
|
||||
|
||||
语言
|
||||
English · Tiếng Việt · 日本語 · 简体中文 · Română
|
||||
|
||||
局限(坦诚说明)
|
||||
• 无法导入网站图标——扩展程序的书签 API 没有网站图标字段。
|
||||
• 导入的书签日期为今天——Chrome 不允许扩展程序设置书签的原始创建日期。
|
||||
您导出的文件会保留真实日期。
|
||||
• CSV 是扁平化的视图:空文件夹以及“哪个文件夹是书签栏”都不会保留。
|
||||
如需完整备份,请使用 HTML 或 JSON。
|
||||
|
||||
源代码、问题跟踪和隐私政策:
|
||||
https://github.com/poli0981/bookmarkmagic
|
||||
```
|
||||
|
||||
法律文件仅有英文版本(`docs/14`),隐私政策 URL 与英文版相同。
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { Locale } from '@/lib/i18n/resolve-locale';
|
||||
|
||||
/**
|
||||
* Runtime locale id → Chrome's locale code, as `src/public/_locales/` and
|
||||
* `store/listing.*.md` spell it (docs/07 §1). The one place the two spellings
|
||||
* meet: Chrome wants `zh_CN`, BCP 47 says `zh-CN`. A `Record`, so a new locale
|
||||
* without an entry fails to compile.
|
||||
*/
|
||||
export const CHROME_LOCALE_DIRS: Record<Locale, string> = {
|
||||
en: 'en',
|
||||
vi: 'vi',
|
||||
ja: 'ja',
|
||||
'zh-CN': 'zh_CN',
|
||||
ro: 'ro',
|
||||
};
|
||||
@@ -0,0 +1,94 @@
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
/**
|
||||
* ACCESSIBILITY.md is a public promise (docs/06 §5), and nothing in the build
|
||||
* reads it. These pin the parts that rot quietly: the routes a user is sent
|
||||
* down, and the key table, which is the only place the tree's keys are
|
||||
* written for users — nothing in the UI shows them.
|
||||
*/
|
||||
const REPO_ROOT = process.cwd();
|
||||
const read = (path: string): string => readFileSync(join(REPO_ROOT, path), 'utf8');
|
||||
|
||||
describe('the accessibility statement', () => {
|
||||
const statement = read('ACCESSIBILITY.md');
|
||||
|
||||
it('is linked from the README', () => {
|
||||
expect(read('README.md')).toContain('](ACCESSIBILITY.md)');
|
||||
});
|
||||
|
||||
it('sends reports to a form that exists and carries the accessibility label', () => {
|
||||
const form = '.github/ISSUE_TEMPLATE/accessibility.yml';
|
||||
expect(existsSync(join(REPO_ROOT, form))).toBe(true);
|
||||
expect(statement).toContain('issues/new?template=accessibility.yml');
|
||||
expect(read(form)).toMatch(/^labels: \[accessibility\]$/m);
|
||||
});
|
||||
|
||||
it('gives the same address as the issue chooser and the README', () => {
|
||||
const address = 'accessibility@poli0981.dev';
|
||||
expect(statement).toContain(address);
|
||||
expect(read('README.md')).toContain(address);
|
||||
expect(read('.github/ISSUE_TEMPLATE/config.yml')).toContain(`mailto:${address}`);
|
||||
});
|
||||
|
||||
it('documents every key the tree handles (docs/06 §5)', () => {
|
||||
// The left column of the statement's key table. A key added to
|
||||
// `edit/tree-keyboard.ts` or `edit/tree-keys.ts` belongs here and there.
|
||||
const keys = [
|
||||
'| ↑ / ↓ |',
|
||||
'| Home / End |',
|
||||
'| → |',
|
||||
'| ← |',
|
||||
'| A letter or digit |',
|
||||
'| Enter |',
|
||||
'| F2 |',
|
||||
'| Delete (Fn+Delete on a Mac laptop) |',
|
||||
'| Menu key, or Shift+F10 |',
|
||||
'| Alt+↑ / Alt+↓ |',
|
||||
'| Ctrl+C (⌘C on macOS) |',
|
||||
'| Ctrl+F (⌘F on macOS) |',
|
||||
];
|
||||
for (const key of keys) expect(statement, `missing ${key}`).toContain(key);
|
||||
});
|
||||
|
||||
it('has a row for every key the tree’s code handles', () => {
|
||||
// The other direction: a key ADDED to the code without a row here fails.
|
||||
// `resolveKey` switches on these names; `tree-keys.ts` handles the rest.
|
||||
const ROWS: Record<string, string> = {
|
||||
ArrowDown: '| ↑ / ↓ |',
|
||||
ArrowUp: '| ↑ / ↓ |',
|
||||
Home: '| Home / End |',
|
||||
End: '| Home / End |',
|
||||
ArrowRight: '| → |',
|
||||
ArrowLeft: '| ← |',
|
||||
Enter: '| Enter |',
|
||||
F2: '| F2 |',
|
||||
Delete: '| Delete',
|
||||
ContextMenu: '| Menu key, or Shift+F10 |',
|
||||
};
|
||||
const source = read('src/lib/edit/tree-keyboard.ts');
|
||||
const cases = [...source.matchAll(/case '([A-Za-z0-9]+)':/g)].map((match) => match[1] ?? '');
|
||||
expect(cases.length).toBeGreaterThanOrEqual(Object.keys(ROWS).length);
|
||||
for (const key of cases) {
|
||||
const row = ROWS[key];
|
||||
expect(
|
||||
row,
|
||||
`tree-keyboard.ts handles ${key}, which has no row in ACCESSIBILITY.md`,
|
||||
).toBeDefined();
|
||||
expect(statement).toContain(row ?? '');
|
||||
}
|
||||
});
|
||||
|
||||
it('states a goal and says what was not tested, rather than claiming conformance', () => {
|
||||
expect(statement).toContain('That is a goal, not a claim.');
|
||||
expect(statement).toContain('**Not tested**');
|
||||
expect(statement).toContain('## Known limitations');
|
||||
});
|
||||
|
||||
it('is dated, so a stale review shows', () => {
|
||||
expect(statement).toMatch(
|
||||
/\*\*Last reviewed:\*\* \d{4}-\d{2}-\d{2}, for version \d+\.\d+\.\d+\./,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
writeLegal,
|
||||
writeSettings,
|
||||
} from '@/lib/browser/storage';
|
||||
import { LOCALES } from '@/lib/i18n/resolve-locale';
|
||||
|
||||
// fakeBrowser DOES implement storage.local — and, verified before this suite
|
||||
// was written, storage.onChanged too. No hand-rolled mock is needed here
|
||||
@@ -41,6 +42,13 @@ describe('settings', () => {
|
||||
expect(await readSettings()).toEqual(settings);
|
||||
});
|
||||
|
||||
it.each(['auto', ...LOCALES])('keeps a saved locale of %s', async (locale) => {
|
||||
// The allow-list is the gate a new locale must pass: a locale the switcher
|
||||
// offers but coerceSettings rejects resets to Automatic on every reload.
|
||||
await fakeBrowser.storage.local.set({ settings: { locale } });
|
||||
expect((await readSettings()).locale).toBe(locale);
|
||||
});
|
||||
|
||||
it('falls back per field when a stored value is not a legal option', async () => {
|
||||
// A corrupt blob must not brick the Manager — each bad field degrades alone.
|
||||
await fakeBrowser.storage.local.set({
|
||||
|
||||
@@ -264,7 +264,7 @@ describe('writeTree — API failure', () => {
|
||||
it('lets a cancellation stay a cancellation', async () => {
|
||||
// The abort check throws from inside the same loop as the create. Wrapping
|
||||
// it would relabel every user cancellation as a failure and make the
|
||||
// `cancelled` state — and its copy in three languages — unreachable.
|
||||
// `cancelled` state — and its copy in every language — unreachable.
|
||||
const fake = new FakeBookmarks();
|
||||
const controller = new AbortController();
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
import { focusIfLost, focusLost, focusWhenShown } from '@/lib/components/focus-heading';
|
||||
import {
|
||||
focusIfLost,
|
||||
focusLost,
|
||||
focusOwningTree,
|
||||
focusWhenShown,
|
||||
} from '@/lib/components/focus-heading';
|
||||
|
||||
/** Focus repair for multi-step screens and deletes — docs/06 §5. */
|
||||
afterEach(() => {
|
||||
@@ -57,3 +62,34 @@ describe('focusWhenShown', () => {
|
||||
expect(document.activeElement).toBe(heading);
|
||||
});
|
||||
});
|
||||
|
||||
describe('focusOwningTree', () => {
|
||||
function tree(): { tree: HTMLElement; rowButton: HTMLButtonElement } {
|
||||
const list = document.body.appendChild(document.createElement('ul'));
|
||||
list.setAttribute('role', 'tree');
|
||||
list.tabIndex = 0;
|
||||
const item = list.appendChild(document.createElement('li'));
|
||||
const rowButton = button(item);
|
||||
rowButton.tabIndex = -1;
|
||||
return { tree: list, rowButton };
|
||||
}
|
||||
|
||||
it('moves focus from a clicked row control to the tree it sits in', () => {
|
||||
// Chrome focuses a tabindex="-1" button on click, and the tree ignores keys
|
||||
// aimed at a row's own control — the arrow keys went dead (docs/06 §5).
|
||||
const { tree: list, rowButton } = tree();
|
||||
rowButton.focus();
|
||||
expect(document.activeElement).toBe(rowButton);
|
||||
focusOwningTree(rowButton);
|
||||
expect(document.activeElement).toBe(list);
|
||||
});
|
||||
|
||||
it('does nothing for a control outside a tree, or for no target at all', () => {
|
||||
const outside = button();
|
||||
outside.focus();
|
||||
focusOwningTree(outside);
|
||||
expect(document.activeElement).toBe(outside);
|
||||
expect(() => focusOwningTree(null)).not.toThrow();
|
||||
expect(document.activeElement).toBe(outside);
|
||||
});
|
||||
});
|
||||
@@ -32,6 +32,17 @@ describe('sortedOrder', () => {
|
||||
expect(order.map((n) => n.title)).toEqual(['alpha', 'Zeta', 'éclair', 'Item 2', 'item 10']);
|
||||
});
|
||||
|
||||
it('collates with the UI locale: pinyin for zh-CN (docs/07 §3)', () => {
|
||||
// 北京 (běi), 广州 (guǎng), 上海 (shàng) — by code point 上 would come first.
|
||||
const order = sortedOrder([b('1', '上海'), b('2', '北京'), b('3', '广州')], 'zh-CN');
|
||||
expect(order.map((n) => n.title)).toEqual(['北京', '广州', '上海']);
|
||||
});
|
||||
|
||||
it('collates with the UI locale: ș is its own letter after s in ro', () => {
|
||||
const order = sortedOrder([b('1', 'ștergere'), b('2', 'tabel'), b('3', 'sus')], 'ro');
|
||||
expect(order.map((n) => n.title)).toEqual(['sus', 'ștergere', 'tabel']);
|
||||
});
|
||||
|
||||
it('keeps ties in their current order, and sorts untitled bookmarks by address', () => {
|
||||
const order = sortedOrder(
|
||||
[b('1', 'Same'), b('2', '', 'https://a.example/'), b('3', 'same')],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import type { EditNode } from '@/lib/edit/patch-tree';
|
||||
import { resolveKey, visibleRows } from '@/lib/edit/tree-keyboard';
|
||||
import { nudgeTarget, resolveKey, visibleRows } from '@/lib/edit/tree-keyboard';
|
||||
|
||||
const TREE: EditNode[] = [
|
||||
{
|
||||
@@ -137,3 +137,61 @@ describe('resolveKey — type-ahead', () => {
|
||||
expect(resolveKey('z', 'bar', rows)).toEqual({ kind: 'none' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('nudgeTarget — the sibling Alt+↑/↓ moves a row past (docs/05 §10)', () => {
|
||||
const FOLDER: EditNode[] = [
|
||||
{
|
||||
id: 'bar',
|
||||
title: 'Bookmarks bar',
|
||||
children: [
|
||||
{ id: 'a', parentId: 'bar', title: 'A', url: 'https://a.example/' },
|
||||
{
|
||||
id: 'dev',
|
||||
parentId: 'bar',
|
||||
title: 'Dev',
|
||||
children: [{ id: 'gh', parentId: 'dev', title: 'GitHub', url: 'https://github.com/' }],
|
||||
},
|
||||
{ id: 'z', parentId: 'bar', title: 'Z', url: 'https://z.example/' },
|
||||
],
|
||||
},
|
||||
{ id: 'other', title: 'Other', children: [] },
|
||||
];
|
||||
|
||||
it('is the row’s neighbour in its own folder', () => {
|
||||
const rows = visibleRows(FOLDER, new Set(['bar']));
|
||||
expect(nudgeTarget(rows, 'dev', -1)).toBe('a');
|
||||
expect(nudgeTarget(rows, 'dev', 1)).toBe('z');
|
||||
});
|
||||
|
||||
it('is nothing at either end of the folder', () => {
|
||||
const rows = visibleRows(FOLDER, new Set(['bar']));
|
||||
expect(nudgeTarget(rows, 'a', -1)).toBeUndefined();
|
||||
expect(nudgeTarget(rows, 'z', 1)).toBeUndefined();
|
||||
// An only child has no one to trade places with.
|
||||
expect(nudgeTarget(visibleRows(FOLDER, new Set(['bar', 'dev'])), 'gh', 1)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('steps over an open neighbour’s children, which are not its siblings', () => {
|
||||
// Visually GitHub sits between Dev and Z; Z's neighbour above is still Dev.
|
||||
const rows = visibleRows(FOLDER, new Set(['bar', 'dev']));
|
||||
expect(nudgeTarget(rows, 'z', -1)).toBe('dev');
|
||||
expect(nudgeTarget(rows, 'a', 1)).toBe('dev');
|
||||
});
|
||||
|
||||
it('counts only the siblings a search still shows', () => {
|
||||
const rows = visibleRows(FOLDER, new Set(['bar']), new Set(['bar', 'a', 'z']));
|
||||
expect(nudgeTarget(rows, 'a', 1)).toBe('z');
|
||||
expect(nudgeTarget(rows, 'z', -1)).toBe('a');
|
||||
});
|
||||
|
||||
it('names a root’s neighbour too — refusing to move a root is planDrop’s job', () => {
|
||||
const rows = visibleRows(FOLDER, new Set());
|
||||
expect(nudgeTarget(rows, 'bar', 1)).toBe('other');
|
||||
});
|
||||
|
||||
it('is nothing for a row that is not on screen, or no row at all', () => {
|
||||
const rows = visibleRows(FOLDER, new Set(['bar']));
|
||||
expect(nudgeTarget(rows, 'gh', 1)).toBeUndefined();
|
||||
expect(nudgeTarget(rows, undefined, 1)).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -12,7 +12,11 @@ import { FakeBookmarks } from '../../helpers/fake-bookmarks';
|
||||
let fake: FakeBookmarks;
|
||||
let session: EditSession;
|
||||
let tree: HTMLUListElement;
|
||||
let effects: { open: Mock<(id: string) => void>; copy: Mock<(id: string) => void> };
|
||||
let effects: {
|
||||
open: Mock<(id: string) => void>;
|
||||
copy: Mock<(id: string) => void>;
|
||||
nudge: Mock<(id: string, direction: -1 | 1) => void>;
|
||||
};
|
||||
let ids: { dev: string; gh: string; docs: string };
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -36,12 +40,17 @@ beforeEach(async () => {
|
||||
() => 'en',
|
||||
);
|
||||
await session.load();
|
||||
effects = { open: vi.fn<(id: string) => void>(), copy: vi.fn<(id: string) => void>() };
|
||||
effects = {
|
||||
open: vi.fn<(id: string) => void>(),
|
||||
copy: vi.fn<(id: string) => void>(),
|
||||
nudge: vi.fn<(id: string, direction: -1 | 1) => void>(),
|
||||
};
|
||||
tree = document.createElement('ul');
|
||||
tree.addEventListener('keydown', (event) =>
|
||||
onTreeKey(event, session, {
|
||||
open: (node: EditNode) => effects.open(node.id),
|
||||
copy: (node: EditNode) => effects.copy(node.id),
|
||||
nudge: effects.nudge,
|
||||
}),
|
||||
);
|
||||
});
|
||||
@@ -101,10 +110,38 @@ describe('onTreeKey', () => {
|
||||
session.renamingId = undefined;
|
||||
const button = tree.appendChild(document.createElement('button'));
|
||||
expect(press('ArrowDown', {}, button).defaultPrevented).toBe(false);
|
||||
expect(press('ArrowDown', { altKey: true }).defaultPrevented).toBe(false);
|
||||
// Alt+← is the browser's Back; Ctrl+↓ is nothing of ours.
|
||||
expect(press('ArrowLeft', { altKey: true }).defaultPrevented).toBe(false);
|
||||
expect(press('ArrowDown', { ctrlKey: true }).defaultPrevented).toBe(false);
|
||||
expect(session.focusedId).toBe(ids.docs);
|
||||
});
|
||||
|
||||
it('asks to move the focused row with Alt+↑ and Alt+↓, and with Alt alone', () => {
|
||||
session.focusedId = ids.docs;
|
||||
expect(press('ArrowDown', { altKey: true }).defaultPrevented).toBe(true);
|
||||
expect(press('ArrowUp', { altKey: true }).defaultPrevented).toBe(true);
|
||||
expect(effects.nudge.mock.calls).toEqual([
|
||||
[ids.docs, 1],
|
||||
[ids.docs, -1],
|
||||
]);
|
||||
// The focus does not move: the row does.
|
||||
expect(session.focusedId).toBe(ids.docs);
|
||||
|
||||
// Alt+Shift+↓, Ctrl+Alt+↓ and ⌘+Alt+↓ belong to the browser or the OS.
|
||||
press('ArrowDown', { altKey: true, shiftKey: true });
|
||||
press('ArrowDown', { altKey: true, ctrlKey: true });
|
||||
press('ArrowDown', { altKey: true, metaKey: true });
|
||||
expect(effects.nudge).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it('does not ask to move anything with no row focused, or while renaming', () => {
|
||||
press('ArrowDown', { altKey: true });
|
||||
session.focusedId = ids.docs;
|
||||
session.renamingId = ids.docs;
|
||||
press('ArrowDown', { altKey: true });
|
||||
expect(effects.nudge).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('starts no write while a bulk command runs', () => {
|
||||
session.focusedId = ids.docs;
|
||||
session.busy = true;
|
||||
|
||||
@@ -1,25 +1,37 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { BM_BACKUP_ERROR_CODES, BM_ENV_ERROR_CODES } from '@/lib/browser/errors';
|
||||
import { BM_PARSE_ERROR_CODES, PARSE_WARNING_CODES } from '@/lib/core/model';
|
||||
import en from '@/lib/i18n/locales/en';
|
||||
import { type LocaleTag, localeTag, PLURAL_FORMS, requiredPluralForms } from '@/lib/i18n/format';
|
||||
import en, { type Dict } from '@/lib/i18n/locales/en';
|
||||
import ja from '@/lib/i18n/locales/ja';
|
||||
import ro from '@/lib/i18n/locales/ro';
|
||||
import vi from '@/lib/i18n/locales/vi';
|
||||
import zhCN from '@/lib/i18n/locales/zh-CN';
|
||||
import { LOCALES, type Locale } from '@/lib/i18n/resolve-locale';
|
||||
|
||||
/**
|
||||
* Runtime companions to the `satisfies Dict` compile check (docs/07 §2).
|
||||
* Runtime companions to the `satisfies Dict` compile check (docs/07 §2, §5).
|
||||
*
|
||||
* The compile check proves the *shape* matches. It is blind to what these
|
||||
* assert: interpolation tokens drifting between locales, empty leaves, and the
|
||||
* check itself being silently disabled by someone changing `satisfies` to `as`.
|
||||
* assert: interpolation tokens drifting between locales, empty leaves, which
|
||||
* plural forms a locale's grammar needs, and the check itself being silently
|
||||
* disabled by someone changing `satisfies` to `as`.
|
||||
*/
|
||||
|
||||
type Node = { [key: string]: Node | string };
|
||||
|
||||
const LOCALES: [name: string, dict: Node][] = [
|
||||
['vi', vi as Node],
|
||||
['ja', ja as Node],
|
||||
/** Every non-English locale, with the tag its plural rules come from. */
|
||||
const LOCALE_DICTS: [name: Locale, dict: Node][] = [
|
||||
['vi', vi],
|
||||
['ja', ja],
|
||||
['zh-CN', zhCN],
|
||||
['ro', ro],
|
||||
];
|
||||
|
||||
const ALL: [name: Locale, dict: Node][] = [['en', en], ...LOCALE_DICTS];
|
||||
|
||||
/** Every leaf as a dotted path → value. */
|
||||
function flatten(node: Node, prefix = ''): Map<string, string> {
|
||||
const out = new Map<string, string>();
|
||||
@@ -48,64 +60,192 @@ function branches(node: Node, prefix = ''): Map<string, string[]> {
|
||||
return out;
|
||||
}
|
||||
|
||||
const english = flatten(en as Node);
|
||||
const FORM_KEYS = new Set<string>(PLURAL_FORMS);
|
||||
const english = flatten(en);
|
||||
/** English's plural keys: every branch holding `one` and `other`. */
|
||||
const PLURAL_PATHS = new Set(
|
||||
[...branches(en)]
|
||||
.filter(([, keys]) => keys.includes('one') && keys.includes('other'))
|
||||
.map(([path]) => path),
|
||||
);
|
||||
|
||||
/** `a.b.few` → `a.b` when `a.b` is a plural key, else undefined. */
|
||||
function pluralParent(path: string): string | undefined {
|
||||
const cut = path.lastIndexOf('.');
|
||||
const parent = path.slice(0, cut);
|
||||
return cut > 0 && PLURAL_PATHS.has(parent) ? parent : undefined;
|
||||
}
|
||||
|
||||
/** A `few` leaf has no English twin; it is compared against English `other`. */
|
||||
function englishTwin(path: string): string | undefined {
|
||||
const parent = pluralParent(path);
|
||||
if (parent !== undefined && path.endsWith('.few')) return english.get(`${parent}.other`);
|
||||
return english.get(path);
|
||||
}
|
||||
|
||||
const tagOf = (name: Locale): LocaleTag => localeTag(name);
|
||||
|
||||
describe('the locale list', () => {
|
||||
it('this suite checks every shipped locale', () => {
|
||||
// A locale added to LOCALES but not to LOCALE_DICTS would skip every check
|
||||
// below and still type-check (docs/07 §6).
|
||||
expect(ALL.map(([name]) => name).sort()).toEqual([...LOCALES].sort());
|
||||
});
|
||||
|
||||
it('every shipped locale needs only plural forms the helper can select', () => {
|
||||
// docs/07 §5. selectPluralForm folds zero/two/many into `other`; a locale
|
||||
// that actually uses one of them (ar, pl, ru…) must fail here, before its
|
||||
// dictionary is written against a grammar the app cannot render.
|
||||
for (const name of LOCALES) {
|
||||
const categories = new Intl.PluralRules(tagOf(name)).resolvedOptions().pluralCategories;
|
||||
expect(
|
||||
categories.filter((category) => !FORM_KEYS.has(category)),
|
||||
name,
|
||||
).toEqual([]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('dictionary completeness', () => {
|
||||
it.each(LOCALES)('%s has exactly the same key paths as en', (_name, dict) => {
|
||||
expect([...flatten(dict).keys()].sort()).toEqual([...english.keys()].sort());
|
||||
it.each(LOCALE_DICTS)('%s has exactly the same key paths as en', (_name, dict) => {
|
||||
// `few` is the one leaf English has no twin for; the plural-shape test
|
||||
// below decides where it belongs.
|
||||
const paths = [...flatten(dict).keys()].filter(
|
||||
(path) => !(path.endsWith('.few') && pluralParent(path) !== undefined),
|
||||
);
|
||||
expect(paths.sort()).toEqual([...english.keys()].sort());
|
||||
});
|
||||
|
||||
it.each(LOCALES)('%s uses the same interpolation tokens as en in every string', (_name, dict) => {
|
||||
// `satisfies Dict` cannot see this: a translation that drops {total} from
|
||||
// 'Importing… {done} / {total}' type-checks and renders a broken sentence.
|
||||
const drift: string[] = [];
|
||||
for (const [path, text] of flatten(dict)) {
|
||||
const expected = tokens(english.get(path) ?? '');
|
||||
const actual = tokens(text);
|
||||
if (actual.join('|') !== expected.join('|')) {
|
||||
drift.push(`${path}: expected {${expected.join('}, {')}}, got {${actual.join('}, {')}}`);
|
||||
it.each(LOCALE_DICTS)(
|
||||
'%s uses the same interpolation tokens as en in every string',
|
||||
(_name, dict) => {
|
||||
// `satisfies Dict` cannot see this: a translation that drops {total} from
|
||||
// 'Importing… {done} / {total}' type-checks and renders a broken sentence.
|
||||
const drift: string[] = [];
|
||||
for (const [path, text] of flatten(dict)) {
|
||||
const expected = tokens(englishTwin(path) ?? '');
|
||||
const actual = tokens(text);
|
||||
if (actual.join('|') !== expected.join('|')) {
|
||||
drift.push(`${path}: expected {${expected.join('}, {')}}, got {${actual.join('}, {')}}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
expect(drift).toEqual([]);
|
||||
});
|
||||
expect(drift).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([['en', en as Node], ...LOCALES])('%s has no empty leaves', (_name, dict) => {
|
||||
it.each(ALL)('%s has no empty leaves', (_name, dict) => {
|
||||
const empty = [...flatten(dict)].filter(([, text]) => text.trim() === '').map(([path]) => path);
|
||||
expect(empty).toEqual([]);
|
||||
});
|
||||
|
||||
it('carries every plural key as { one, other } in all three locales', () => {
|
||||
// docs/07 §5. VI/JA have one grammatical form and repeat the same string,
|
||||
// but they must still carry both keys or the `satisfies Dict` shape check
|
||||
// §2 relies on for completeness stops proving anything.
|
||||
const pluralPaths = [...branches(en as Node)]
|
||||
.filter(([, keys]) => keys.includes('one') && keys.includes('other'))
|
||||
.map(([path]) => path);
|
||||
|
||||
expect(pluralPaths.length).toBeGreaterThan(0);
|
||||
for (const [name, dict] of LOCALES) {
|
||||
const leaves = flatten(dict);
|
||||
for (const path of pluralPaths) {
|
||||
expect(leaves.get(`${path}.one`), `${name}: ${path}.one`).toBeTypeOf('string');
|
||||
expect(leaves.get(`${path}.other`), `${name}: ${path}.other`).toBeTypeOf('string');
|
||||
}
|
||||
}
|
||||
it('finds the plural keys at all', () => {
|
||||
expect(PLURAL_PATHS.size).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('gives every plural key exactly the two forms, and no stray siblings', () => {
|
||||
const malformed = [...branches(en as Node)]
|
||||
.filter(([, keys]) => keys.includes('one') || keys.includes('other'))
|
||||
.filter(([, keys]) => keys.length !== 2)
|
||||
it.each(ALL)('%s carries exactly the plural forms its grammar needs', (name, dict) => {
|
||||
// docs/07 §5: `{ one, other }` everywhere, plus `few` where the locale's
|
||||
// own Intl.PluralRules uses it (Romanian). One-form locales repeat the
|
||||
// same string in both, but must still carry both or the `satisfies Dict`
|
||||
// shape check stops proving anything.
|
||||
const required = requiredPluralForms(tagOf(name)).sort();
|
||||
const shapes = branches(dict);
|
||||
const wrong = [...PLURAL_PATHS]
|
||||
.map((path) => [path, [...(shapes.get(path) ?? [])].sort()] as const)
|
||||
.filter(([, keys]) => keys.join('|') !== required.join('|'))
|
||||
.map(([path, keys]) => `${path}: {${keys.join(', ')}}`);
|
||||
expect(wrong).toEqual([]);
|
||||
});
|
||||
|
||||
it.each(ALL)('%s names no non-plural key one, few or other', (_name, dict) => {
|
||||
// Any branch holding one of those keys is read as a plural — so a branch
|
||||
// that is not one of English's plural keys is malformed (docs/07 §5).
|
||||
const stray = [...branches(dict)]
|
||||
.filter(([, keys]) => keys.some((key) => FORM_KEYS.has(key)))
|
||||
.filter(([path]) => !PLURAL_PATHS.has(path))
|
||||
.map(([path]) => path);
|
||||
expect(stray).toEqual([]);
|
||||
});
|
||||
|
||||
it('gives English exactly the two forms on every plural key', () => {
|
||||
const malformed = [...branches(en)]
|
||||
.filter(([path]) => PLURAL_PATHS.has(path))
|
||||
.filter(([, keys]) => [...keys].sort().join('|') !== 'one|other')
|
||||
.map(([path]) => path);
|
||||
expect(malformed).toEqual([]);
|
||||
});
|
||||
|
||||
it.each(LOCALE_DICTS)('%s writes the language names as endonyms, like en', (_name, dict) => {
|
||||
// docs/07 §5: identical in every dictionary, so a user can find their own
|
||||
// language whatever the UI is currently in.
|
||||
const names = [...flatten(dict)].filter(([path]) => path.startsWith('settings.lang.'));
|
||||
const englishNames = [...english].filter(([path]) => path.startsWith('settings.lang.'));
|
||||
expect(names.sort()).toEqual(englishNames.sort());
|
||||
});
|
||||
|
||||
it('names every shipped locale in the language list', () => {
|
||||
expect(Object.keys(en.settings.lang).sort()).toEqual([...LOCALES].sort());
|
||||
});
|
||||
});
|
||||
|
||||
describe('Romanian orthography', () => {
|
||||
// docs/07 §4: comma-below ș ț (U+0218–U+021B) are the letters; the cedilla
|
||||
// forms ş ţ (U+015E/F, U+0162/3) only look alike, and break search and sort.
|
||||
// Files, not the dictionary object, so comments and the manifest count too.
|
||||
const FILES = [
|
||||
'src/lib/i18n/locales/ro.ts',
|
||||
'src/lib/i18n/locales/ro-notices.ts',
|
||||
'src/lib/i18n/locales/ro-import.ts',
|
||||
'src/public/_locales/ro/messages.json',
|
||||
'store/listing.ro.md',
|
||||
];
|
||||
|
||||
/** ş Ş ţ Ţ — by code point, so no formatter can turn them into look-alikes. */
|
||||
const CEDILLA = new Set([0x015e, 0x015f, 0x0162, 0x0163]);
|
||||
const isCommaBelow = (point: number): boolean => point >= 0x0218 && point <= 0x021b;
|
||||
|
||||
it.each(FILES)('%s uses comma-below ș ț, never the cedilla forms', (file) => {
|
||||
const points = [...readFileSync(join(process.cwd(), file), 'utf8')].map(
|
||||
(char) => char.codePointAt(0) ?? 0,
|
||||
);
|
||||
expect(points.filter((point) => CEDILLA.has(point)).map((p) => p.toString(16))).toEqual([]);
|
||||
// Non-vacuous: the file really is Romanian text with these letters in it.
|
||||
expect(points.some(isCommaBelow)).toBe(true);
|
||||
});
|
||||
|
||||
it('carries the "de" form only where Romanian grammar puts it', () => {
|
||||
// `other` (20+) takes "de"; `one` and `few` never do. A swapped pair reads
|
||||
// "5 de marcaje" / "20 marcaje" — both wrong, and both type-check.
|
||||
const leaves = flatten(ro);
|
||||
const wrong: string[] = [];
|
||||
for (const path of PLURAL_PATHS) {
|
||||
for (const form of ['one', 'few'] as const) {
|
||||
if (/\{n\} de /u.test(leaves.get(`${path}.${form}`) ?? '')) wrong.push(`${path}.${form}`);
|
||||
}
|
||||
const other = leaves.get(`${path}.other`) ?? '';
|
||||
if (/\{n\} (?!de )\p{L}/u.test(other) && !/\{n\} de /u.test(other))
|
||||
wrong.push(`${path}.other`);
|
||||
}
|
||||
expect(wrong).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the Dict type', () => {
|
||||
it('accepts a third plural form and nothing else', () => {
|
||||
// Type-level: these lines are the test; tsc runs over this file.
|
||||
const romanianStyle = { one: 'a', few: 'b', other: 'c' } satisfies Dict['popup']['bookmarks'];
|
||||
// @ts-expect-error — `other` is required in every locale.
|
||||
const missingOther = { one: 'a' } satisfies Dict['popup']['bookmarks'];
|
||||
// @ts-expect-error — `many` is not a form any shipped locale carries.
|
||||
const strayForm = { one: 'a', other: 'b', many: 'c' } satisfies Dict['popup']['bookmarks'];
|
||||
// @ts-expect-error — a plain string leaf takes no plural forms.
|
||||
const notPlural = { one: 'a', other: 'b' } satisfies Dict['common']['import'];
|
||||
expect([romanianStyle, missingOther, strayForm, notPlural]).toHaveLength(4);
|
||||
});
|
||||
});
|
||||
|
||||
describe('every code the core can emit has a message', () => {
|
||||
// A code with no key renders as its own dotted path ("warnings.INVALID_URL")
|
||||
// in the preview. The union types cannot catch that; this can.
|
||||
const ALL: [name: string, dict: Node][] = [['en', en as Node], ...LOCALES];
|
||||
|
||||
it.each(ALL)('%s has a plural message for every ParseWarningCode', (_name, dict) => {
|
||||
const leaves = flatten(dict);
|
||||
for (const code of PARSE_WARNING_CODES) {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
import { formatCount, formatDateTime, localeTag, selectPluralForm } from '@/lib/i18n/format';
|
||||
import {
|
||||
formatCount,
|
||||
formatDateTime,
|
||||
localeTag,
|
||||
requiredPluralForms,
|
||||
selectPluralForm,
|
||||
} from '@/lib/i18n/format';
|
||||
import { dateTime, getLocale, num, setLocale, tPlural } from '@/lib/i18n/index.svelte';
|
||||
import { LOCALES } from '@/lib/i18n/resolve-locale';
|
||||
|
||||
afterEach(() => {
|
||||
setLocale('en');
|
||||
@@ -11,6 +18,8 @@ describe('localeTag', () => {
|
||||
expect(localeTag('en')).toBe('en-US');
|
||||
expect(localeTag('vi')).toBe('vi-VN');
|
||||
expect(localeTag('ja')).toBe('ja-JP');
|
||||
expect(localeTag('zh-CN')).toBe('zh-CN');
|
||||
expect(localeTag('ro')).toBe('ro-RO');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,13 +28,16 @@ describe('formatCount', () => {
|
||||
expect(formatCount(1_234_567, 'en-US')).toBe('1,234,567');
|
||||
});
|
||||
|
||||
it('groups thousands for vi/ja with a locale-appropriate separator', () => {
|
||||
it('groups thousands for vi/ja/zh/ro with a locale-appropriate separator', () => {
|
||||
// Asserted structurally rather than glyph-for-glyph: ICU separator data can
|
||||
// shift between Node releases, and a brittle assertion here would block an
|
||||
// unrelated Node bump for no real gain.
|
||||
expect(formatCount(1_234_567, 'vi-VN')).toMatch(/^1\D234\D567$/u);
|
||||
expect(formatCount(1_234_567, 'ja-JP')).toMatch(/^1\D234\D567$/u);
|
||||
expect(formatCount(1_234_567, 'zh-CN')).toMatch(/^1\D234\D567$/u);
|
||||
expect(formatCount(1_234_567, 'ro-RO')).toMatch(/^1\D234\D567$/u);
|
||||
expect(formatCount(1_234_567, 'vi-VN')).not.toBe(formatCount(1_234_567, 'en-US'));
|
||||
expect(formatCount(1_234_567, 'ro-RO')).not.toBe(formatCount(1_234_567, 'en-US'));
|
||||
});
|
||||
|
||||
it('keeps the cache keyed by tag — interleaved calls do not bleed', () => {
|
||||
@@ -70,10 +82,46 @@ describe('selectPluralForm', () => {
|
||||
expect(selectPluralForm(2, 'en-US')).toBe('other');
|
||||
});
|
||||
|
||||
it('always returns other for vi and ja, which have one grammatical form', () => {
|
||||
it('always returns other for vi, ja and zh, which have one grammatical form', () => {
|
||||
for (const count of [0, 1, 2, 100]) {
|
||||
expect(selectPluralForm(count, 'vi-VN')).toBe('other');
|
||||
expect(selectPluralForm(count, 'ja-JP')).toBe('other');
|
||||
expect(selectPluralForm(count, 'zh-CN')).toBe('other');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('Romanian plurals (docs/07 §5)', () => {
|
||||
it('selects one for 1, few for 0, 2–19 and …01–…19, other for the rest', () => {
|
||||
expect(selectPluralForm(1, 'ro-RO')).toBe('one');
|
||||
for (const count of [0, 2, 5, 19, 101, 119, 1001]) {
|
||||
expect(selectPluralForm(count, 'ro-RO'), String(count)).toBe('few');
|
||||
}
|
||||
for (const count of [20, 21, 99, 100, 120, 1000]) {
|
||||
expect(selectPluralForm(count, 'ro-RO'), String(count)).toBe('other');
|
||||
}
|
||||
});
|
||||
|
||||
it('asks Romanian dictionaries for all three forms', () => {
|
||||
expect(requiredPluralForms('ro-RO')).toEqual(['one', 'few', 'other']);
|
||||
});
|
||||
|
||||
it('renders the three forms through tPlural', () => {
|
||||
setLocale('ro');
|
||||
expect(tPlural('import.countBookmarks', 1)).toBe('1 marcaj');
|
||||
expect(tPlural('import.countBookmarks', 5)).toBe('5 marcaje');
|
||||
expect(tPlural('import.countBookmarks', 20)).toBe('20 de marcaje');
|
||||
// Structural, like the grouping test above: ICU data may shift between Node
|
||||
// releases. What matters is the grouped count followed by the `other` form.
|
||||
expect(tPlural('import.countBookmarks', 1234)).toMatch(/^1\D234 de marcaje$/u);
|
||||
});
|
||||
});
|
||||
|
||||
describe('requiredPluralForms', () => {
|
||||
it('asks every locale for one and other, and nothing more where few is unused', () => {
|
||||
// docs/07 §5: one-form locales still carry both keys.
|
||||
for (const locale of LOCALES.filter((name) => name !== 'ro')) {
|
||||
expect(requiredPluralForms(localeTag(locale)), locale).toEqual(['one', 'other']);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -89,8 +137,8 @@ describe('tPlural', () => {
|
||||
expect(tPlural('warnings.INVALID_DATE', 1234)).toBe('1,234 unreadable dates were left blank.');
|
||||
});
|
||||
|
||||
it('resolves in vi and ja without falling back to English', () => {
|
||||
for (const locale of ['vi', 'ja'] as const) {
|
||||
it('resolves in every non-English locale without falling back to English', () => {
|
||||
for (const locale of LOCALES.filter((name) => name !== 'en')) {
|
||||
setLocale(locale);
|
||||
const text = tPlural('warnings.INVALID_DATE', 3);
|
||||
expect(text).not.toBe('warnings.INVALID_DATE');
|
||||
|
||||
@@ -13,6 +13,38 @@ describe('resolveLocale', () => {
|
||||
expect(resolveLocale('ja-JP')).toBe('ja');
|
||||
});
|
||||
|
||||
it('accepts the underscore spelling Chrome uses for _locales directories', () => {
|
||||
expect(resolveLocale('vi_VN')).toBe('vi');
|
||||
expect(resolveLocale('zh_CN')).toBe('zh-CN');
|
||||
});
|
||||
|
||||
it('maps Simplified Chinese tags to zh-CN', () => {
|
||||
for (const tag of ['zh', 'zh-CN', 'zh-cn', 'zh-SG', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK']) {
|
||||
expect(resolveLocale(tag), tag).toBe('zh-CN');
|
||||
}
|
||||
});
|
||||
|
||||
it('maps Romanian tags to ro', () => {
|
||||
for (const tag of ['ro', 'ro-RO', 'ro-MD', 'RO_ro']) {
|
||||
expect(resolveLocale(tag), tag).toBe('ro');
|
||||
}
|
||||
});
|
||||
|
||||
it('gives Traditional Chinese English, as Chrome’s manifest fallback does (docs/07 §1)', () => {
|
||||
for (const tag of ['zh-TW', 'zh-HK', 'zh-MO', 'zh-Hant', 'zh-Hant-TW', 'zh_TW']) {
|
||||
expect(resolveLocale(tag), tag).toBe('en');
|
||||
}
|
||||
});
|
||||
|
||||
it('lets an explicit script win over the region, and ignores extension subtags', () => {
|
||||
expect(resolveLocale('zh-Hans-TW')).toBe('zh-CN');
|
||||
expect(resolveLocale('zh-Hant-CN')).toBe('en');
|
||||
expect(resolveLocale('zh-MY')).toBe('zh-CN');
|
||||
expect(resolveLocale('zh-u-nu-hant')).toBe('zh-CN');
|
||||
expect(resolveLocale('zh-CN-x-hant')).toBe('zh-CN');
|
||||
expect(resolveLocale('zh-TW-u-ca-roc')).toBe('en');
|
||||
});
|
||||
|
||||
it('falls back to en for anything else', () => {
|
||||
expect(resolveLocale('en-US')).toBe('en');
|
||||
expect(resolveLocale('de')).toBe('en');
|
||||
@@ -23,5 +55,7 @@ describe('resolveLocale', () => {
|
||||
// 'vic' / 'jav' (Javanese) start with vi/ja but are not our locales.
|
||||
expect(resolveLocale('jav')).toBe('en');
|
||||
expect(resolveLocale('vic')).toBe('en');
|
||||
expect(resolveLocale('zha')).toBe('en');
|
||||
expect(resolveLocale('rom')).toBe('en');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import en from '@/lib/i18n/locales/en';
|
||||
import { LOCALES } from '@/lib/i18n/resolve-locale';
|
||||
import { CHROME_LOCALE_DIRS } from '../../helpers/locales';
|
||||
|
||||
/**
|
||||
* The places outside `src/` that must name every shipped locale — docs/07 §6.
|
||||
*
|
||||
* Each is a plain file that cannot import `LOCALES` (an `.mjs` script, a YAML
|
||||
* form, Markdown), so forgetting one compiles fine and fails quietly: a
|
||||
* language the screenshot sweep never photographs, a build that ships without
|
||||
* its `_locales` entry checked, a translation form with no way to choose the
|
||||
* language, a store listing nobody wrote. Read as text, like manifest.test.ts.
|
||||
*/
|
||||
|
||||
const ROOT = process.cwd();
|
||||
const read = (path: string): string => readFileSync(join(ROOT, path), 'utf8');
|
||||
|
||||
describe('every shipped locale is wired up outside src/', () => {
|
||||
it('is photographed by the screenshot harness', () => {
|
||||
const langs = /const LANGS = \[([^\]]*)\]/u.exec(read('scripts/screenshots.mjs'))?.[1] ?? '';
|
||||
const listed = [...langs.matchAll(/'([^']+)'/gu)].map((match) => match[1]);
|
||||
expect(listed).toEqual([...LOCALES]);
|
||||
});
|
||||
|
||||
it.each(LOCALES)('%s has its _locales file required by check-manifest', (locale) => {
|
||||
const dir = CHROME_LOCALE_DIRS[locale];
|
||||
expect(read('scripts/check-manifest.mjs')).toContain(`'_locales/${dir}/messages.json'`);
|
||||
});
|
||||
|
||||
it.each(LOCALES.filter((locale) => locale !== 'en'))(
|
||||
'%s can be chosen in the translation issue form',
|
||||
(locale) => {
|
||||
expect(read('.github/ISSUE_TEMPLATE/translation.yml')).toContain(`(${locale})`);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(LOCALES)('%s has a store listing, indexed in store/README.md', (locale) => {
|
||||
const file = `listing.${CHROME_LOCALE_DIRS[locale]}.md`;
|
||||
expect(existsSync(join(ROOT, 'store', file)), file).toBe(true);
|
||||
expect(read('store/README.md')).toContain(`\`${file}\``);
|
||||
});
|
||||
|
||||
it('lists the same languages in every store description and the README', () => {
|
||||
// The LANGUAGES paragraph is typed into each description by hand, so a
|
||||
// new locale means re-pasting all of them (docs/13 §4). Built from the
|
||||
// list, so a sixth locale fails every listing that does not name it.
|
||||
const line = LOCALES.map((locale) => en.settings.lang[locale]).join(' · ');
|
||||
for (const locale of LOCALES) {
|
||||
expect(read(`store/listing.${CHROME_LOCALE_DIRS[locale]}.md`), locale).toContain(line);
|
||||
}
|
||||
expect(read('README.md')).toContain(line);
|
||||
});
|
||||
});
|
||||
Loaded 100 of 111 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user