Skip to content

Suggest shortcuts for sites you visit often - #20

Merged
ion05 merged 2 commits into
masterfrom
feat/suggest-shortcuts
Sep 25, 2026
Merged

ion05 merged 2 commits into
masterfrom
feat/suggest-shortcuts

Conversation

@ion05

@ion05 ion05 commented Sep 24, 2026

Copy link
Copy Markdown
Owner

What

BunnyLol can now suggest shortcuts for the sites you keep going back to. This is opt-in.

  • Shortcuts page: a card above the list. Before you opt in, it shows one sentence and a Suggest shortcuts button. After, it lists up to five sites that no shortcut reaches yet. Add opens the New shortcut form already filled in, and × dismisses that site for good.
  • Popup: up to three suggestions while the box is empty.
  • Welcome screen: the same opt-in button, below the packs.

Suggested shortcuts

How

  • src/lib/suggest.ts is pure (no chrome.*, no DOM). It groups history by site and scores each one as visits + 3× typed visits, dropping anything under 5. It skips sites that any live shortcut, a search engine, localhost/IPs or a dismissal already covers. It then picks a keyword that passes validateAlias and isn't taken.
  • src/lib/history.ts is the only chrome.history caller. It reads the last 90 days on demand and never stores them.
  • history is in optional_permissions, so current users get no prompt and the update does not disable the extension. tests/manifest.test.ts guards this.
  • settings.dismissedSuggestions holds hostnames only. It is normalized leniently, capped at 500 and exported with the rest of settings.
  • Adding a suggestion goes through the existing #new?prefill= form, so no new write path.

Verified

  • pnpm build && pnpm test && pnpm lint: 22 files, 163 tests, all green.
  • Screenshots came from Chromium running the built extension, with seeded history.
    • GitHub (12 visits) and Hacker News (14) were correctly left out, because shortcuts already cover them.
    • Add opened the filled-in form: pitchfork → https://pitchfork.com/.
    • Dismiss removed that suggestion.
    • The popup and the opt-in state rendered.
  • The browser run used a test-only copy with history granted up front, because automation can't click Chrome's permission prompt. The real opt-in click still needs one manual check.

Skipped: deep-link suggestions (a specific repo on a site that already has a shortcut). It's one suggestion per site, pointing at the home page.

🤖 Generated with Claude Code

ion05 and others added 2 commits September 24, 2026 17:13
Adds the pure ranking in src/lib/suggest.ts, the optional history
permission and its reader in src/lib/history.ts, and a persisted
settings.dismissedSuggestions list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lcome screen.

A card above the shortcut list offers the opt-in, then up to five sites
with Add (the prefilled New shortcut form) and dismiss. The popup lists
three while its box is empty. The welcome screen offers the same opt-in.
Docs: PRIVACY, README, CHANGELOG, AGENTS.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ion05
ion05 merged commit a039341 into master Sep 25, 2026
1 check passed
@ion05
ion05 deleted the feat/suggest-shortcuts branch September 25, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant