Skip to content

Add Search in Article, Open in Browser, and icon semantics updates#33

Merged
NateEaton merged 2 commits intomainfrom
claude/design-article-search-feature-dLaDY
Feb 7, 2026
Merged

Add Search in Article, Open in Browser, and icon semantics updates#33
NateEaton merged 2 commits intomainfrom
claude/design-article-search-feature-dLaDY

Conversation

@NateEaton
Copy link
Copy Markdown
Owner

Summary

This PR adds a "Search in Article" feature to the reading view, enabling in-content text search with match highlighting and navigation. It also introduces an "Open in Browser" menu option and updates icon semantics across the reading view menu and list view cards to properly distinguish between in-app content viewing and external browser opening.

Key Changes

  • Search in Article feature: New overflow menu option for Article-type bookmarks in Reader mode that enables real-time text search with yellow/orange match highlighting and up/down navigation between matches. Implemented via JavaScript bridge to the WebView with a dedicated search toolbar replacing the normal top app bar.

  • Open in Browser action: New menu item that opens the bookmark URL in the device's default browser (via Intent(ACTION_VIEW)), distinct from the in-app Original view.

  • Icon semantics update:

    • Reading view "View Original" icon changed from external-link to globe (Icons.Filled.Language) to clarify it opens content in-app
    • List view cards now show two icon buttons: globe (View Original in-app) and external-link (Open in Browser)
    • Applied to all three card layouts: Mosaic, Grid, and Compact
  • Menu restructuring: Reordered reading view overflow menu with new items and updated labels ("Mark Read" → "Is Read")

  • Conditional visibility:

    • Search in Article: hidden for Photo/Video types, disabled in Original mode or when article content is empty
    • All other menu items remain visible/enabled as before

Implementation Details

  • State management: New ArticleSearchState in BookmarkDetailViewModel tracking active status, query, total matches, and current match index
  • WebView JavaScript bridge: Helper functions to inject highlight spans, navigate between matches, and clear highlights. CSS classes .mydeck-search-match (yellow) and .mydeck-search-current (orange) added to HTML templates
  • Debounced search: Query changes debounced at ~300ms to avoid excessive DOM manipulation
  • JavaScript enablement: Article WebViews now have JavaScript enabled (safe, as Sakura templates contain no scripts)
  • Search toolbar: New extracted composable modeled after existing list search bar with back arrow, search field, match counter, and up/down navigation buttons

Files Modified/Created

  • BookmarkDetailScreen.kt — search toolbar UI, menu restructuring, WebView JS integration
  • BookmarkDetailViewModel.kt — search state and logic
  • BookmarkCard.kt — dual icon buttons on all card layouts
  • BookmarkListScreen.kt & BookmarkListViewModel.kt — Open in Browser callback wiring
  • BookmarkListItem.kt — add URL field if needed
  • HTML templates — search highlight CSS injection
  • strings.xml — new/updated string resources
  • New: ArticleSearchBar.kt — extracted search toolbar composable
  • New: WebViewSearchBridge.kt — JavaScript generation and WebView evaluation helpers

Testing Recommendations

  • Verify Search in Article hidden for Photo/Video types and greyed out in Original mode
  • Test search across light/dark/sepia themes and various zoom levels
  • Confirm highlights clear on search exit and theme changes
  • Verify Open in Browser launches standalone browser (not Custom Tab)
  • Validate card icons: globe = in-app Original view, external-link = browser
  • Test match counter wrap-around and special character handling in queries

https://claude.ai/code/session_01FyheUqdg2xGH9J9S2W4HFH

Covers in-article text search with highlight navigation,
WebView JS bridge, and overflow menu integration for Article types.

https://claude.ai/code/session_01FyheUqdg2xGH9J9S2W4HFH
- Reorder overflow menu per spec (text size, view toggle, search,
  is read, open in browser, share, delete)
- Add Open in Browser menu item (ACTION_VIEW intent)
- Change View Original icon from OpenInNew to Language (globe)
- Split card icon into globe (in-app original) + external link (browser)
- Simplify search scope: READER mode only, disabled in Original
- Hide search entirely for Photo/Video types

https://claude.ai/code/session_01FyheUqdg2xGH9J9S2W4HFH
@NateEaton NateEaton marked this pull request as ready for review February 7, 2026 05:46
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@NateEaton NateEaton merged commit f79607f into main Feb 7, 2026
3 checks passed
@NateEaton NateEaton deleted the claude/design-article-search-feature-dLaDY branch February 20, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants