Skip to content

fix(mobile): stop saying the Glasshouse page is hidden once it leaves the screen - #205

Open
geoolekom wants to merge 1 commit into
mainfrom
mobile-ios-sign-follows-protection
Open

geoolekom wants to merge 1 commit into
mainfrom
mobile-ios-sign-follows-protection

Conversation

@geoolekom

Copy link
Copy Markdown
Contributor

Follow-up to #202, from its review: the sign under the address bar keeps saying the page is hidden from screenshots after the page has left the screen, and the code that puts the layer back when SwiftUI takes the host away has no test.

What changed

  • GlasshouseWebHost tells screenshotProtectionEnded each time it puts the layer back: the host left its window, or restricted mode ended.
  • GlasshouseRestriction.screenshotProtectionEnded() clears screenshotProtected. It raises no "a screenshot cannot be blocked" line, because nothing failed, and a line the person has not read yet stays. Before this, the sign kept saying "Restricted mode: hidden from screenshots and recordings" from the moment the page left until the next try after it came back; now it says plain "Restricted mode" in between.
  • The build number is 261126.3, because this changes the app: a build from this commit cannot share a number with one from the commit before it.

What each new test shows

GlasshouseWebHostTests (unit):

  • the host says the protection ended each time it puts the layer back (leaving the window, restricted mode off), and not before; those calls are not told as tries;
  • GlasshouseWebContainer.dismantleUIView puts the layer back while the host is still on its window, which is what the line host.restricted = false there is for;
  • with the state holder wired the way the app wires it, the sign says "hidden" after a try that worked, stops saying it when the host leaves, raises no line, and says it again when the host comes back.

GlasshouseRestrictionTests (unit, two new): the end of the protection clears the sign and raises no line; it changes nothing before any try, and after a failed try the unread line stays.

What ran

  • Unit tests in the Simulator (iPhone 17, iOS 27.2): 116 run, 2 skipped, 0 failures.
  • UI tests in the Simulator (same device): 33 run, 33 passed, 0 failed (scripts/test-glasshouse-ios.py, about 11 minutes).
  • iosApp/check.sh (structure check and swiftlint lint --strict): clean, 0 violations. pre-commit run --all-files: passed.

The Simulator does not apply the screenshot protection to what it draws, so what a screenshot or a recording shows is still for a real iPhone to say, as in #202.

… the screen

The sign under the address bar kept saying the page was hidden from
screenshots and recordings from the moment the page left the screen until
the next try after it came back. The host now tells when it puts the layer
back, and the state holder clears the sign without raising the line that a
screenshot cannot be blocked, because nothing failed.

A test now covers what SwiftUI does when it takes the host away, which
puts the layer back while the host can still be on its window. The build
number is 261126.3 because the app changed.

Signed-off-by: Yehor Komarov <10210242+geoolekom@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0db21a0-eda3-4f8f-b5e8-f7e79bc9aa6c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch has not been deployed

No deployments
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