Commit Graph

270 Commits

Author SHA1 Message Date
Gigi
8faa2e2de0 chore: bump version to 0.1.6 v0.1.6 2025-10-05 04:17:44 +01:00
Gigi
07a5826774 refactor: extract components to keep files under 210 lines
- Extract ColorPicker component from Settings
- Extract FontSelector component from Settings
- Move hexToRgb helper to colorHelpers utils
- Export HIGHLIGHT_COLORS constant from colorHelpers
- Settings.tsx now 209 lines (was 242)
- ContentPanel.tsx now 197 lines (was 204)

Keeps code DRY and improves maintainability
2025-10-05 04:17:03 +01:00
Gigi
21d6916ae3 fix: ensure highlight color CSS variable inherits from parent
Remove local --highlight-rgb declarations that were preventing color inheritance in preview
2025-10-05 04:14:11 +01:00
Gigi
482ba9b2df style: make font size and color buttons match icon button size (33px) 2025-10-05 04:13:28 +01:00
Gigi
e4b6d1a122 feat: add configurable highlight colors
- Add highlightColor setting with 6 preset colors (yellow, orange, pink, green, blue, purple)
- Implement color picker UI with square color swatches
- Use CSS variables to dynamically apply highlight colors
- Add hex to RGB conversion for color transparency support
- Update both marker and underline styles to use selected color
2025-10-05 04:12:31 +01:00
Gigi
b59a295ad3 feat: add highlight style setting (marker & underline) 2025-10-05 04:08:58 +01:00
Gigi
e771b9778f chore: bump version to 0.1.5 v0.1.5 2025-10-05 04:05:05 +01:00
Gigi
a95c0ed3ff refactor: reduce file sizes to meet 210 line limit
- Extract URL normalization to urlHelpers utility (DRY)
- Condense Settings.tsx from 212 to 190 lines
  - Inline IconButton props on single lines
  - Shorten preview text
- Condense ContentPanel.tsx from 223 to 190 lines
  - Extract filterHighlightsByUrl function
  - Remove unnecessary logic
