vite-plugin-specter 0.7.0 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,6 +8,7 @@ Specter is a Vite plugin that overlays an element inspector on your dev server.
8
8
 
9
9
  - Your project must use **Vite** as its dev server
10
10
  - Works with React, Vue, Svelte, or plain HTML served through Vite
11
+ - Works on **macOS, Windows, and Linux** — shortcuts read the physical keys, so Mac's Option = Windows/Linux Alt, and Cmd+C = Ctrl+C
11
12
 
12
13
  ## Install
13
14
 
@@ -46,7 +47,9 @@ If you ever need Specter gone entirely, remove `specter()` from the Vite config
46
47
 
47
48
  ### Toggle on/off
48
49
 
49
- Press **Ctrl+Option+Z** to activate Specter. A small zap icon appears at the bottom-left. Press again (or **Esc**) to hide it — your Specs are kept and reappear when you reactivate.
50
+ Press **Ctrl+Alt+Z** to activate Specter (on a Mac the Alt key is labelled **Option**, so it's Ctrl+Option+Z — same keys). A small zap icon appears at the bottom-left. Press again (or **Esc**) to hide it — your Specs are kept and reappear when you reactivate.
51
+
52
+ **Shortcut taken by your browser?** Some setups bind `Ctrl+Alt+Z` (e.g. a Firefox side-panel extension). You can rebind Specter's toggle to any chord in seconds — from the overlay (**L** → Keyboard shortcuts → **Change**) or the DevTools console (`window.__specter.setShortcut('ctrl+alt+p')`), no config edit or restart. See [Change the toggle shortcut](#change-the-toggle-shortcut-without-touching-config). There's no chord that's free in every browser, so it's fully rebindable rather than fixed.
50
53
 
51
54
  ### Three modes
52
55
 
@@ -55,7 +58,7 @@ Specter has three modes; switching mode only changes *what's shown on screen*
55
58
  | Mode | Enter | Shows |
56
59
  |------|-------|-------|
57
60
  | **Properties** (default) | — | Styles tooltip on hover |
58
- | **Measure** | tap **Option** | Figma-style spacing to neighbors |
61
+ | **Measure** | tap **Option / Alt** | Figma-style spacing to neighbors |
59
62
  | **Comment** | **C** | Just an outline — for clean design review |
60
63
 
61
64
  ### Inspect an element (Properties mode)
@@ -71,7 +74,7 @@ Specter has three modes; switching mode only changes *what's shown on screen*
71
74
 
72
75
  ### Measure spacing (Measure mode)
73
76
 
74
- Tap **Option** to switch to Measure mode. Hover any element to see distances to its surrounding neighbors. Press **M** while hovering to **pin** that element, then hover another to measure the gap or inset between the two; **M** again unpins. Tap **Option** again to return to Properties.
77
+ Tap **Option / Alt** to switch to Measure mode. Hover any element to see distances to its surrounding neighbors. Press **M** while hovering to **pin** that element, then hover another to measure the gap or inset between the two; **M** again unpins. Tap **Option / Alt** again to return to Properties.
75
78
 
76
79
  ### Mark a Spec (and optionally annotate)
77
80
 
@@ -87,7 +90,7 @@ Press **L** to open the Specs review panel. It lists every Spec; hover a row to
87
90
 
88
91
  ### Copy to your AI
89
92
 
90
- Press **Cmd+C**:
93
+ Press **Cmd+C** (**Ctrl+C** on Windows/Linux):
91
94
 
92
95
  - **With Specs marked** → copies **all** of them at once. Each block leads with your `✏️ CHANGE:` note (if any).
93
96
  - **With nothing marked** → copies the hovered element's properties (or, in Measure mode, the measurement).
@@ -129,16 +132,18 @@ Specs aren't only for your AI — you can send them to a **person**. Mark commen
129
132
 
130
133
  | Action | Shortcut |
131
134
  |--------|----------|
132
- | Toggle Specter | **Ctrl+Option+Z** |
135
+ | Toggle Specter | **Ctrl+Alt+Z** (Ctrl+Option+Z on Mac) |
133
136
  | Inspect element | Hover (while active) |
134
137
  | Mark a Spec (+ optional note) | **P** |
135
- | Copy (all Specs, or hovered element) | **Cmd+C** |
136
- | Measure mode (toggle) | **Option** (tap) |
138
+ | Copy (all Specs, or hovered element) | **Cmd+C** / **Ctrl+C** |
139
+ | Measure mode (toggle) | **Option / Alt** (tap) |
137
140
  | Pin / unpin for measuring | **M** (in Measure mode) |
138
141
  | Comment mode (toggle) | **C** |
139
142
  | Specs panel (toggle) | **L** |
140
143
  | Close panel / hide Specter | **Esc** |
141
144
 
145
+ > **Mac / Windows / Linux** — the keys are the same everywhere; only the labels differ. Mac's **Option** key is **Alt** on Windows/Linux, and **Cmd+C** is **Ctrl+C**. Specter reads the physical modifier, so every shortcut works on all three.
146
+
142
147
  ## Optional: push Specs straight to Claude Code (`/spectify`)
143
148
 
144
149
  Instead of copy-paste, Specter can auto-sync your Specs to a local bridge that Claude Code reads on demand. Enable it in your Vite config:
@@ -147,7 +152,22 @@ Instead of copy-paste, Specter can auto-sync your Specs to a local bridge that C
147
152
  specter({ claudeBridge: true })
148
153
  ```
149
154
 
150
- With it on, every Spec you mark auto-syncs (watch for the sync dot in the panel) to a local bridge at `http://127.0.0.1:8787`. Run the bridge (`node node_modules/vite-plugin-specter/mcp-bridge/server.mjs`, or register it in your project's `.mcp.json` so your IDE launches it), then in Claude Code run **`/spectify`** — it pulls whatever's currently synced and implements it. See [`mcp-bridge/`](https://github.com/setugk/vite-plugin-specter/tree/main/mcp-bridge) for setup. One bridge can serve several projects; `/spectify <port>` scopes to one.
155
+ With it on, every Spec you mark auto-syncs (watch for the sync dot in the panel) to a local bridge at `http://127.0.0.1:8787`, and Claude Code pulls from it — no copy-paste.
156
+
157
+ ### Recommended: install the Claude Code plugin
158
+
159
+ The plugin bundles the `/spectify` command **and** the bridge as an MCP server, so Claude Code launches the bridge for you — nothing to run in a terminal:
160
+
161
+ ```
162
+ /plugin marketplace add setugk/vite-plugin-specter
163
+ /plugin install specter@specter
164
+ ```
165
+
166
+ Then in Claude Code just run **`/spectify`** (or say "apply my Specter notes" — the plugin also exposes `pop_specs`/`peek_specs` tools). One bridge can serve several projects; `/spectify <port>` scopes to one.
167
+
168
+ ### Manual (no plugin)
169
+
170
+ Prefer not to install the plugin? Run the bridge yourself and drop the command in by hand — see [`mcp-bridge/`](https://github.com/setugk/vite-plugin-specter/tree/main/mcp-bridge) for the `server.mjs` + `spectify.md`.
151
171
 
152
172
  `claudeBridge` is **off by default** — the shipped plugin never opens a connection unless you enable it.
153
173
 
@@ -159,7 +179,20 @@ specter({ shortcuts: { activate: 'ctrl+shift+i' } }) // custom activate shortcu
159
179
  specter({ claudeBridge: true }) // enable the Claude Code bridge
160
180
  ```
161
181
 
162
- The `activate` shortcut accepts any combination of `ctrl`, `alt`, `shift`, `meta`/`cmd`, and a key. Default is `ctrl+alt+z`.
182
+ The `activate` shortcut accepts any combination of `ctrl`, `alt`, `shift`, `meta`/`cmd`, and a key. Default is `ctrl+alt+z`. This value is just the **default** — see below for changing it live.
183
+
184
+ ### Change the toggle shortcut without touching config
185
+
186
+ The `vite.config` value is only the starting point. To rebind on the fly (no config edit, no restart):
187
+
188
+ - **In the overlay** — open the Specs panel (**L**), expand **Keyboard shortcuts**, and hit **Change** next to the toggle. Press your new combo. It's saved per site in `localStorage` and overrides the config default; **Reset** returns to the default.
189
+ - **From the DevTools console** — handy if your current chord collides with a browser shortcut and you *can't* open the overlay:
190
+ ```js
191
+ window.__specter.setShortcut('ctrl+alt+p') // rebind
192
+ window.__specter.toggle() // open/close Specter
193
+ window.__specter.resetShortcut() // back to the config default
194
+ ```
195
+ (`window.__specter` is dev-only and, like the rest of Specter, never ships to production.)
163
196
 
164
197
  ## Optional: `data-style` attribute
165
198