v1.0.15 — Undo button: 'session-only' hint
v1.0.15 — Undo button: "session-only" hint
「回退」按钮下方加一行 hint 浮动文字
What's new
The undo button now ships with a small explanatory hint below it:
仅本次会话可回退,刷新后清空
Only undoable in this session; clears on refresh
The hint tells the user that the undo stack is in-memory only — refreshing the page (which commits the current layout to disk) clears the history, after which the undo button can no longer help. This was a frequent source of confusion ("why doesn't undo work after refresh?") that the user feedback wanted addressed.
Design
- Button itself is unchanged — same original size (≈33px tall, padding 7px 14px + font-size 1.2rem + line-height 1.4). We tried growing it to match the search input height, but the larger button felt visually heavy next to the search box.
- The hint floats below the button via
position: absolute(top: calc(100% + 4px)) anchored to the.undo-wrapdiv. Because the hint is out-of-flow, it does not affect the topbar's flex layout — the search input and undo button stay cleanly aligned. - 10 locale translations ship with the new string:
en / zh / es / ar / hi / fr / pt / de / ja / ru.tsc --noEmitenforces that every catalog has the newundo.sessionHintkey at compile time. hi / ar / rutranslations are AI-generated — they're usable but may benefit from manual polish. The translation source lives insrc/lib/i18n/catalog/<code>.ts.
DOM / CSS
<div class="undo-wrap"> <!-- position: relative (anchor) -->
<button id="undo_button">
<span class="undo-label">回退</span>
<span class="undo-count">1</span>
</button>
<span class="undo-hint"> <!-- position: absolute -->
仅本次会话可回退,刷新后清空
</span>
</div>.undo-wrap { position: relative; flex: 0 0 auto; margin-left: 8px; }
.undo-hint {
position: absolute;
top: calc(100% + 4px);
left: 50%;
transform: translateX(-50%);
font-size: 1.1rem;
color: var(--muted-foreground);
white-space: nowrap;
}Fixed
manifest.json/package.json/src/lib/version.tsversion drift. The v1.0.14 release only bumpedmanifest.jsonandpackage.json—src/lib/version.tsstayed at1.0.13. All three are now synced at1.0.15. (This was the underlying reason the About tab showed a different version number thanchrome://extensions.)
Files changed
| File | Δ |
|---|---|
src/lib/i18n/types.ts |
+1 line (new MessageKey) |
src/lib/i18n/catalog/*.ts (×10) |
+1 line each (translations) |
src/newtab/undo-button.ts |
refactored DOM + visibility logic |
styles/newtab.css |
+.undo-wrap / .undo-hint styles |
manifest.json / package.json / src/lib/version.ts |
version sync |
CHANGELOG.md |
v1.0.15 entry |
Bundle: newtab.js 29.19 KB gzipped (under the 80 KB budget).
Installation
- Chrome Web Store: upload
build/newtab01-1.0.15.zip - Edge Add-ons: upload the same zip (manifest already Edge-compatible per v1.0.13 store-submission cleanup)
- From source (developer):
pnpm install && pnpm build && load dist/ as unpacked extension
Acknowledgements
The _locales/ Chrome Web Store listing translation support was added in v1.0.14 (the release immediately before this one). That work makes the per-store-locale dashboard translation flow possible for the new undo.sessionHint string going forward.
The undo button itself was originally added in v0.2.61 (see feat/drag-undo branch).