Commit Graph

202 Commits

Author SHA1 Message Date
a4ebe77973 feat: add PlatformWidget extension target
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
2026-04-04 11:19:18 -05:00
Yusuf Suleman
c13259c2b5 polish: depth, contrast, and layering refinements
All checks were successful
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Security Checks / dependency-audit (push) Successful in 13s
1. Background — reduced warmth, more neutral:
   Dark:  #0e0d0b → #0d0d0b (less warm, more true black)
   Light: #EDE6DA → #EBE6DE (cooler sand, less yellow)

2. Cards — increased elevation:
   Shadow: 0.04/6/2 → 0.08/8/3 (more visible lift)
   Spacing: 12pt → 14pt between cards, 4pt → 8pt top padding

3. Text — more neutral for glass legibility:
   Primary light: 0.12 → 0.10 (darker)
   Secondary: warmer gray → neutral gray (0.40 uniform)
   Tertiary: warmer → neutral (0.58 uniform)

4. Accent — slightly deeper in light mode:
   #8B6914 → #805E0F (more contrast against glass)

5. Dark mode accent — slightly brighter:
   0.78/0.62/0.25 → 0.82/0.65/0.28

All changes are color/shadow/spacing only. No layout or
architectural changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:54:32 -05:00
Yusuf Suleman
f4b527e70b fix: increase surface contrast — cards now clearly separate from background
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Dark mode:
  Canvas: #1a1714 → #0e0d0b (deeper black, more separation)
  Card:   #26231f → #1e1b17 (warmer, 7% brighter than bg)

Light mode:
  Canvas: #F5EFE6 → #EDE6DA (cooler sand, slightly darker)
  Card:   #FFFCF8 → #FFFFFF (clean white, max contrast)

Both modes now have ~7% brightness gap + temperature contrast
(warm bg, cleaner card). Cards visually float without needing
borders.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:40:45 -05:00
Yusuf Suleman
c74f36a94d fix: widen speed gaps — Slow 1.0x, Med 2.0x, Fast 3.5x (was 1.5/1.75/2.0)
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
2026-04-04 10:31:55 -05:00
Yusuf Suleman
01c63d69d0 feat: auto-scroll speed cycles via tab bar button (Slow/Med/Fast)
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Tab bar action button cycles through speeds on each tap:
- ▶ (play) → tap → Slow (1.5x, hare icon)
- Slow → tap → Med (1.75x, walk icon)
- Med → tap → Fast (2.0x, bolt icon)
- Fast → tap → back to Slow

Touch feed to stop → icon returns to ▶

Removed speed controls from Reader toolbar — all speed control
is now in the single tab bar button. Clean, no overlays.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:28:03 -05:00
Yusuf Suleman
e0ae9cb95f fix: inline title (no large title drop) + restore canvas background
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 3s
Security Checks / dockerfile-lint (push) Successful in 4s
1. .navigationBarTitleDisplayMode(.inline) — title stays at top
2. .background(Color.canvas) — restores warm cream background

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:11:09 -05:00
Yusuf Suleman
0f1a35ab84 simplify: remove sub-tabs, starred, feed filter chips from Reader
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Reader now shows only unread entries. Removed:
- Unread/Starred/All sub-tab selector
- Feed filter chip bar (categories)
- All related state (selectedSubTab) and helpers

Glass nav bar shows: "Reader" title + "74 unread" subtitle
Trailing toolbar: grid/list toggle + ellipsis menu
Auto-scroll: speed controls in leading toolbar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:07:40 -05:00
Yusuf Suleman
d75fb870d7 feat: Liquid Glass navigation bar for Reader (iOS 26 standard APIs)
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Removed .navigationBarHidden(true) and all custom header layout.
Now uses standard iOS 26 navigation APIs that get Liquid Glass free:

- .navigationTitle("Reader") + .navigationSubtitle("74 unread")
- ToolbarItemGroup for sub-tabs (Unread/Starred/All) on leading
- ToolbarSpacer between groups
- ToolbarItemGroup for grid/list + menu on trailing
- Feed filter chips in .bottomBar toolbar
- When auto-scrolling: toolbar swaps to speed controls

The glass nav bar is translucent — content scrolls underneath.
Collapses to inline glass pill on scroll (system behavior).
No custom backgrounds, no custom layout — all system-managed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:03:58 -05:00
Yusuf Suleman
61cd78e080 feat: speed controls in collapsed tab bar via safeAreaBar
All checks were successful
Security Checks / dependency-audit (push) Successful in 27s
Security Checks / secret-scanning (push) Successful in 7s
Security Checks / dockerfile-lint (push) Successful in 6s
Uses .safeAreaBar(edge: .bottom) on the Reader content — the iOS 26
API that places content in the collapsed tab bar area, same position
as the Now Playing mini bar. Speed controls [ - ] 1.50x [ + ] appear
in the glass bar when auto-scrolling.

Removed the floating speed pill overlay from ContentView.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:00:42 -05:00
Yusuf Suleman
e37444c62e fix: speed pill and feedback in same VStack — no more guessing position
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Speed pill and feedback button were in separate VStacks with
independent absolute padding, causing misalignment. Now they share
one VStack with .padding(.bottom, 70) at the container level.
The speed pill sits directly above the tab bar area, positioned
relative to the same anchor as all other bottom controls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:55:30 -05:00
Yusuf Suleman
a452c0d4f2 fix: move speed pill up to not overlap cards (padding.bottom 50)
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
2026-04-04 08:52:14 -05:00
Yusuf Suleman
416a6ed3f8 fix: adjust speed pill position — was clipped at bottom, now 16pt above safe area
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
2026-04-04 08:47:07 -05:00
Yusuf Suleman
a39e0377b5 fix: move speed controls into tab bar area (tab bar hidden during scroll)
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:43:52 -05:00
Yusuf Suleman
63b6027902 fix: move speed controls to bottom of screen, use regularMaterial
Some checks failed
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Has been cancelled
Speed pill was floating mid-screen (padding.bottom 90). Moved to
bottom (padding.bottom 8) to sit just above the tab bar area.
Switched from ultraThinMaterial to regularMaterial for better
Liquid Glass look with more opacity and stronger blur.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:43:33 -05:00
Yusuf Suleman
17d10ec4c1 fix: eliminate auto-scroll jitter by deferring mark-as-read visual updates
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
ROOT CAUSE (confirmed by instrumentation):
Every markRead during auto-scroll mutated entries[idx].status,
causing SwiftUI to re-render the row (bold→regular, dot removed).
This changed card height, causing contentSize jumps of 10-128pt
per entry — visible as jitter.

FIX: During auto-scroll, collect entry IDs in deferredReadIDs
instead of mutating entries array. When auto-scroll stops,
flushDeferredReads() applies all status changes at once and
sends a single batched API call.

Manual scroll still marks immediately (no deferral needed since
the user controls the scroll position).

Removed all debug instrumentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:27:37 -05:00
Yusuf Suleman
39b9303918 debug: auto-scroll jitter instrumentation — tick timing, contentSize, loadMore, markRead
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
2026-04-04 08:19:30 -05:00
Yusuf Suleman
976469f5fe revert: remove fake delegate calls for tab bar minimize
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Calling scrollViewWillBeginDragging/DidEndDragging on the delegate
didn't trigger tabBarMinimizeBehavior — iOS 26 likely tracks actual
touch events, not delegate calls. Reverted to avoid side effects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:08:55 -05:00
Yusuf Suleman
a82ae267b6 fix: tab bar collapses during auto-scroll
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 5s
tabBarMinimizeBehavior needs scrollViewWillBeginDragging to recognize
a scroll session. Now ScrollViewDriver calls it on the original
delegate when auto-scroll starts, and scrollViewDidEndDragging +
scrollViewDidEndDecelerating when it stops.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:03:23 -05:00
Yusuf Suleman
395cca08dd fix: action button on Reader now toggles auto-scroll (not food assistant)
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Bug: when action tab (value=3) was tapped, selectedTab was already 3
by the time handleActionTap ran. The check 'if selectedTab == 2'
always failed, falling through to food assistant.

