Skip to content

feat: per-site profile overrides with compact popup redesign#220

Merged
bartekplus merged 6 commits intomasterfrom
feature/site-profile-overrides
Feb 25, 2026
Merged

feat: per-site profile overrides with compact popup redesign#220
bartekplus merged 6 commits intomasterfrom
feature/site-profile-overrides

Conversation

@bartekplus
Copy link
Owner

Summary

Add per-site profile overrides — allowing users to customize prediction language, number of suggestions, and inline-vs-popup mode on a per-domain basis — along with a refreshed compact popup UI inspired by macOS Control Center.

Changes

🎯 Per-Site Profile Overrides (core feature)

  • New siteProfiles.ts shared module — domain normalization, profile validation (clamping, deduplication), and CRUD helpers (getSiteProfileForDomain, setSiteProfileForDomain, removeSiteProfileForDomain)
  • Options page (siteProfiles.js) — full management UI for creating, editing, and deleting per-site profiles with live domain validation
  • Background routing — new CMD_GET_SITE_PROFILE / CMD_SET_SITE_PROFILE / CMD_REMOVE_SITE_PROFILE message handlers; PresageHandler.runPrediction now accepts per-site overrides for numSuggestions
  • Popup integration — popup reads & writes per-site profiles for the active tab, allowing quick per-domain toggles
  • Migration — existing settings are preserved; site-profiles default to {}

🎨 Compact Popup Redesign

  • Redesigned popup using CSS Grid for a scroll-free, space-efficient layout
  • Clean "Control Center" visual style with icon-based toolbar footer
  • Dynamic data-i18n-title tooltip translation support
  • Added quick-access support links (GitHub, rate, share) in the footer

🐛 Bug Fixes

  • Tab completion swallowing — fixed detach order so switching from popup→inline per-site no longer swallows Tab key
  • Firefox hostname messaging — replaced tabs permission tracking with cross-browser CMD_GET_HOSTNAME content-script messaging, fixing Firefox shortcut toggles

🔧 Refactoring

  • Extracted handleToggleActiveLangCommand into a dedicated background helper
  • Added promisifiedSendMessage utility in utils.ts
  • Parallelized sendToAllTabs in TabMessenger for better performance
  • Cleaned up console logging in getActiveTabId abstraction

Testing

Area Coverage
siteProfiles.test.ts 174 lines — normalization, resolution, CRUD, edge cases
background.routing.test.ts +248 lines — profile routing, toggle-lang, error paths
presageHandler.test.js +39 lines — numSuggestions override, clamping, zero
Migration.test.ts +40 lines — migration path validation
puppeteer-extension.test.ts +281 lines — e2e popup profile management, inline override tab completion, UI structure

Files Changed

25 files changed, +2,581 / −311

- Fixed a bug in content_script.ts where changing the suggestion profile from popup to inline per-site would not detach the popup event listeners properly, swallowing the Tab key presses. To fix this, this.tributeManager is only nullified after this.disable() successfully detaches old helpers.
- Added an e2e test verifying tab completion behavior after a site profile override.
- Redesigned popup UI from scratch using CSS Grid to eliminate scrollbars constraints

- Adopted a cleaner, native 'macOS Control Center' inspired minimalist visual style

- Restructured site profile options into a neatly aligned, space-efficient list

- Refactored bottom footer actions into an icon-based flex toolbar

- Updated popup.ts to dynamically translate data-i18n-title attributes for icon tooltips

- Adjusted Puppeteer end-to-end tests to accommodate CSS selector and structure changes
- Extract handleToggleActiveLangCommand to background helper
- Add promisifiedSendMessage utility
- Parallelize sendToAllTabs in TabMessenger
- Fix Firefox tab query issue in background
- Refactor popup.html UI and add support links
- Update tests and apply formatting
The handleToggleActiveLangCommand function calls
tabMessenger.getActiveTabHostname() which was added in a recent
refactor, but the test mock was missing this method. This caused
all CMD_TOGGLE_FT_ACTIVE_LANG tests to silently fail.
@bartekplus bartekplus self-assigned this Feb 25, 2026
@bartekplus bartekplus added the enhancement New feature or request label Feb 25, 2026
@bartekplus bartekplus merged commit 74ce57c into master Feb 25, 2026
4 checks passed
@bartekplus bartekplus deleted the feature/site-profile-overrides branch February 25, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant