|
1 | | -Title: UX Improvements: @mention Tab Selection, LIFO Sorting, Full-Screen Overlay Menu + Jan API Default |
| 1 | +Title: Side Panel UX + Settings Page — Composer Refactor, Suggestion Pills, Theming, and New Components |
2 | 2 |
|
3 | 3 | Summary |
4 | | -- Fix @mention tab selection bug preventing tabs from being added to context via chat input |
5 | | -- Implement LIFO (Last-In-First-Out) sorting for Add context popup to prioritize recent tabs |
6 | | -- Redesign hamburger menu as full-screen overlay with animated slide-in panel |
7 | | -- Set Jan API (https://api.jan.ai/v1) as default endpoint with jan-v1-4b model |
8 | | -- Update documentation with new UX patterns and behavior |
| 4 | +- Introduces a dedicated Settings panel in the side panel UI to configure provider, model, and behavior without leaving the flow. |
| 5 | +- Adds Suggestion Pills for quick-start prompts and common actions in the composer. |
| 6 | +- Refactors Composer and ComposerInput for cleaner structure, better shortcuts, and more predictable behavior. |
| 7 | +- Adds Tooltip and ScrollArea UI components; standardizes global theming with new tokens and a Settings icon. |
| 8 | +- Tightens auto-follow active tab behavior in `App.jsx` and streamlines state management. |
9 | 9 |
|
10 | | -What's included |
11 | | -- **@mention Tab Selection Fix** |
12 | | - - Fixed undefined `insertMentionTab` references by wiring to existing `handleMentionSelect` |
13 | | - - Tab selection now adds to context AND keeps mention text in input with proper cursor positioning |
14 | | - - Supports multiple @mentions in single message |
15 | | -- **LIFO Tab Sorting** |
16 | | - - Add context popup now shows unpinned tabs first, then by lastAccessed (desc), fallback to index (desc) |
17 | | - - Improves tab selection UX when working with many open tabs |
18 | | - - Enhanced search includes title, URL, and tab ID matching |
19 | | -- **Full-Screen Overlay Menu** |
20 | | - - Hamburger menu opens as fixed overlay with semi-transparent scrim covering conversation area |
21 | | - - 320px animated slide-in panel with click-outside-to-close behavior |
22 | | - - Smooth motion animations and proper z-index layering |
23 | | -- **Jan API as Default** |
24 | | - - Default provider changed from "custom" to "jan" |
25 | | - - Default endpoint: https://api.jan.ai/v1 (was empty) |
26 | | - - Default model: jan-v1-4b (was empty) |
27 | | - - API key disabled by default (useApiKey: false) |
28 | | -- **Documentation Updates** |
29 | | - - New ADR-003 documenting UX improvement decisions and implementation |
30 | | - - Updated behavior.md with @mention and overlay menu patterns |
31 | | - - Enhanced considerations.md with new UX scenarios |
| 10 | +What’s Included |
| 11 | +- Side Panel |
| 12 | + - Settings panel UI (`ui/sidepanel/components/Settings.jsx`). |
| 13 | + - Suggestion pills component (`ui/sidepanel/components/SuggestionPills.jsx`). |
| 14 | + - Add Context modal (`ui/sidepanel/components/AddContextModal.jsx`). |
| 15 | + - Composer refactors (`ui/sidepanel/components/composer/Composer.jsx`, `ui/sidepanel/components/ComposerInput.jsx`). |
| 16 | + - App state/auto-follow adjustments (`ui/sidepanel/App.jsx`). |
| 17 | +- UI Components |
| 18 | + - Tooltip (`ui/components/ui/tooltip.tsx`) and ScrollArea (`ui/components/ui/scroll-area.tsx`). |
| 19 | + - Button and Input refinements (`ui/components/ui/button.jsx`, `ui/components/ui/input.jsx`). |
| 20 | + - Settings icon (`ui/sidepanel/components/icons/SettingsIcon.jsx`). |
| 21 | +- Theming & Styles |
| 22 | + - Theme tokens (`ui/themes.css`) and global tweaks (`ui/styles.css`). |
32 | 23 |
|
33 | 24 | Rationale |
34 | | -- **Productivity**: LIFO tab sorting reduces time to find relevant tabs in multi-tab workflows |
35 | | -- **Functionality**: @mention tab selection was broken due to undefined function references |
36 | | -- **Visual Hierarchy**: Full-screen overlay provides clear navigation context vs narrow sidebar |
37 | | -- **Onboarding**: Jan API default eliminates initial setup friction for new users |
38 | | -- **Consistency**: Maintains design system tokens and theme compatibility |
| 25 | +- Improve onboarding and control with an integrated Settings panel. |
| 26 | +- Speed common tasks with Suggestion Pills and better keyboard ergonomics. |
| 27 | +- Prepare for future UI scale with reusable Tooltip/ScrollArea primitives. |
| 28 | +- Consolidate theme tokens for consistent styling and easier iteration. |
39 | 29 |
|
40 | | -Files changed |
41 | | -- src/background.js (default settings, Jan API endpoints) |
42 | | -- ui/sidepanel/App.jsx (mention fix, LIFO sorting, overlay menu) |
43 | | -- docs/adr-003-ux-improvements.md (new ADR) |
44 | | -- behavior.md (@mention and overlay documentation) |
45 | | -- considerations.md (UX scenarios) |
| 30 | +How to Test |
| 31 | +1) Build and load the extension |
| 32 | + - `npm run build` (or `bun run build`) and load `dist/` via `chrome://extensions` → Load unpacked. |
| 33 | +2) Settings Panel |
| 34 | + - Open side panel → gear icon. Verify provider, model, and options render and persist. |
| 35 | + - Toggle relevant options and confirm they affect new sessions where applicable. |
| 36 | +3) Suggestion Pills |
| 37 | + - In the side panel composer, confirm pills render and insert text/context when clicked. |
| 38 | + - Verify keyboard focus/selection works with Tab/Enter. |
| 39 | +4) Composer/ComposerInput |
| 40 | + - Type, submit, and edit messages. Confirm shortcuts (Enter to send, Shift+Enter newline) behave consistently. |
| 41 | + - Validate streaming, cancel, and retry work without focus loss. |
| 42 | +5) Auto-follow Active Tab |
| 43 | + - Switch browser tabs with auto-follow enabled; confirm session follows active tab without losing state. |
| 44 | +6) Tooltip/ScrollArea |
| 45 | + - Confirm tooltips render on hover/focus in updated UI. Validate long lists scroll smoothly. |
| 46 | +7) Theming/Styles |
| 47 | + - Sanity-check themes and global styles; ensure contrast and spacing look consistent. |
46 | 48 |
|
47 | | -How to test locally |
48 | | -1) **@mention Tab Selection** |
49 | | - - Type `@` in chat input to trigger mention popup |
50 | | - - Verify tabs appear in LIFO order (unpinned first, then by lastAccessed desc) |
51 | | - - Use arrow keys to navigate, Enter/Tab/click to select |
52 | | - - Confirm tab is added to context AND mention text remains in input |
53 | | - |
54 | | -2) **Add Context Popup LIFO Sorting** |
55 | | - - Click "Add context" button |
56 | | - - Verify tabs show unpinned first, then most recently accessed |
57 | | - - Search should match title, URL, and tab ID |
58 | | - |
59 | | -3) **Full-Screen Overlay Menu** |
60 | | - - Click hamburger menu (☰) |
61 | | - - Verify full-screen overlay with scrim covers conversation area |
62 | | - - Test click-outside-to-close behavior |
63 | | - - Check smooth slide-in animation |
64 | | - |
65 | | -4) **Jan API Default** |
66 | | - - Fresh install should default to Jan provider with https://api.jan.ai/v1 |
67 | | - - Model should default to jan-v1-4b |
68 | | - - API key should be disabled by default |
| 49 | +Files Touched (high-level) |
| 50 | +- `ui/sidepanel/App.jsx` |
| 51 | +- `ui/sidepanel/components/ComposerInput.jsx` |
| 52 | +- `ui/sidepanel/components/composer/Composer.jsx` |
| 53 | +- `ui/sidepanel/components/SuggestionPills.jsx` |
| 54 | +- `ui/sidepanel/components/AddContextModal.jsx` |
| 55 | +- `ui/sidepanel/components/Settings.jsx` |
| 56 | +- `ui/components/ui/button.jsx`, `ui/components/ui/input.jsx` |
| 57 | +- `ui/components/ui/tooltip.tsx`, `ui/components/ui/scroll-area.tsx` |
| 58 | +- `ui/sidepanel/components/icons/SettingsIcon.jsx` |
| 59 | +- `ui/themes.css`, `ui/styles.css` |
69 | 60 |
|
70 | | -5) **Build and Load Extension** |
71 | | - - `npm run build` then load `dist/` via `chrome://extensions` → Load unpacked |
72 | | - - Test all above functionality in browser |
| 61 | +Behavioral Notes |
| 62 | +- Auto-follow reads from `context.autoFollowActiveTab`; side panel re-registers active tab as needed. |
| 63 | +- Composer shortcuts and focus handling are more predictable; streaming remains cancellable. |
73 | 64 |
|
74 | | -Behavioral Changes |
75 | | -- **@mention**: Now functional - adds tabs to context while preserving mention text |
76 | | -- **Tab Sorting**: LIFO ordering prioritizes recently accessed tabs for faster selection |
77 | | -- **Menu UX**: Full-screen overlay provides better visual hierarchy than narrow sidebar |
78 | | -- **Default Config**: Jan API eliminates setup friction for new users |
79 | | - |
80 | | -Technical Implementation |
81 | | -- Fixed undefined function references in mention system |
82 | | -- Added LIFO sort logic with unpinned-first priority |
83 | | -- Implemented fixed-position overlay with scrim and animations |
84 | | -- Updated default settings in background.js |
85 | | -- Preserved theme system compatibility |
| 65 | +Screenshots |
| 66 | +- Add Settings panel, Suggestion Pills, and composer before/after screenshots (attach). |
86 | 67 |
|
87 | 68 | Checklist |
88 | | -- [x] @mention tab selection adds to context and keeps text in input |
89 | | -- [x] Add context popup shows LIFO-sorted tabs |
90 | | -- [x] Hamburger menu opens as full-screen overlay with animations |
91 | | -- [x] Jan API set as default endpoint with jan-v1-4b model |
92 | | -- [x] Documentation updated (ADR-003, behavior.md, considerations.md) |
93 | | -- [x] Build succeeds without errors |
| 69 | +- [x] Builds cleanly and loads in Chromium. |
| 70 | +- [x] Settings persist and apply in new sessions. |
| 71 | +- [x] Suggestion pills insert as expected; accessible via keyboard. |
| 72 | +- [x] Composer shortcuts correct; streaming is responsive and cancellable. |
| 73 | +- [x] Tooltip/ScrollArea render and behave consistently. |
| 74 | +- [x] Theming tokens apply without regressions. |
| 75 | + |
| 76 | +Breaking Changes |
| 77 | +- None expected. UI-only additions and refactors; no storage schema changes. |
| 78 | + |
| 79 | +Release Notes |
| 80 | +- Side panel Settings, Suggestion Pills, and composer refactors improve UX and configurability. New Tooltip/ScrollArea primitives and theme tokens standardize UI going forward. |
94 | 81 |
|
0 commit comments