Skip to content

fix: harden BBCode link interactions#77

Merged
everpcpc merged 2 commits intobangumi:mainfrom
everpcpc:codex/bbcode-link-routing-crash-fix
Apr 11, 2026
Merged

fix: harden BBCode link interactions#77
everpcpc merged 2 commits intobangumi:mainfrom
everpcpc:codex/bbcode-link-routing-crash-fix

Conversation

@everpcpc
Copy link
Copy Markdown
Contributor

Problem

The BBCode UIKit renderer could crash when a read-only text view contained both rich links and attachments, because link metadata was being applied across attachment ranges and the view could enter the system text-drag path. In the same area, BBCode links were bypassing the app routing layer and opening directly in the browser.

Approach

Limit link attributes to non-attachment text ranges, disable text drag on read-only BBCode text blocks, and move link handling to the iOS 17 text item primary action delegate. The SwiftUI host now injects openURL into the UIKit renderer so BBCode links follow the existing in-app URL handling path instead of jumping straight to Safari.

Scope

  • Fix BBCode attributed text link rendering around attachments
  • Route BBCode text links through the host app URL handler, including nested quote/list content
  • Remove the obsolete WKProcessPool configuration from the inline web view
  • Add a regression test for URL rendering around attachments
  • Bump CURRENT_PROJECT_VERSION to 114

Validation

  • xcodebuild build -scheme Bangumi -project /Users/everpcpc/src/Bangumi-iOS/Bangumi.xcodeproj -destination 'platform=iOS Simulator,id=75F620AF-2C66-40F2-BCED-3096C45EE02D' CODE_SIGNING_ALLOWED=NO
  • Manual reasoning check for BBCode mask toggle and app-routed link taps via the new delegate path
  • xcodebuild test -scheme BBCode ... is still blocked by the scheme not being configured for the test action in this project setup

Avoid applying link attributes to attachment ranges so BBCode text does not enter the UIKit drag path with malformed link metadata.

Route BBCode link taps through the host openURL handler, adopt the iOS 17 primaryAction text item delegate, disable text drag on read-only text blocks, and remove the obsolete WKProcessPool configuration.

Add a regression test covering URL rendering around attachments.
@everpcpc everpcpc merged commit c57a53e into bangumi:main Apr 11, 2026
1 check passed
@everpcpc everpcpc deleted the codex/bbcode-link-routing-crash-fix branch April 11, 2026 14:23
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.

1 participant