feedtack 0.5.1 → 1.1.0
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 +45 -9
- package/dist/chunk-3INDOI4N.js +1235 -0
- package/dist/index.d.ts +65 -3
- package/dist/index.js +86 -1
- package/dist/react/index.d.ts +5 -7
- package/dist/react/index.js +500 -787
- package/dist/{theme-C-uctIoI.d.ts → types-Cu4Oahg4.d.ts} +45 -4
- package/package.json +1 -1
- package/dist/chunk-PPM4AIJU.js +0 -237
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# feedtack
|
|
2
2
|
|
|
3
|
-
> Click anywhere. Drop a pin. Get a payload a developer can act on.
|
|
3
|
+
> Click anywhere. Drop a pin. Leave a note. Get a payload a developer can act on.
|
|
4
4
|
|
|
5
|
-
**feedtack** is a drop-in React feedback overlay.
|
|
5
|
+
**feedtack** is a drop-in React feedback overlay. A "Feedback" button opens a modal where anyone can leave site-wide notes, page-level comments, or place a pin on a specific element — all from one entry point. feedtack emits a structured JSON payload so complete that an LLM can attempt a first-pass fix before consuming developer hours.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -166,16 +166,19 @@ class SupabaseAdapter implements FeedtackAdapter {
|
|
|
166
166
|
|
|
167
167
|
## The payload
|
|
168
168
|
|
|
169
|
-
Every
|
|
169
|
+
Every submission emits a versioned JSON payload. The `scope` field indicates where the feedback lives.
|
|
170
|
+
|
|
171
|
+
**Element-scoped (pinned to a specific element):**
|
|
170
172
|
|
|
171
173
|
```json
|
|
172
174
|
{
|
|
173
|
-
"schemaVersion": "
|
|
175
|
+
"schemaVersion": "2.0.0",
|
|
174
176
|
"id": "ft_01j...",
|
|
175
177
|
"timestamp": "2026-04-09T13:42:00.000Z",
|
|
176
178
|
"submittedBy": { "id": "u1", "name": "Alice", "role": "designer" },
|
|
179
|
+
"scope": "element",
|
|
177
180
|
"comment": "This button doesn't do anything",
|
|
178
|
-
"sentiment": "
|
|
181
|
+
"sentiment": "bad",
|
|
179
182
|
"pins": [{
|
|
180
183
|
"index": 1,
|
|
181
184
|
"color": "#ef4444",
|
|
@@ -185,8 +188,8 @@ Every pin emits a versioned JSON payload:
|
|
|
185
188
|
"selector": "#submit-btn",
|
|
186
189
|
"best_effort": false,
|
|
187
190
|
"tagName": "BUTTON",
|
|
188
|
-
"
|
|
189
|
-
"
|
|
191
|
+
"dataTestId": "submit-btn",
|
|
192
|
+
"ancestors": ["form#checkout", "main"],
|
|
190
193
|
"boundingRect": { "x": 420, "y": 812, "width": 200, "height": 44 }
|
|
191
194
|
}
|
|
192
195
|
}],
|
|
@@ -196,14 +199,47 @@ Every pin emits a versioned JSON payload:
|
|
|
196
199
|
}
|
|
197
200
|
```
|
|
198
201
|
|
|
202
|
+
**Page or site-scoped (no pin):**
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"schemaVersion": "2.0.0",
|
|
207
|
+
"id": "ft_01k...",
|
|
208
|
+
"scope": "page",
|
|
209
|
+
"comment": "This page is really confusing — too many steps",
|
|
210
|
+
"sentiment": "bad",
|
|
211
|
+
"pins": [],
|
|
212
|
+
"page": { "url": "https://app.example.com/checkout", "pathname": "/checkout", "title": "Checkout" },
|
|
213
|
+
...
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`sentiment` values: `"good"` | `"bad"` | `null`
|
|
218
|
+
|
|
219
|
+
## Feedback scopes
|
|
220
|
+
|
|
221
|
+
Feedtack supports three levels of feedback, all accessible from the modal:
|
|
222
|
+
|
|
223
|
+
| Scope | When to use | Pins |
|
|
224
|
+
|-------|-------------|------|
|
|
225
|
+
| `site` | Config-level feedback affecting the whole site (e.g. "change the font everywhere") | None |
|
|
226
|
+
| `page` | Feedback specific to the current page (e.g. "this page is confusing") | None |
|
|
227
|
+
| `element` | Feedback pinned to a specific element (e.g. "this button doesn't work") | One or more |
|
|
228
|
+
|
|
229
|
+
**How it works:**
|
|
230
|
+
- Clicking "Feedback" opens the modal
|
|
231
|
+
- The modal has **Site** and **Page** tabs for scope-level feedback
|
|
232
|
+
- "Place a pin" in the modal footer activates crosshair mode — useful on mobile too
|
|
233
|
+
- `Shift+P` anywhere on the page opens the modal
|
|
234
|
+
|
|
199
235
|
## `useFeedtack` hook
|
|
200
236
|
|
|
201
237
|
```tsx
|
|
202
238
|
import { useFeedtack } from 'feedtack/react'
|
|
203
239
|
|
|
204
240
|
function MyButton() {
|
|
205
|
-
const { activatePinMode, isPinModeActive } = useFeedtack()
|
|
206
|
-
return <button onClick={
|
|
241
|
+
const { openModal, closeModal, isModalOpen, activatePinMode, isPinModeActive } = useFeedtack()
|
|
242
|
+
return <button onClick={openModal}>{isModalOpen ? 'Close' : 'Give Feedback'}</button>
|
|
207
243
|
}
|
|
208
244
|
```
|
|
209
245
|
|