feat: rewrite the options page for first-time users (#23)
Rewrites the options page for first-time users without removing any setting. Customization in a lightweight package is what sets this extension apart. Design: `docs/superpowers/specs/2026-10-18-options-page-for-first-time-users-design.md`. **User-visible changes** - **Layout:** the description stays as the first line, followed by a **Usage instructions** section and the **Settings** section. Each section has a heading and a divider. - **Usage instructions:** one labelled line per way to open ChatGPT, each with a small drawing: - **Address bar:** `<Ctrl>+L`, then `gpt`, a space and the question. The drawing shows a ChatGPT label because the address-bar code shipped in Firefox 157.0.1 enters search mode when an engine keyword is followed by a space. I checked that in its `omni.ja`, but it still needs confirming on screen; see the checks below. - **Right-click:** a drawing of the menu with Ask ChatGPT highlighted. - **Keyboard:** key caps for the user's actual shortcut, held down. The line is hidden when no shortcut is set. - **Toolbar:** the hovered button with the pointer, its tooltip, the puzzle-piece Extensions button, and a selected heading. - **Drawings:** they are HTML/CSS and inline SVG, not screenshots, so they follow light and dark themes, stay sharp, and never go stale. They are centred. The package grows from 52.8 KB to 56.5 KB. - **Settings:** - **Right-click menu** (was "Context menu") and **Open ChatGPT in** stay visible. - Choosing **Advanced** reveals a drawing of the Ask ChatGPT submenu (Ask normally, Explain, Summarize, Debug code). It lives in the block that only shows for Advanced, so it needs no script. - Prompt template, temporary chat and web search move under **More options**, whose heading names them. It opens by itself on load, or when a sync changes one of them, if one of them isn't at its default. - **Restore defaults** is right-aligned and red. - **Bottom of the page:** - The keyword/default-engine and keyboard-shortcut notes become collapsed sections with numbered steps. - The project links are centred, and stack on narrow panels. - **Hotkeys:** written as `<Ctrl>+L` and `<Alt>+<Shift>+G`, including the user's actual shortcut. Mac users see `<Cmd>`, `<Option>` and `<Return>`, detected with `runtime.getPlatformInfo`, which needs no permission. - **Docs:** - Keyword wording is corrected in the options page and README: Firefox adds a custom keyword alongside `gpt` instead of replacing it. - README and AGENTS.md use the new setting names. - AGENTS.md records the keep-every-setting rule, the hotkey format and the "filled in, never sent" copy rule. These still match the original options design spec: the temporary-chat and web-search wording, and the rule that copy never says the question is sent. No permission, search URL, privacy or packaging changes. **Checks** - `npm test`: lint 0 errors / 0 warnings, 61/61 unit tests, build OK. - New tests: - the key formatter, including the Mac names Firefox stores (Command, MacCtrl, Alt) - the page's written hotkeys match the formatter - the keyboard drawing's key caps follow the live shortcut - Rendered in headless Firefox 157 with the extension APIs stubbed: - light and dark themes - 680 px and 360 px wide - Mac key names - More options opening for a customised prompt template - both bottom sections expanded **Manual Firefox checks (`npm run dev` → about:addons → Preferences)** - [x] Typing `gpt` and a space shows a ChatGPT label in the address bar, as drawn. If it doesn't, the drawing drops the label and shows plain `gpt how do magnets work?` - [x] Light and dark themes, and a narrow about:addons width - [x] Expanding More options and the two bottom sections grows the inline panel without clipping or scrolling - [x] The Keyboard line and its key caps disappear when the shortcut is removed, and come back showing the new keys when one is set - [x] More options opens by itself after changing the prompt template and reopening the page - [x] Choosing Advanced shows the submenu drawing; Simple and Off hide it - [x] Settings still save, and Restore defaults still works 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: https://git.zavage.net/Zavage-Software/search-with-chatgpt-powered-by-openai-extension/pulls/23 Co-authored-by: golem <golem@zavage.net>
This commit is contained in:
@@ -31,23 +31,24 @@ Click the extension’s **Ask ChatGPT** toolbar button to use selected text or,
|
||||
with nothing selected, open a blank chat. On pages Firefox does not allow
|
||||
extensions to read, the button opens a blank chat. You can pin the button to
|
||||
the toolbar from Firefox’s extensions menu. It uses your saved prompt and
|
||||
tab/window preferences, and works even when the context menu is Off.
|
||||
tab/window preferences, and works even when the right-click menu is Off.
|
||||
|
||||
The options panel shows your currently configured shortcut and refreshes when
|
||||
it changes or you return to the panel. If you remove it, the panel shows
|
||||
The options panel's collapsed **Change the keyboard shortcut** section shows
|
||||
your currently configured shortcut and refreshes when it changes or you return
|
||||
to the panel. If you remove it, the panel shows
|
||||
“No keyboard shortcut assigned”. Its **Change keyboard shortcut** button opens
|
||||
Firefox’s shortcut editor when supported; otherwise follow the menu path above.
|
||||
**Restore defaults** does not change your keyboard shortcut.
|
||||
|
||||
To customize the prompt, set **Prompt template** to something like
|
||||
To customize the prompt, open **More options** and set **Prompt template** to something like
|
||||
`Explain simply: {query}` or `Translate into Spanish: {query}`. The Simple menu action, Ask normally, toolbar button, and shortcut use your template.
|
||||
Other advanced actions use their own dedicated prompts.
|
||||
|
||||
## Search keyword and default engine
|
||||
|
||||
Open Firefox’s **Settings → Search**, or paste `about:preferences#search` into
|
||||
the address bar. Under **Search Shortcuts**, edit ChatGPT’s keyword to replace
|
||||
`gpt` with your preferred prefix. Under **Default Search Engine**, choose
|
||||
the address bar. Under **Search Shortcuts**, edit ChatGPT’s keyword to add
|
||||
your own prefix; `gpt` keeps working alongside it. Under **Default Search Engine**, choose
|
||||
ChatGPT to search without a prefix, or choose your previous engine to switch
|
||||
back. See [Firefox’s search settings guide](https://support.mozilla.org/en-US/kb/change-your-default-search-settings-firefox)
|
||||
for illustrated instructions.
|
||||
@@ -60,21 +61,25 @@ not change them.
|
||||
Open `about:addons`, select this extension, and choose the **Options** tab
|
||||
(**Preferences** on macOS and Linux). Available settings:
|
||||
|
||||
- **Context menu** — **Simple** (default) keeps the direct selection action;
|
||||
- **Right-click menu** — **Simple** (default) keeps the direct selection action;
|
||||
**Advanced** offers contextual presets; **Off** hides the menu. The toolbar
|
||||
button and keyboard shortcut work in every mode. Existing enabled/disabled preferences migrate
|
||||
to Simple/Off. Changes apply without restarting Firefox.
|
||||
- **Show Translate in advanced menu** — off by default. When enabled, choose
|
||||
- **Show Translate in the Advanced menu** — off by default. When enabled, choose
|
||||
**Ask each time** for a language dialog, or enter a **Preferred language**
|
||||
to translate directly. An empty or invalid preferred language falls back to
|
||||
asking. Enter continues; Escape or Cancel opens nothing.
|
||||
- **Open ChatGPT in** — a new tab, a new background tab, or a new window.
|
||||
|
||||
Under **More options**, which opens by itself once you have changed one of
|
||||
them:
|
||||
|
||||
- **Prompt template** — wraps your text, for example `Explain simply: {query}`.
|
||||
Up to 1,000 characters.
|
||||
- **Request a temporary chat** — asks ChatGPT not to save the conversation.
|
||||
ChatGPT may not honour this; check its own indicator before relying on it.
|
||||
- **Ask ChatGPT to use web search** — a hint to ChatGPT's interface, not a
|
||||
guarantee.
|
||||
- **Open in** — a new tab, a new background tab, or a new window.
|
||||
- **Prompt template** — wraps your text, for example `Explain simply: {query}`.
|
||||
Up to 1,000 characters.
|
||||
|
||||
Restore defaults resets extension preferences to Simple mode with translation
|
||||
hidden; it does not change Firefox's search engine or shortcut settings.
|
||||
|
||||
Reference in New Issue
Block a user