Fix: use onChange(of: selectedTab) oldValue to capture which tab the
user was on BEFORE tapping the action button. Pass that to
handleActionTap(from:). If from Reader (2), toggle auto-scroll.
If from Home/Fitness, open food assistant.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:00:43 -05:00
Yusuf Suleman
e2fc87b6aa feat: Tab(role: .search) with context-dependent action per tab
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Single separated circle in tab bar (like Photos search icon):
- Home/Fitness: shows + icon, taps opens food assistant
- Reader idle: shows play icon, taps starts auto-scroll
- Reader playing: shows pause icon, taps stops auto-scroll

Icon updates dynamically via computed actionIcon property.
handleActionTap() routes the tap based on selectedTab.
After action, selectedTab returns to the previous tab (doesn't
stay on the invisible "action" tab).

Speed controls still appear as glass capsule overlay when playing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:55:50 -05:00
8a8f865702 xcode update
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
2026-04-04 07:42:56 -05:00
144f24b7a0 resolve pbxproj conflict 2026-04-04 07:42:56 -05:00
Yusuf Suleman
e9373ceac3 fix: context-dependent FAB — play/pause on Reader, + on other tabs
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Removed Tab(role: .search) — it was always visible on all tabs.
Now the floating action button changes based on selected tab:

- Home/Fitness: FAB (+) → opens food assistant (same as before)
- Reader: Play/Pause circle → toggles auto-scroll
  - Idle: play.fill icon, warm accent background
  - Playing: pause.fill icon, red background
  - Tapping toggles between play/pause

Speed controls appear as glass capsule above the FAB when playing.
Auto-scroll stops when switching away from Reader tab.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:41:50 -05:00
Yusuf Suleman
1205ac38d0 fix: resolve iOS 26 deprecation warnings
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
- Text '+' concatenation → HStack (MealSectionView)
- UIScreen.main → UIWindowScene.screen (EntryListView, ArticleWebView)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:39:41 -05:00
Yusuf Suleman
640d816690 chore: bump deployment target to iOS 26.0
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Both devices run iPhone 17 / iOS 26. Removes availability wrappers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:37:39 -05:00
Yusuf Suleman
8fadb3f3e9 feat: auto-scroll play button in tab bar using Tab(role: .search)
All checks were successful
Security Checks / dockerfile-lint (push) Successful in 4s
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Migrated to new Tab API (iOS 18+). The auto-scroll play button
uses Tab(role: .search) with systemImage: "play.fill" — this gives
the separated circular placement on the trailing side of the tab
bar, identical to the Photos app search icon.

Tapping the play icon:
- Switches to Reader tab
- Starts auto-scroll

When playing: a Liquid Glass speed control capsule appears above
the tab bar with [ - ] 1.00x [ + ] [ stop ].

Removed the old floating glass pill implementation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:34:35 -05:00
Yusuf Suleman
5d2262e17a feat: auto-scroll play button at tab bar level (like Photos search icon)
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Moved auto-scroll control from ReaderTabView to MainTabView so it
sits at the tab bar level, trailing side — matching the iOS Photos
search icon placement.

Idle: 48px glass circle with play icon (bottom-right, tab bar row)
Playing: expands to capsule with [ - ] 1.00x [ + ] [ stop ]
Spring animation between states.

Grid/list toggle and ellipsis menu moved inline to the sub-tab
header row (next to Unread/Starred/All) so they're always visible
without needing a toolbar.

ReaderTabView now receives isAutoScrolling and scrollSpeed as
bindings from MainTabView.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:28:12 -05:00
Yusuf Suleman
7815f56b4f fix: hide FAB on Reader tab, fix tab bar collapse during auto-scroll, position glass bar bottom-right
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 5s
Security Checks / dockerfile-lint (push) Successful in 4s
1. FAB hidden when selectedTab == 2 (Reader) — no plus button
   on Reader since it's for food logging

2. Auto-scroll now notifies original UIScrollViewDelegate via
   scrollViewDidScroll after each contentOffset change — this
   triggers tabBarMinimizeBehavior so the tab bar collapses
   during auto-scroll just like manual scrolling

3. Glass control bar positioned bottom-right (like Photos search
   icon) instead of bottom-center

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:22:14 -05:00
Yusuf Suleman
1b23525493 feat: Liquid Glass control bar for Reader (replaces hidden toolbar)
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
Floating glass pill above the tab bar with .ultraThinMaterial:

Idle state: [ ▶ ] [ grid/list ] [ ⋯ ]
- Play: starts auto-scroll
- Grid/list: toggles card/list view
- Ellipsis menu: mark all read, refresh, manage feeds, add feed

Playing state: [ - ] 1.00x [ + ] | [ ■ ]
- Speed adjustment in 0.25 increments (0.25x–3.0x)
- Stop button (red)
- Animated spring transition between states

Removed .navigationBarHidden(true) toolbar items — all controls
now in the glass bar. Nav bar stays hidden (no title needed).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 07:12:42 -05:00
Yusuf Suleman
85c3bb7a42 feat: Phase 1 auto-scroll engine for Reader feed
All checks were successful
Security Checks / dependency-audit (push) Successful in 23s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
ENGINE (ScrollViewDriver.swift):
- UIViewRepresentable placed inside ScrollView (zero size)
- Finds parent UIScrollView via view hierarchy traversal
- CADisplayLink at 60fps drives contentOffset.y smoothly
- Speed: 1.0x = 60pt/sec, adjustable 0.25x–3.0x in 0.25 steps
- User touch detection: intercepts UIScrollViewDelegate
  scrollViewWillBeginDragging → stops auto-scroll immediately
- Stops at bottom (contentOffset >= maxOffset)
- Forwards all delegate methods to SwiftUI's original delegate

INTEGRATION (EntryListView):
- Accepts @Binding isAutoScrolling + scrollSpeed
- ScrollViewDriver placed as first child in ScrollView
- Auto-scroll stops on: user touch, navigation back (onAppear),
  filter change, sub-tab change, reaching bottom

CONTROLS (ReaderTabView — temporary, Phase 1):
- Play/Stop button in toolbar (play.fill / stop.fill)
- When playing: [-] speed [+] controls appear inline
- Speed shown as "1.00x" with monospacedDigit

MARK-AS-READ:
- Auto-scroll drives real UIScrollView contentOffset
- This moves LazyVStack rows, triggering their GeometryReader
  onChange callbacks — the existing mark-as-read system fires
  naturally with no special case or bypass needed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 06:51:08 -05:00
Yusuf Suleman
6ed7f8a230 fix: restore WKWebView alpha to 1 when reparenting to article container
All checks were successful
Security Checks / dependency-audit (push) Successful in 15s
Security Checks / secret-scanning (push) Successful in 3s
Security Checks / dockerfile-lint (push) Successful in 4s
The GPU warmup set webView.alpha = 0 to keep it invisible while
attached to the window. makeUIView reparents it to the article
container but never restored alpha — articles rendered invisibly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 06:15:59 -05:00
Yusuf Suleman
db77a6d34d perf: re-warm WebKit GPU on Reader tab appear if idle >60s
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
GPU process can exit due to idle timeout if user waits before opening
Reader. reWarmIfNeeded() checks elapsed time since last warm — if >60s,
re-attaches WKWebView to window and loads minimal HTML to restart the
GPU process. Called on ReaderTabView.onAppear.

No timers, no keep-alive loops. Just a timestamp check on tab appear.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:49:26 -05:00
Yusuf Suleman
1579633da0 fix: keep WKWebView attached to window to prevent GPU process idle exit
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
The GPU process was exiting due to idle timeout between warmup and
first article open. Now the WKWebView stays attached to the window
(alpha=0, invisible) until first article use. makeUIView reparents
it to the article container via removeFromSuperview + addSubview.

Also: removed all debug logging (warmup, article open, WebView timing).

Confirmed by instrumentation:
- GPU process launches during warmup (1.3s, background)
- First article open: 22ms total, WebView finish: 3ms
- No user-visible freeze

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:48:04 -05:00
Yusuf Suleman
127da8feaa perf: force GPU process launch during warmup by attaching WKWebView to window
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
THEORY: WKWebView at frame .zero or detached from window skips GPU
compositor init. First real display triggers GPU process launch (~3s).
FIX: Create WKWebView at screen bounds, attach to key window (alpha=0)
during warmup. WebKit launches GPU process while user is on Home tab.
Remove from window after 2s (GPU process stays alive).

Also: ensureAttachedToWindow() fallback if init runs before window
exists. Called from ContentView.task where window is guaranteed.

Added 1x1 transparent GIF in warmup HTML to force image decoder init.

Kept all debug logging for verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:44:48 -05:00
Yusuf Suleman
62f9a2503a debug: timestamped logging for first-article-open stall investigation
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
2026-04-04 00:35:53 -05:00
Yusuf Suleman
7938034d85 perf: lazy async image decoding + max-height to prevent scroll freeze
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 5s
ROOT CAUSE: Articles from sites like onemileatatime.com serve WebP
images with .jpeg extensions. WebKit attempts JPEG decode, fails,
retries as WebP — the retry loop blocks the compositor thread during
scroll, causing ~1s freezes per image.

FIX 1 — Image attributes (ArticleHTMLBuilder.optimizeImages):
Regex injects loading="lazy" decoding="async" on all <img> tags
that don't already have loading= set. This tells WebKit to:
- decode images off the main/compositor thread (decoding=async)
- only decode when approaching viewport (loading=lazy)

FIX 2 — CSS max-height:
img { max-height: 600px; object-fit: contain; }
Limits decoded image buffer size. A 1200x900 image still displays
at full width but WebKit doesn't need to composite oversized tiles.

Both fixes are content-rendering optimizations only — no changes
to WKWebView architecture, scrolling model, or layout system.

Also marked Atmos Rewards articles as unread for testing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:30:37 -05:00
Yusuf Suleman
cb7907ef33 fix: scroll mark-as-read — three bugs found from round 3 logs
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
LOG EVIDENCE:
1. notVisible: wasVisible never set for entries already on screen
   at list load. Removed wasVisible guard — trackingActive (100pt
   scroll) is sufficient protection.

2. aboveVP: maxY never goes below 0. LazyVStack destroys views at
   ~maxY=0. Changed threshold from maxY<0 to maxY<30 (nearly off).

3. notDown flickering: per-entry deltas are ~1pt, causing direction
   to flip between down/not-down on every callback. Made direction
   sticky: scrollingDown stays true until 30pt of cumulative upward
   scroll is detected. Prevents jitter from sub-pixel noise.

Removed debug logging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:19:53 -05:00
Yusuf Suleman
f0717ce347 debug: round 3 — log which guard fails when entry near top
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
2026-04-04 00:16:09 -05:00
Yusuf Suleman
63123c187c fix: scroll mark-as-read — delta filter and threshold tuned from logs
All checks were successful
Security Checks / dockerfile-lint (push) Successful in 4s
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
EVIDENCE (from xcode.txt):
- down=false ALWAYS: per-entry deltas are ~1-2pt per callback,
  but filter required >2pt. Every delta was rejected.
- cumDown stuck at 129: threshold was max(100, 956*0.2) = 191.
  With most deltas rejected, cumulative barely grew.

FIXES:
1. Delta filter: >2pt → >0.5pt for direction detection.
   Cumulative accumulation accepts any delta >0 (no filter).
   Per-entry callbacks deliver small deltas — filtering at 2pt
   discarded virtually all genuine scroll events.

2. Threshold: removed 20% viewport scaling, fixed at 100pt.
   The scaling made sense for a global offset tracker (large
   deltas), not per-entry tracking (small deltas).

Removed debug logging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:14:31 -05:00
Yusuf Suleman
85a38705ec debug: add scroll tracking logs round 2
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 3s
Security Checks / dockerfile-lint (push) Successful in 4s
2026-04-04 00:11:12 -05:00
Yusuf Suleman
78ee06695b fix: scroll direction check always failed — read prevMinY before write
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Bug: lastKnownMinY[entryId] was set to newMinY on line 83, then
read back on line 97 to check direction. Since it was just set to
newMinY, the check (lastKnownMinY[entryId] <= newMinY) was always
true, making isMovingUp always true, so the guard always failed.

Fix: Read prevMinY BEFORE writing newMinY. Compute isScrollingDown
from the delta between prev and new. Use that boolean in the guard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:08:57 -05:00
Yusuf Suleman
6cff4a9036 fix: scroll mark-as-read — move all tracking to per-row GeometryReader
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
ROOT CAUSE (confirmed by instrumentation):
1. viewportHeight was 0 — background GeometryReader onAppear fired
   before ScrollView layout, never updated. Visibility ratio was
   always 0.00, so wasVisible was never populated.
2. cumulativeDown was 0 — PreferenceKey + onPreferenceChange on the
   zero-height anchor never delivered scroll offset updates.
3. Both tracking mechanisms were dead. Only per-row onChange fired.

FIX: Removed dead PreferenceKey scroll tracker and dead viewport
background GeometryReader. All tracking now lives in the per-row
GeometryReader onChange(of: frame.minY), which the logs confirmed
fires reliably:

- Scroll direction: computed from delta between current and previous
  minY for each entry (stored in lastKnownMinY dictionary)
- Cumulative scroll: accumulated from positive deltas (>2pt filter)
- Activation: requires cumulative downward scroll > threshold
- Visibility: computed using UIScreen.main.bounds.height (reliable,
  doesn't depend on layout timing)
- Mark condition: trackingActive + moving down + unread + was visible
  + maxY < 0 (fully above viewport)

Navigation protection preserved: onAppear resets trackingActive,
cumulativeDown, and lastKnownMinY.

Removed debug instrumentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:06:24 -05:00
Yusuf Suleman
93bdffaae5 debug: add scroll mark-as-read instrumentation for first 3 entries
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
Temporary logging to identify which guard condition prevents marking.
Logs visibility ratio, scroll state, and failure reasons for entries
that are above viewport but not being marked. Will remove after fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:01:58 -05:00
Yusuf Suleman
cd64255632 fix: scroll mark-as-read crossing event missed by LazyVStack recycling
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 3s
ROOT CAUSE: The exact crossing condition (oldMaxY >= 0 && newMaxY < 0)
required onChange to fire at the exact moment maxY crosses zero. But
LazyVStack recycles views when they scroll off-screen, destroying the
GeometryReader before the crossing event is delivered. The entry goes
from maxY=15 to being recycled — onChange never sees maxY go negative.

FIX: Replace exact crossing with position check (newMaxY < 0). The
entry just needs to be fully above the viewport. The other 5 guards
prevent false positives:
  1. trackingActive (scrolled past threshold)
  2. isScrollingDown
  3. !entry.isRead
  4. !markedByScroll (dedup)
  5. wasVisible (was >=50% visible)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:58:31 -05:00
Yusuf Suleman
99ad307103 feat: hide Reader tab for Madiha (user ID 4)
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Madiha sees only Home + Fitness tabs (same as web dashboard).
Reader tab, pre-warm, and data pre-fetch all skipped for her login.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:50:49 -05:00
Yusuf Suleman
1f32e5436e refine: scroll mark-as-read with visibility, dynamic threshold, stable deltas
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
1. Visibility requirement (new condition 5):
   - Tracks max visible ratio per entry via GeometryReader
   - Entry must have been >=50% visible at some point to qualify
   - Prevents marking entries that were never genuinely seen
   - Uses wasVisible set, populated by onChange(of: minY)

2. Dynamic activation threshold:
   - max(100pt, 20% of viewport height)
   - Taller screens (iPad) require proportionally more scroll
   - Measured via background GeometryReader on ScrollView

3. Stabilized scroll direction:
   - Ignores micro deltas <2pt (was 1pt)
   - Filters layout noise, rubber-banding, and momentum artifacts

Existing protections preserved:
   - trackingActive reset on onAppear (navigation protection)
   - downward-only marking
   - crossing detection (oldMaxY >= 0, newMaxY < 0)
   - markedByScroll dedup set

6 conditions must ALL be true to mark an entry:
   1. trackingActive (scrolled past threshold)
   2. isScrollingDown
   3. !entry.isRead
   4. !markedByScroll.contains(id)
   5. wasVisible.contains(id) — was >=50% visible
   6. bottom edge crossed above viewport

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:18:53 -05:00
Yusuf Suleman
532a071715 feat: scroll-based mark-as-read with geometry tracking + navigation protection
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Uses GeometryReader + coordinate space to track entry positions —
NOT onAppear/onDisappear.

How it works:
1. ScrollView has a named coordinate space ("readerScroll")
2. Invisible anchor at top measures scroll offset via PreferenceKey
3. Each entry row has a background GeometryReader that tracks its
   frame in the scroll coordinate space
4. onChange(of: maxY) detects when an entry's bottom edge crosses
   above the viewport top (oldMaxY >= 0 → newMaxY < 0)
5. Entry is marked read only when ALL conditions are true:
   - trackingActive (user scrolled down >100pt)
   - isScrollingDown (current direction is down)
   - entry is unread
   - entry hasn't been marked by scroll already
   - entry's bottom edge just crossed above viewport

Navigation protection:
- onAppear resets trackingActive = false and cumulativeDown = 0
- When returning from an article, tracking is suspended
- User must scroll down 100pt before tracking reactivates
- This prevents all visible entries from being marked read on
  navigation back (they were already below viewport, not crossing)
- Scrolling up never marks anything (isScrollingDown = false)

State updates are local-first (immediate) with background API sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:04:32 -05:00
Yusuf Suleman
343abb0a80 perf: warm WebKit rendering pipeline with realistic HTML template
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s
Empty HTML warmup only spun up the WebContent process. The first
real article still paid ~3s for CSS parsing, font measurement,
layout engine init, and compositing pipeline startup.

Now ArticleRenderer.init loads the full ArticleHTMLBuilder template
with sample content covering all styled elements (paragraphs,
headings, blockquotes, code blocks). WebKit performs real rendering
during app launch while the user is on Home/Fitness. By the time
they open the first article, CSS is parsed, fonts are measured,
and the pipeline is warm — the first article renders as fast as
subsequent ones.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:54:36 -05:00
Yusuf Suleman
c0078adeb7 fix: synchronous optimistic read-state on article open
All checks were successful
Security Checks / dockerfile-lint (push) Successful in 4s
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
The local entries mutation now runs synchronously at the top of
.task, before any Task {} or await:

  1. vm.entries[idx].status = "read"  ← synchronous, immediate
  2. currentEntry syncs from mutated array  ← immediate
  3. Task { api.markEntries + getCounters }  ← background
  4. await getEntry  ← content fetch, merge preserves local status

Previously markAsRead was wrapped in Task {} (fire-and-forget),
which SCHEDULED the mutation but didn't execute it until the main
actor yielded. Line 2 read stale state because the mutation hadn't
run yet.

Now the @Observable array mutation happens before any async work,
so the ForEach row re-renders on the same run loop — the list
shows "read" even during the push animation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:13:56 -05:00
Yusuf Suleman
415b125fb7 refactor: simplify article toolbar to Save to Brain only + tappable title
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 5s
Security Checks / dockerfile-lint (push) Successful in 4s
Toolbar:
- Removed star, read/unread, and ellipsis menu
- Single "Save to Brain" button (brain icon, turns green when saved)

Open original article:
- Title in HTML header is now a tappable link (when URL exists)
- Subtle ↗ icon after title indicates external link
- Tap opens in Safari via existing WKNavigationDelegate link handler
- No accidental triggers: styled as text link, not a button
- Active state dims to 0.6 opacity for tap feedback
- Dark mode: title link inherits text color (not accent)

No floating buttons added. No architecture changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:01:16 -05:00