- All files now under 210 line limit
- All lint and type checks pass
2025-10-05 04:02:49 +01:00
Gigi
4b9a4fb286 refactor: extract settings logic into custom hook
- Create useSettings hook to handle settings loading, saving, and watching
- Move settings-related logic out of Bookmarks component
- Move font loading logic into the hook
- Reduce Bookmarks.tsx from 221 to 167 lines (under 210 limit)
- Keep code DRY by centralizing settings management
- All lint and type checks pass
2025-10-05 04:01:09 +01:00
Gigi
0c9f68c5cd fix: resolve linter errors
- Remove unused FontAwesomeIcon import from Settings component
- Remove invalid eslint-disable comment for non-configured rule
- Add onSave back to useEffect dependencies to satisfy linter
- All lint checks and type checks now pass
2025-10-05 03:58:19 +01:00
Gigi
850a4bede5 fix: prevent settings from saving unnecessarily
- Wrap handleSaveSettings in useCallback to prevent recreation
- Only trigger save effect when localSettings object changes
- Remove onSave from dependency array with eslint-disable comment
- Settings now only save when user actually changes a setting
2025-10-05 03:56:49 +01:00
Gigi
89c00035a8 refactor: remove debounce from settings auto-save
- Settings now save immediately when changed
- Remove setTimeout debounce logic
- Keep code simple and straightforward
2025-10-05 03:55:15 +01:00
Gigi
61307fc22d feat: implement auto-save for settings with toast notifications
- Create Toast component for user feedback
- Add toast notification styles with slide-in animation
- Remove Save Settings button from Settings component
- Implement auto-save with 500ms debounce on setting changes
- Show success/error toast messages when settings are saved
- Settings now save automatically as user makes changes
- Improves UX by eliminating manual save step
2025-10-05 03:53:02 +01:00
Gigi
31610af706 fix: increase bottom padding in settings content area
- Increase bottom padding in .settings-content from 1rem to 2rem
- Ensures Save Settings button is fully visible and not cut off
- Improves scrollable area spacing
2025-10-05 03:49:42 +01:00
Gigi
e9cbe56bc0 refactor: consolidate settings initialization on login
- Merge settings load and subscription setup into single useEffect
- Ensure settings are loaded immediately upon successful login
- Set up watchSettings subscription at the same time as initial load
- Add eventStore as dependency to ensure proper initialization
- Improves timing and prevents race conditions
2025-10-05 03:48:32 +01:00
Gigi
09bbe10aa6 feat: add settings subscription to watch for Nostr updates
- Import and use watchSettings from settingsService
- Subscribe to settings changes in eventStore
- Automatically update app state when settings change from Nostr
- Properly cleanup subscription on component unmount
- Fixes settings resetting on browser refresh
2025-10-05 03:47:32 +01:00
Gigi
188147d057 fix: update originalHtmlRef when content changes
- Remove faulty conditional that prevented HTML ref from updating
- Now properly stores fresh content when switching articles
- Fixes issue where articles weren't switching properly
2025-10-05 03:42:28 +01:00
Gigi
91fe1711cd fix: move readingStats hook before early returns
- Fixes React Hooks order violation
- All hooks must be called unconditionally in the same order
- Moved readingStats useMemo before the conditional returns
- Resolves 'Rendered more hooks than during the previous render' error
2025-10-05 03:38:42 +01:00
Gigi
cc0b27f7cd fix: replace custom reading time with reading-time-estimator package
- Remove custom readingTime.ts implementation
- Install reading-time-estimator package (browser-compatible)
- Update ContentPanel to use named import from reading-time-estimator
- Fixes browser compatibility issues with reading-time package
- All linting and type checks pass
2025-10-05 03:35:22 +01:00
Gigi
0a3bb72d89 fix: prevent save settings button from being cut off
- Add padding-bottom to settings-content for breathing room
- Add bottom padding to settings-footer
- Add flex-shrink: 0 to footer to prevent it from being compressed
- Ensures Save Settings button is always fully visible
2025-10-05 03:29:24 +01:00
Gigi
2719ad3602 feat: add reading time estimate to articles
- Install reading-time package
- Calculate reading time from article content (html or markdown)
- Display reading time with clock icon in article header
- Strip HTML tags for accurate word count
- Style reading-time indicator similar to highlights
- Shows estimated reading time (e.g., '5 min read')
2025-10-05 03:28:36 +01:00
Gigi
02798e99e8 style: add max-width to main pane for better readability
- Set max-width of 900px for the main content pane
- Center content with margin: 0 auto
- Add horizontal padding for breathing room
- Improves reading experience by preventing overly wide lines
2025-10-05 03:26:54 +01:00
Gigi
aba91f7a52 feat: inline font selector with styled options and fix font size 2025-10-05 03:26:18 +01:00
Gigi
dea647f36a fix: font and size settings now apply 2025-10-05 03:23:45 +01:00
Gigi
8be57dea2c style: improve checkbox alignment and styling
- Fix checkbox alignment with flex display override
- Reduce checkbox size from 20px to 18px
- Add accent-color to match theme
- Improve text color and spacing
- All checkboxes now properly aligned
2025-10-05 03:20:09 +01:00
Gigi
14a429ca61 feat: replace font size dropdown with icon buttons
- Replace dropdown with visual 'A' buttons at different sizes
- Buttons show the actual size they represent
- Active state highlights selected size
- Consistent with view mode button pattern
- More intuitive and visual UX
2025-10-05 03:18:43 +01:00
Gigi
caf73b7c9f refactor: simplify setting label to 'Show highlights'
- Change 'Show highlight underlines' to 'Show highlights'
- More concise and clear
2025-10-05 03:17:06 +01:00
Gigi
915829e82c fix: make font size setting work in preview
- Change h3 font-size from 1.5rem to 1.5em to scale with parent
- Remove hardcoded font-size from preview paragraphs
- Now font size changes are properly reflected in the preview
2025-10-05 03:16:42 +01:00
Gigi
dd3203f34f refactor: remove loading state and show bookmarks as they arrive
- Remove loading state variable from Bookmarks component
- Remove 'Loading bookmarks...' screen
- Start with empty list and populate bookmarks in background
- Remove timeout and loading callbacks from fetchBookmarks
- Better UX: show UI immediately, bookmarks appear when ready
- Bookmarks.tsx now at 197 lines
2025-10-05 03:15:57 +01:00
Gigi
183af3a80c feat: add font size setting
- Add fontSize to UserSettings interface
- Add font size dropdown in Settings with options from 12px to 22px
- Apply font size to preview content instantly
- Set --reading-font-size CSS variable in Bookmarks when settings change
- Apply font-size variable to .reader-html and .reader-markdown
- Condense code in Bookmarks.tsx to stay under 210 lines (now at 207)
2025-10-05 03:13:31 +01:00
Gigi
3e441925e5 feat: close settings when opening an article
- Add setShowSettings(false) to handleSelectUrl
- Ensures settings view closes when user selects a bookmark to read
- File remains at 210 lines
2025-10-05 03:10:46 +01:00
Gigi
9a1efd5b18 fix: prevent duplicate highlight application
- Store original HTML in ref to prevent re-highlighting already highlighted content
- Separate highlight application from click handler attachment effects
- Remove onHighlightClick from highlight application dependencies
- Remove verbose console logging for cleaner code
- Highlights now apply correctly without stacking on top of each other
2025-10-05 03:09:59 +01:00
Gigi
af6538d577 refactor: reduce Bookmarks.tsx to exactly 210 lines
- Remove extra blank line between imports and type definition
- File now at exactly 210 lines
2025-10-05 03:07:29 +01:00
Gigi
0a78d19195 refactor: simplify Bookmarks.tsx to meet 210 line limit
- Remove verbose console.log statements
- Simplify handlers and remove unnecessary blank lines
- Condense font loading logic
- Keep code DRY and simple
- File now at exactly 210 lines
2025-10-05 03:06:36 +01:00
Gigi
25a1adaeaa feat: open highlights panel when clicking highlight in article
- Simple inline handler that opens panel if collapsed
- Sets selected highlight ID
- Clean, minimal implementation
2025-10-05 03:04:40 +01:00
Gigi
5c2c8f618c feat: auto-open highlights panel when clicking highlight in article
- Add handleHighlightClick that opens panel if collapsed
- Sets selected highlight ID to scroll to it in the panel
- Add console logging for debugging
- When user clicks highlight in article with panel closed, panel opens automatically
2025-10-05 03:02:56 +01:00
Gigi
726b8a9c10 Revert "feat: auto-open highlights panel when clicking a highlight"
This reverts commit b6edf8de73.
2025-10-05 03:00:03 +01:00
Gigi
b6edf8de73 feat: auto-open highlights panel when clicking a highlight
- Create handleHighlightClick handler that sets highlight ID and opens panel
- Automatically expand highlights sidebar if collapsed when highlight clicked
- Improves UX by ensuring highlights panel is visible when interacting with highlights
- Applied to both ContentPanel and HighlightsPanel click handlers
2025-10-05 02:58:29 +01:00
Gigi
e10ae00a1a refactor: organize settings into logical groups
- Create three sections: Reading & Display, Layout & Navigation, Startup Preferences
- Add section titles with consistent styling
- Group related settings together:
  - Reading & Display: font, highlight underlines, preview
  - Layout & Navigation: view mode, collapse behavior
  - Startup Preferences: initial sidebar states
- Add section title styling with border and uppercase text
- Better visual hierarchy and organization
2025-10-05 02:57:04 +01:00
Gigi
bb351ae35f feat: preview reflects show underlines setting
- Preview highlight dynamically shows/hides based on showUnderlines setting
- Users can see highlight appearance changes instantly
- Conditional className applied to preview highlight
2025-10-05 02:55:53 +01:00
Gigi
ad1e06c867 feat: add highlight example to preview
- Add highlighted text in preview using content-highlight class
- Shows how highlights appear with different fonts
- Helps users see complete reading experience before saving
2025-10-05 02:53:55 +01:00
Gigi
bf8dfe79dd feat: add live preview of reading font in settings
- Add preview section showing Lorem Ipsum passage
- Preview updates instantly when font is changed
- Load font dynamically for preview
- Style preview to match reader appearance
- Helps users see font changes before saving
2025-10-05 02:53:22 +01:00
Gigi
0ccad88dfd feat: add configurable reading font using Bunny Fonts
- Add readingFont setting to UserSettings interface
- Create fontLoader utility to load fonts from Bunny Fonts
- Add font selector dropdown in settings with popular reading fonts
- Use CSS variable --reading-font to apply font to reader content
- Support fonts: Inter, Lora, Merriweather, Open Sans, Roboto, Source Serif 4, Crimson Text, Libre Baskerville, PT Serif
- Fonts loaded from https://fonts.bunny.net/ (GDPR-friendly)
2025-10-05 02:52:21 +01:00
Gigi
20e9ba1675 style: inline default view mode label and buttons
- Put label and icon buttons on same line
- Remove background container from view mode buttons
- Add setting-inline and setting-buttons classes
- Clean, minimal inline layout without background styling
2025-10-05 02:49:55 +01:00
Gigi
85d3508190 fix: remove header bar styling from settings
- Remove background, border, and bar styling from settings header
- Keep simple header with title and close button on same line
- Match padding with content panel for proper alignment
- Clean, minimal header without visual container
2025-10-05 02:48:27 +01:00
Gigi
4cf0138706 style: align settings header with sidebar header bar
- Change settings-header to settings-header-bar class
- Match styling of sidebar-header-bar (background, border, padding)
- Reduce title font size to match sidebar style
- Adjust padding and spacing for consistent visual alignment
- Settings header now appears on same visual line as sidebar buttons
2025-10-05 02:46:59 +01:00
Gigi
d6e093b3bb refactor: use icon buttons for default view mode setting
- Replace dropdown select with icon-based view switcher
- Use same icons as sidebar header (list, grid, image)
- Add left-aligned view-mode-controls styling for settings
- Maintain consistent UI across view mode selectors
2025-10-05 02:44:58 +01:00
Gigi
6489714f33 style: left-align all settings text and controls
- Add text-align: left to settings view, header, and content
- Add justify-content: flex-start to checkbox labels
- Add flex-shrink: 0 to checkboxes to prevent squishing
- Ensure consistent left alignment throughout settings panel
2025-10-05 02:43:34 +01:00
Gigi
e2749b6a3c feat: collapse both sidepanels when opening settings
- Automatically collapse bookmarks sidebar when settings opened
- Automatically collapse highlights panel when settings opened
- Provides full-width settings view for better UX
2025-10-05 02:41:30 +01:00
Gigi
89e089ad25 refactor: render settings in main pane instead of as overlay
- Move Settings component from overlay to main pane
- Update Settings styling for inline display
- Conditionally render Settings or ContentPanel in main pane
- Remove overlay-specific styles and simplify layout
2025-10-05 02:40:38 +01:00