Skip to content

fix: present manga tools sheets from the Form - #1329

Merged
everpcpc merged 3 commits into
mainfrom
claude/pr-357-359-review-euj9zm
Nov 8, 2026
Merged

everpcpc merged 3 commits into
mainfrom
claude/pr-357-359-review-euj9zm

Conversation

@everpcpc

@everpcpc everpcpc commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Two UI bugs reported from iOS device testing.

Sheets opening and closing on the first tap

On the Manga Tools page, the Panel Mode Model and Detection Model sheets closed right after opening on the first tap; the second tap worked.

  • Cause:
    • The translation sheets sat on the Group of sections in MangaTranslationSettingsContent.
    • The panel model sheet sat on the Section inside the Form.
    • SwiftUI copies such modifiers onto every row, so several sheets shared one binding and fought over it.
  • Fix:
    • New MangaToolsSettingsModel (@Observable) holds the sheet (MangaToolsSheet: providers, a model role, the panel model) and the loaded provider and model archives.
    • Both Forms that host the sections, MangaToolsSettingsView and the in-reader MangaTranslationSettingsView, own one model and apply .mangaToolsSheets(model:). That modifier presents the single sheet and reloads the configuration on appear and on dismiss.
    • The section views take the model and only set model.sheet.
    • No visual change.
  • Conventions: the rule (presentation modifiers go on the Form, never on a Group or Section inside it) is recorded in the repo-conventions Settings Pages section.

Unreadable Manage Model button in dark mode

The Manage Model button in the "Panel Mode Model Required" prompt (DivinaReaderView) used .buttonStyle(.borderedProminent) directly, so with the white accent the label was white on white. It now uses .adaptiveButtonStyle(.borderedProminent), which pairs the tint and foreground assets.

AGENTS.md gains rule 26: style buttons with .adaptiveButtonStyle(_:), never .buttonStyle(...) directly. A raw style is allowed only where no adaptive case fits, with a comment saying why. Existing raw uses are not migrated here.

Includes build 682.

Testing

CI builds iOS, macOS and tvOS; the sheet fix still needs a device check.

The model and provider sheets sat on a Group of sections, and the panel
model sheet on a Section inside the Form. SwiftUI copies such modifiers
onto every row, so several sheets shared one binding and the first tap
opened and closed the sheet at once. MangaToolsSettingsModel now holds
the sheet and the loaded configuration, and the Form presents it once.

The Manage Model button in the panel model prompt also uses the
adaptive prominent style, so its label stays readable in dark mode.

Claude-Session: https://claude.ai/code/session_01W7dP3MknpRju7QRKjYpmFX
Raw button styles keep slipping in, and a raw borderedProminent is
unreadable in dark mode with the white accent.

Claude-Session: https://claude.ai/code/session_01W7dP3MknpRju7QRKjYpmFX
@everpcpc
everpcpc merged commit ba02a46 into main Nov 8, 2026
3 checks passed
@everpcpc
everpcpc deleted the claude/pr-357-359-review-euj9zm branch November 8, 2026 14:58
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