Skip to content

MBL-2927: Remove 'Either' initialization option from ProjectPageViewController#2701

Closed
amy-at-kickstarter wants to merge 2 commits intomainfrom
feat/adyer/mbl-2927/cleanup-interface-pt-1
Closed

MBL-2927: Remove 'Either' initialization option from ProjectPageViewController#2701
amy-at-kickstarter wants to merge 2 commits intomainfrom
feat/adyer/mbl-2927/cleanup-interface-pt-1

Conversation

@amy-at-kickstarter
Copy link
Copy Markdown
Contributor

@amy-at-kickstarter amy-at-kickstarter commented Jan 15, 2026

📲 What

Remove Either initialization option from ProjectPageViewController. The view controller will now require any ProjectPageParam.

🤔 Why

There were two pathways to creating a ProjectPageViewController - using a Project or using a ProjectPageParam. However, the ProjectPageParam can also contain an initialProject, which is used for previewing data.

These two pathways add significant complexity to the loading code in ProjectPageViewController and are ultimately redundant. By removing this Either call, we can start to clean up these two separate paths.

Ultimately, the goal is to make it much simpler to creating a project page with a loading preview, anywhere in the app, using one simplified loading path.

@amy-at-kickstarter amy-at-kickstarter marked this pull request as ready for review January 15, 2026 14:20
let projectParam = Either<Project, any ProjectPageParam>(left: project)
let vc = ProjectPageViewController.configuredWith(
projectOrParam: projectParam,
param: project.projectPageParam,
Copy link
Copy Markdown
Contributor Author

@amy-at-kickstarter amy-at-kickstarter Jan 15, 2026

Choose a reason for hiding this comment

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

A convenience method for turning a project into a ProjectPageParam.


vc.viewModel.inputs.configureWith(
projectOrParam: projectOrParam,
// TODO: MBL-2927 We're cleaning up the Either path in the view model.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sanity checking this todo is still needed or if work needs to be done here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍 Yup, still needs to be done. I figured I would clean this up in two separate phases, just to keep the PR from being overwhelming.

@amy-at-kickstarter amy-at-kickstarter force-pushed the feat/adyer/mbl-2927/cleanup-interface-pt-1 branch from 59a8d16 to ed7040e Compare February 3, 2026 18:51
@nativeksr
Copy link
Copy Markdown
Collaborator

SwiftLint found issues

Warnings

File Line Reason
PPOContainerViewController.swift 14 Function should have complexity 10 or less; currently complexity is 12 (cyclomatic_complexity)

Generated by 🚫 Danger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants