Skip to content

Conversation

graycreate
Copy link
Member

Summary

  • Fixed WebView background color mismatch in dark mode for post detail content
  • Ensures seamless visual integration between WebView and native UI

Problem

The WebView content area in post details had a darker background (#111214) compared to the app's ItemBackground color (#1C1C1E), creating a visual inconsistency in dark mode.

Solution

  • Updated WebView UIColor background to match ItemBackground.colorset (#1C1C1E)
  • Updated CSS dark mode backgrounds to use the same color
  • Adjusted subtle/blockquote backgrounds to #141416 for proper contrast hierarchy

Test plan

  • Verified WebView background matches app background in dark mode
  • Tested post content display with various content types (text, code, quotes)
  • Confirmed no visual issues in light mode
  • Checked that subtle content blocks have appropriate contrast

🤖 Generated with Claude Code

… mode

- Updated WebView background from #111214 to #1C1C1E to match ItemBackground.colorset
- Updated CSS dark mode backgrounds to use consistent colors
- Changed subtle/blockquote backgrounds to #141416 for better contrast hierarchy
- Ensures WebView content blends seamlessly with the app's UI in dark mode
@Copilot Copilot AI review requested due to automatic review settings September 14, 2025 11:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes WebView background color inconsistency in dark mode by updating both CSS and Swift code to use matching background colors. The changes ensure visual consistency between WebView content and native UI elements in the app's dark mode.

  • Updates WebView background color from #111214 to #1C1C1E to match app's ItemBackground color
  • Adjusts CSS dark mode backgrounds for content areas and subtle elements
  • Updates Swift UIColor values to use hex-based color definitions matching the CSS changes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
V2er/www/v2er.css Updates dark mode background colors for topic content, subtle divs, and blockquotes
V2er/View/FeedDetail/HtmlView.swift Updates WebView background color calculations to match new hex color scheme

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +73 to +74
webView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
webView.scrollView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The color definition is duplicated across multiple lines. Consider extracting this into a constant or computed property to improve maintainability and reduce duplication.

Copilot uses AI. Check for mistakes.

Comment on lines +88 to +89
webView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
webView.scrollView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same color definition duplicated from the makeUIView method. The repetition increases maintenance burden when color values need to be updated.

Copilot uses AI. Check for mistakes.

@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

@graycreate graycreate merged commit c4c2f7b into main Sep 14, 2025
6 checks passed
@graycreate graycreate deleted the bugfix/webview-dark-mode-background branch September 14, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant