Skip to content

fix(ios): describe the spot-check area when no photo is available - #204

Open
SamGu-NRX wants to merge 5 commits into
codex/public-assembly-20260930from
fix/spot-fallback-20261003
Open

SamGu-NRX wants to merge 5 commits into
codex/public-assembly-20260930from
fix/spot-fallback-20261003

Conversation

@SamGu-NRX

@SamGu-NRX SamGu-NRX commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

What changed

When no usable photo is available, the spot check currently asks the homeowner to inspect a blue outline that is not on screen. It gives only the distance along the wall, and VoiceOver also describes the missing outline.

The fallback now asks "Is anything standing in this space?" and shows a "Where to look" card with the area's position beside the meter, distance out from the wall and height above the ground. Those dimensions match the existing photo outline. VoiceOver reads each of the card's three lines as its own element, with units spelled out. The photo-backed layout stays unchanged, while its spoken description gains the depth and height.

The packet's guidance log now records the question the screen actually showed. It names a keyframe only when that photo was shown with its outline. Before, it always logged the outline question, and it logged a photo that failed to load as shown. ScanEngine.presentAnswer now builds that record after the photo loads, using the same photo-and-wall check as the screen.

Stacked on #191 at 75f6c377. This PR changes no clearance values or confirmation consequences.

Why

The homeowner needs to locate the area before answering. One photo-and-wall availability check now controls the question, rendering and accessibility description, so they cannot disagree about whether an outline exists. Text in the fallback also uses the adaptive primary color instead of near-black text on a dark card.

UI changes

The missing-photo fallback is the changed screen. Before-and-after captures are not available yet: local build admission was refused for memory pressure. The new UI tests attach photo, no-photo, largest-text, left-of-meter and straddling-meter frames when they run. These will be inspected and added after hosted CI produces them.

Verification

  • Syntax-only parsing passed for the changed Swift files. This does not establish compilation.
  • A fresh read-only review found no blocking correctness issue in geometry descriptions, side ordering or fixture expectations. Its incorrect rounding example was corrected.
  • Added five UI tests covering photo availability, the words-only fallback at ordinary and largest text sizes, left/straddling spans and answering without a photo. They assert each line's spoken label, check that each line is on screen (scrolling at the largest size), and run accessibility audits that cover those lines. These tests have not run yet. Hosted run 37107514444 at e1bc23a0 stopped at the project-drift check before building, because the two new fixtures were missing from project.pbxproj. c1b2566c adds the two lines that run generated. Hosted CI on 659f668c is the first build and runtime check.
  • Fixtures are synthetic. No real capture or photo upload occurred.

Risk

This describes only the area the existing outline covers, not every region supporting the server's clearance checks. It does not resolve camera-only visibility limitations. The guidance log change alters packet log text only; scene.json and the packet's fields are unchanged. Phone usability and dark-mode rendering remain unverified.

Checklist

  • The scope is focused; related changes belong together
  • I explained what changed and why
  • I included before/after images for visible changes
  • N/A video: no new motion or transition

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Spot confirmations now show an outlined photo and matching guidance question when the photo and wall data are available.
    • When an outline cannot be shown, the app describes the area in words, including its position along the wall, distance from the wall, and height.
    • Spoken descriptions include the same area details, and dimension lines remain accessible on screen.

…drawn

When no kept photo showed the spot, or there was no wall to draw on, the
spot check still asked about "the blue outline", gave only the distance
along the wall, and VoiceOver described the missing outline. The answer
decides which clearance claims survive, so the homeowner has to know what
space they are judging.

One decision now drives the question, the picture and VoiceOver: the
outline is drawn only with both a photo and a wall. Without one, the
screen shows no photo, asks "Is anything standing in this space?", and
lists the area's three extents: where it runs beside the meter, how far
out from the wall (areaDepth) and how high up (spotHeight). The outlined
photo's VoiceOver value now reads all three too. The words-only lines use
the primary color, since Ink on Surface measured 1.06:1 in dark mode.
An end of the span that rounds to 0 in now reads as the meter.

Demo flags -uiDemoSpotNoPhoto and -uiDemoSpotNoWall reach those states;
SpotConfirmUITests covers photo, no photo (default and AX5), no wall,
left and straddling spans, and answering without a photo.

Co-Authored-By: Claude Code <noreply@anthropic.com>
A -1 in end rounds to 1 in, not 0, so the example contradicted the rule.
The extents comment now says it describes the outlined area only, not
every clearance the server checks.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@SamGu-NRX SamGu-NRX added the full-ui iOS CI also runs the every-state accessibility audit (about 10 more minutes). label Oct 3, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T09:25:36.012710Z 803535d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the size:XL 500-999 effective changed lines. label Oct 3, 2026
@codemetrics-ai

codemetrics-ai Bot commented Oct 3, 2026

Copy link
Copy Markdown

Note

Review skipped

Codemetrics is installed on this repository, but it hasn't been added to your team yet.

To enable AI code reviews for this repo, go to your dashboard and add BaseScanning to your team's repositories.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
ios/README.md — configured
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1f67f6b-5e4f-4639-bfa5-9a0ec4c18847
📥 Commits

Reviewing files that changed from the base of the PR and between 75f6c37 and 803535d.

📒 Files selected for processing (9)
  • ios/HouseScan.xcodeproj/project.pbxproj
  • ios/HouseScan/Runtime/ScanEngine+Confirm.swift
  • ios/HouseScan/UI/Copy/SpotCheckCopy.swift
  • ios/HouseScan/UI/Preview/DemoEngine.swift
  • ios/HouseScan/UI/Screens/SpotConfirmScreen.swift
  • ios/HouseScanUITests/Fixtures/results/spot-left.json
  • ios/HouseScanUITests/Fixtures/results/spot-straddle.json
  • ios/HouseScanUITests/SpotConfirmUITests.swift
  • ios/README.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The spot-confirm flow now selects its question and area presentation based on whether the area can be outlined. When an outline is unavailable, the screen describes the area with words. New demo cases and UI tests cover both presentation states.

Changes

Spot confirmation

Layer / File(s) Summary
Spot-check questions and area descriptions
ios/HouseScan/UI/Copy/SpotCheckCopy.swift
Copy now provides separate questions for outlined and words-only presentations. Area descriptions include along-wall, wall-to-ground, and ground-to-height dimensions, with updated formatting for spans near the meter.
Conditional presentation and confirmation
ios/HouseScan/Runtime/ScanEngine+Confirm.swift, ios/HouseScan/UI/Screens/SpotConfirmScreen.swift, ios/HouseScan/UI/Preview/DemoEngine.swift
The screen shows an outlined photo when both the photo and wall are available; otherwise, it displays the area dimensions in words. The confirmation records a photo ID only when an outline is shown, and the guidance request uses the displayed question. Demo arguments can remove the photo or wall.
Demo cases and UI validation
ios/HouseScanUITests/Fixtures/results/*, ios/HouseScanUITests/SpotConfirmUITests.swift, ios/HouseScan.xcodeproj/project.pbxproj, ios/README.md
New fixtures and UI tests cover outlined and words-only presentations, including areas left of or straddling the meter. The README describes the words-only fallback.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ScanEngine
  participant SpotCheck
  participant ScanCopy
  participant SpotConfirmScreen
  ScanEngine->>SpotCheck: Check whether photo and wall allow an outline
  ScanEngine->>ScanCopy: Select question for outline state
  ScanEngine->>SpotConfirmScreen: Present check and matching question
  SpotConfirmScreen->>SpotCheck: Request outline using wall
  SpotConfirmScreen->>ScanCopy: Display area description for outline state
Loading

Merge Risk: ⚪ Minimal · up to 80353

The fallback is ready for normal build and UI-test checks; those checks have not yet been confirmed as passing.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 5 files. (4 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: the spot-check fallback now describes the area when no usable photo is available.
Description check ✅ Passed The description covers the required sections and explains the change, rationale, risks, and verification limits. Before-and-after captures are missing for this visible UI change, and the new UI tests …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 5 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds fallback text description for spot check when photo unavailable.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR replaces the missing-photo spot-check prompt with a three-dimensional “Where to look” card and aligns the guidance log with the question and photo actually shown. The latest changes refine the card title’s accessibility element and the UI test’s large-text scrolling.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Spot check ready] --> B{Photo and wall available?}
  B -->|Yes| C[Show outlined photo and marked-area question]
  B -->|No| D[Show Where to look card and space question]
  C --> E[Record shown question and keyframe]
  D --> F[Record shown question without keyframe]
Loading

Reviews (3) · Last reviewed commit: "fix(ios): read the area card's title as ..."

Comment thread ios/HouseScan/UI/Screens/SpotConfirmScreen.swift Outdated
Comment thread ios/HouseScanUITests/SpotConfirmUITests.swift

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1bc23a0ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,203 @@
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Regenerate the project after adding excluded fixtures

Regenerate and commit HouseScan.xcodeproj for these two new fixture files. The HouseScanUITests synchronized folder excludes Fixtures, and the generated project.pbxproj enumerates each excluded result file, but this commit adds spot-left.json and spot-straddle.json without corresponding membership exceptions. In the inspected .github/workflows/ios.yml pipeline, XcodeGen regenerates the project and the drift step will therefore fail before tests run.

AGENTS.md reference: AGENTS.md:L58-L58

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Valid, and it was the cause of hosted run 37107514444. Fixed in c1b2566 with the two exclusion lines XcodeGen 2.46.0 generated in that run. The resulting project.pbxproj blob is 21c9c0a, matching CI's diff.

private func content(_ check: SpotCheck) -> some View {
ScrollView {
let outline = outlinable(check)
let question = outline == nil ? ScanCopy.spotQuestionInPerson : ScanCopy.spotQuestion

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Record the question actually shown without an outline

When the photo or wall is missing, this branch displays spotQuestionInPerson, but spotCheckRequest in Runtime/ScanEngine+Confirm.swift still always serializes ScanCopy.spotQuestion. Consequently, the saved packet's guidance log says the homeowner answered a question about a marked area and blue outline even though the new screen showed neither, making the audit record disagree with the interaction it is meant to bind to the answer.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Same finding as Greptile's thread on this line. Fixed in 659f668: the logged question is now the one shown (spotQuestionShown(outlined:) from SpotCheck.outline(on:)), built after the photo loads.

SamGu-NRX and others added 2 commits October 3, 2026 03:10
The synced HouseScanUITests folder lists each excluded fixture by name, so
XcodeGen 2.46.0 adds spot-left.json and spot-straddle.json. These are the
exact lines CI generated in run 37107514444; the resulting blob is 21c9c0a.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The guidance log always recorded the outline question, and built the
request before the photo loaded, so a check asked in words was logged as
"inside the blue outline", and a photo that failed to load was logged as
shown. The request and pending record are now built after the photo
loads, from SpotCheck.outline(on:), the same decision the screen uses:
the question shown, and a photo ID only when that photo is outlined.

Each of the words-only card's three lines is now its own accessibility
element with a spoken label, so VoiceOver steps through them and the UI
tests and audit see the rendered text. The tests check each line's label
and that it is on screen, scrolling to it at AX5.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@SamGu-NRX

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 659f668c0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…line fully on screen

CI run 37108821815 failed SpotConfirmUITests in two ways.

The "Where to look" title read as "Show": the identifier on
Label(_:systemImage:) reached the "eye" symbol, whose VoiceOver name is
"Show". The symbol is now hidden and the label combined, so the title is
one header element read as its words.

At AX5 the area lines failed the whole-line visibility check: the test
scrolled until isHittable, which needs only the element's middle on
screen, and a 249 pt line stopped with its bottom off the window. The
test now drags by the part off screen until the whole frame is inside
the window, the condition it asserts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
SamGu-NRX added a commit that referenced this pull request Oct 3, 2026
The reachability and result-notice tests now use #204's whole-frame
scrolling instead of isHittable, so they scroll to the condition they
assert. A notice taller than the window is read top edge first, then
bottom edge, as a homeowner would scroll through it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SamGu-NRX

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 803535db07

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

SamGu-NRX added a commit that referenced this pull request Oct 3, 2026
… branch: describe the spot-check area when no photo is available

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SamGu-NRX

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

full-ui iOS CI also runs the every-state accessibility audit (about 10 more minutes). size:XL 500-999 effective changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant