Skip to content

feat: add the iOS files browser core - #181

Merged
altaywtf merged 7 commits into
next-rollout/runtime-seamfrom
next-rollout/browser-core
Aug 30, 2026
Merged

feat: add the iOS files browser core#181
altaywtf merged 7 commits into
next-rollout/runtime-seamfrom
next-rollout/browser-core

Conversation

@altaywtf

@altaywtf altaywtf commented Aug 29, 2026

Copy link
Copy Markdown
Member

Part of #123
Refs #130

Summary

  • Replace the production Files placeholder with a native SwiftUI root and nested-folder browser over the existing authenticated PutioRuntime.
  • Cover loading, empty, error, retry, refresh, stale-result, cancellation, stable-ID navigation, and typed file selection without exposing credentials or creating a parallel SDK.
  • Add separated app-hosted feature tests, deterministic snapshots, and an accessibility-driven files-browser journey.

This is only the browser-core checkpoint from #130. It does not close #130 or complete the #123 epic.

Reviewer Guide

  • Highest-risk area: lifecycle cancellation and stale-result handling across retry, refresh, navigation, session expiry, and view re-entry.
  • Start with FilesBrowserModel.swift, then FilesBrowserView.swift, PutioApp.swift, and FilesBrowserJourneyTests.swift.

Visual Aids

Validation

  • mise run verify
  • mise run harness -- journey --platform ios --scenario files-browser --output json
  • Proof captured under build/proof/20260829T165856Z-82f73aa/ios
  • Proof published separately with attach
  • Additional targeted checks:
    • 12 script tests, 40 PutioCore tests, and 30 harness tests pass.
    • Putio, PutioNightly, PutioWatch, and PutioTV build.
    • Both iOS snapshot suites and the tvOS snapshot suite pass.
    • The iOS journey passes 1/1 and asserts id=411;parent=410;kind=video.
    • Codex-high Slopguard returned clean with 0 findings for the complete textual branch at 82f73aa and the follow-up at 6d4d6ce. The two PNG baselines were reviewed at original resolution and re-asserted by mise run verify.

Sanity Checks

  • Root → folder 410 → file 411 emits a typed video route; native Back restores root.
  • Session failures remain owned by SessionRootView.
  • Caller cancellation preserves the prior state; active-task cancellation remains retryable.
  • Superseded requests cannot overwrite newer state.
  • Default and Accessibility 3 browser snapshots are committed.

Benchmarks

N/A — this checkpoint adds the first browser path, not a performance-sensitive refactor.

Notes

Copilot AI lite review requested due to automatic review settings August 29, 2026 17:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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-08-30T08:39:06.571464Z 1026926 New commits
ℹ️ 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.

@altaywtf altaywtf changed the title next rollout/browser core feat: add the iOS files browser core Aug 29, 2026

Copilot AI 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.

🔵 Needs a closer look

It introduces a new harness execution mode plus a new iOS browser surface and seeded API fixtures, so a human should validate the end-to-end runtime behavior beyond unit/UI/snapshot coverage.

Pull request overview

This PR extends the headless PutioHarness to support an iOS “files-browser” journey run (UI-tested, recorded, and proof-manifested), expands snapshot testing to multiple suites per platform, and introduces a real iOS Files browser surface backed by deterministic seeded API fixtures plus new unit/UI/snapshot tests.

Changes:

  • Add journey --platform ios --scenario files-browser to PutioHarness, including xcresult attachment extraction, MP4 recording, and proof manifest emission.
  • Replace single snapshotScheme with snapshotSuites to support multiple iOS snapshot suites (component + feature) and iterate them in harness test.
  • Implement the iOS Files browser UI/model and add seeded API fixtures + feature tests (unit, integration, rendering snapshot, and UI journey).
File summaries
File Description
Tools/PutioHarness/Tests/PutioHarnessKitTests/ModelsTests.swift Adds contract tests for snapshot suites and browser-journey manifest/attachment selection.
Tools/PutioHarness/Tests/PutioHarnessKitTests/ArgumentParserTests.swift Adds argument parsing coverage for the new journey command and rejects invalid shapes.
Tools/PutioHarness/Sources/PutioHarnessKit/SimulatorHarness.swift Implements journey run flow; updates manifest writing, artifact kinds, and multi-suite snapshot testing.
Tools/PutioHarness/Sources/PutioHarnessKit/Models.swift Adds SnapshotSuite, JourneyScenario, and journey result parsing helpers/contracts.
Tools/PutioHarness/Sources/PutioHarnessKit/HarnessService.swift Wires .journey invocation into the harness service output pipeline.
Tools/PutioHarness/Sources/PutioHarnessKit/ArgumentParser.swift Adds CLI usage + parsing/validation for journey; updates snapshot platform validation.
Tests/Shared/SnapshotSupport/SnapshotRendering.swift Adds SwiftUI rendering helper for app-hosted feature snapshots.
Tests/iOSUITests/Sources/FilesBrowserJourneyTests.swift New XCUITest proving root→nested→back flow and emitting named attachments.
Tests/iOS/Sources/PutioFolderModelTests.swift New unit tests for folder loading/refresh/cancellation generation behavior.
Tests/iOS/Sources/PutioFileRouteTests.swift New tests ensuring route identity/hash stability and item-kind mapping.
Tests/iOS/Sources/FilesBrowserSeededAPIIntegrationTests.swift Integration coverage for seeded runtime list/navigation/route extraction.
Tests/iOS/Sources/FilesBrowserRenderingTests.swift Snapshot assertions for Files browser in default + accessibility dynamic type.
Tests/iOS/Sources/BrowserTestFixtures.swift Shared deterministic fixtures for browser tests (dates, items, contents).
Project.swift Adds iOS feature test + UI test targets and shares SnapshotSupport buildable folder.
Packages/PutioCore/Tests/PutioCoreTests/ComponentKitTests.swift Extends harness scenario parsing tests; adds PutioFileRow disclosure behavior test.
Packages/PutioCore/Sources/PutioCore/HarnessScenario.swift Introduces new .filesBrowser harness scenario.
Packages/PutioCore/Sources/PutioCore/Components/PutioFileRow.swift Adds ability to hide folder disclosure when embedded in a NavigationLink.
docs/HARNESS.md Documents new journey command and updated multi-suite snapshot behavior.
CONTRIBUTING.md Encourages running the browser journey for iOS file-browser changes.
Apps/Shared/Sources/PutioRuntimeFactory.swift Enables seeded API for .filesBrowser scenario in DEBUG.
Apps/Shared/Sources/HarnessSeededAPI.swift Expands deterministic URLProtocol fixtures to include /v2/files/list for browser flow.
Apps/iOS/Sources/PutioApp.swift Replaces placeholder Files tab with real browser; adds accessibility probe for UI test route emission.
Apps/iOS/Sources/FilesBrowserView.swift Adds the Files browser NavigationStack screens, load/retry/refresh UI, and accessibility identifiers.
Apps/iOS/Sources/FilesBrowserModel.swift Adds browser domain model: routes, presentation mapping, and folder load state machine.
Review details

Suppressed comments (1)

Tools/PutioHarness/Sources/PutioHarnessKit/SimulatorHarness.swift:495

  • This failure message still refers to a "snapshot scheme" even though the configuration has been changed to snapshotSuites. Updating the message keeps the CLI feedback aligned with the actual configuration model.
    let suites = platform.configuration.snapshotSuites
    guard !suites.isEmpty else {
      throw HarnessFailure("test supports only platforms with a snapshot scheme: ios, tvos")
    }
  • Files reviewed: 24/26 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Tools/PutioHarness/Sources/PutioHarnessKit/SimulatorHarness.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: 82f73aaf68

ℹ️ 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".

Comment thread Apps/iOS/Sources/FilesBrowserView.swift
Comment thread Apps/iOS/Sources/PutioApp.swift
@altaywtf

Copy link
Copy Markdown
Member Author

Fixed the valid snapshot-suite wording note in 6d4d6ce: the unsupported-platform error now matches the snapshotSuites model.

Verified with strict Swift format lint, all 30 harness tests, full mise run verify, and a clean Codex-high Slopguard review.

altaywtf and others added 6 commits August 30, 2026 11:17
The retry task re-runs whenever the screen re-appears, so a request
that was not cleared before the user left could re-fire a load or
refresh against a model that no longer needs it, racing the initial
load and flashing a loading state over loaded content.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@altaywtf
altaywtf force-pushed the next-rollout/browser-core branch from 6d4d6ce to f82b0e5 Compare August 30, 2026 08:21
@altaywtf

Copy link
Copy Markdown
Member Author

Second-pass review follow-up; fix pushed to the branch.

Fixed in f82b0e5.task(id: retryRequest) re-runs on every appearance, so a RetryRequest that outlived its screen visit (retry tapped, screen left before the cancelled load drained, screen re-entered) could re-fire model.retry()/model.refresh() against a model that no longer needed it, racing loadIfNeeded() and flashing a loading state over loaded content. runRetryRequest now drops the request unless the model still warrants it: .failed for a load retry, a present refreshFailure for a refresh retry. Generation guards already kept final state correct, so this was duplicate work, not corruption. No dedicated harness test: the model retry paths are covered in PutioFolderModelTests, and a .task re-appearance harness would outweigh the change.

Verified: full mise run verify at f82b0e5 — all four schemes build, both iOS snapshot suites, tvOS snapshots, 30 harness tests, 42 PutioCore tests.

@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: f82b0e57cb

ℹ️ 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".

Comment thread Apps/iOS/Sources/FilesBrowserModel.swift Outdated
A cancelled initial load reset attemptedInitialLoad only after its
request drained, so a quick tab re-entry ran loadIfNeeded before the
reset, saw the flag still set, and left the browser on a permanent
spinner with no request in flight. Guarding on unsettled .loading state
instead lets re-entry start a superseding request, and the generation
check keeps the late unwind from clobbering it. The flag and the
isInitialLoad payload become dead and are removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@altaywtf
altaywtf merged commit a55274b into next Aug 30, 2026
1 check passed
@altaywtf
altaywtf deleted the next-rollout/browser-core branch August 30, 2026 08:42
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.

iOS files: folder browsing, sorting, and search

2 participants