-
Notifications
You must be signed in to change notification settings - Fork 119
[MBL-19574][S/T/P] Support Studio, Quiz & Archive embeds in WebView & Immersive view #3818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[MBL-19574][S/T/P] Support Studio, Quiz & Archive embeds in WebView & Immersive view #3818
Conversation
refs: MBL-19574 affects: Student, Teacher, Parent builds: Student, Teacher, Parent release note: Enhanced experience for media embeds
Release Note:Enhanced experience for media embeds Affected Apps: Student, Teacher, ParentBuilds: Student, Teacher, Parent
|
BuildsCommit: Remove feature for inserting "Open in details view" buttons below iframes (af316b3) |
Claude Code ReviewUpdated: 2025-12-28 Critical Issues Fixed ✅
Remaining Issues
Minor
Improvements ✅
✅ Approved with minor observations |
| lazy var optionsButton = UIBarButtonItem(image: .moreLine, style: .plain, target: self, action: #selector(showOptions)) | ||
| @IBOutlet weak var webViewContainer: UIView! | ||
| public var webView = CoreWebView() | ||
| public var webView = CoreWebView(features: [.canvasLTIPostMessageHandler]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to include this feature by default in every CoreWebView instance we create just like we do with the .dynamicFontSize feature. This way we won't leave out a single screen.
CoreWebView.swift:97
let features = features + [.dynamicFontSize]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is meant for screens loading HTML content as text. (Through method loadHTMLString(_:String, baseURL:))
For those loading content through remote URL, wouldn't that interfere with referenced scripts in the loaded HTML page? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is meant for screens loading HTML content as text.
Was this a specific ask from the Studio team? Interference depends on how good the js we inject. I'd think the Studio team made it pretty specific to our use case.
Claude Code ReviewUpdated: 2026-01-06 Critical Issues Found
Other Issues
SummaryReview identifies 3 crash vectors and 2 reliability issues. URL parsing should use try-catch. Webkit handlers need guards. Script injection needs debug visibility. ❌ Issues found |
Claude Code ReviewUpdated: 2026-01-13 Issues Fixed Since Last Review ✅
Remaining Issues
SummarySignificant improvements in URL parsing safety. Main concerns: accumulated event listeners and silent script loading failures. ✅ Approved with minor observations |
vargaat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a few issues that we could solve before merging
- Opening the immersive view from discussion details doesn't open the native dialog, but it opens in place.
- Rotating immersive view from portrait to landscape make the "Details" and "Transcript" tabs not to appear. The layout is also strange, scrollview inside scrollview.
https://github.com/user-attachments/assets/6361f684-824e-4fbb-8b30-95764391daec - The "X" button inside the immersive view does nothing. We could hide this with a CSS injection not to have two close buttons.
https://github.com/user-attachments/assets/a0cf8565-7df7-44bc-a4d3-c95cb4cf087b
refs: MBL-19574
affects: Student, Teacher, Parent
builds: Student, Teacher, Parent
release note: Enhanced experience for media embeds
Changes
This is mainly to support the following functions related to iframes of Studio media:
1- Adding javascript file (
CanvasLTIPostMessageHandler.js) provided by Studio team, to fix an issue of resizing for content loaded into WebView as an HTML text.2- Removing the feature of inserting "Open in Details View" button below iframes for embeds types. See ticket description for more information about this decision.
3- Support launching immersive view for Studio media, by two ways: Tapping on "Expand View" button (of menu item) which loaded into the iframe, and tapping on the iframe itself (only for the case thumbnail embed).
The handling is done by 2 main ways:
1- Examining URL of navigation action passed to WebView delegate method:
webView(_:decidePolicyFor:decisionHandler:)2- Handling a WebView message
fullWindowLaunchwhich is posted inCanvasLTIPostMessageHandler.js:298upon listening to iframerequestFullWindowLaunchmessage event.For more details on the specs of those frames, see document linked in ticket description.
Test Plan
Checklist