Code Suggestion
An editor-like code view with inline ghost-text and diff-block AI suggestions, Accept (Tab), Reject (Esc) and Next, and a why popover.
Preview
analytics/retention.ts2 suggestions
Suggestion 1 of 2 at line 8. Tab to accept, Escape to reject, Alt+] for the next.
import { groupBy } from "./group";export function retentionByWeek(events: Event[]) { const cohorts = groupBy(events, (e) => startOfWeek(e.signupAt)); return Object.entries(cohorts).map(([week, rows]) => ({ week, users: new Set(rows.map((r) => r.userId)).size,
| Old line | New line | Change | Code |
|---|---|---|---|
| @@ -8,0 +8,1 @@ | |||
| 8 | added | retained: rows.filter((r) => r.weeksActive >= 4).length, | |
1/2
}));}function startOfWeek(date: Date) { const d = new Date(date); d.setDate(d.getDate() - d.getDay()); return d.toISOString().slice(0, 10);}
analytics/config.ts1 suggestion
Suggestion 1 of 1 at line 3. Tab to accept, Escape to reject.
export const retention = { weeks: 4,
timezone: "UTC",
1/1
Focus the code and press Tab to accept, Esc to reject, ⌥] for the next.
Install
Pro source requires Pebble Pro. Try the full preview above.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| filename | string | — | Shown in the header. |
| code | string | — | Initial source; accepting suggestions edits a local copy. |
| suggestions | CodeSuggestionItem[] | — | { id, line, kind: inline (ghost text) | block (diff), text, remove?, why? }, shown one at a time. |
| onAccept / onReject | (suggestion, code?) => void | — | Accept (Tab) passes the updated code; Reject is Esc. Next is Alt+]. |
Pro component
Try the full preview above. Editable source and build guides require Pebble Pro.
