Skip to content

Remove view input properties from StateObject - #24099

Merged
crazytonyli merged 2 commits into
trunkfrom
self-hosted-site-plugin-management-refine-ui
Feb 27, 2025
Merged

Remove view input properties from StateObject#24099
crazytonyli merged 2 commits into
trunkfrom
self-hosted-site-plugin-management-refine-ui

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

This is a follow-up PR for #24072 (comment).

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@crazytonyli crazytonyli added this to the 25.9 milestone Feb 20, 2025
@crazytonyli
crazytonyli requested review from jkmassel and kean February 20, 2025 00:35
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Feb 20, 2025

Copy link
Copy Markdown
Contributor
WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr24099-010a901
Version25.7.1
Bundle IDorg.wordpress.alpha
Commit010a901
App Center BuildWPiOS - One-Offs #11554
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot

wpmobilebot commented Feb 20, 2025

Copy link
Copy Markdown
Contributor
Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr24099-010a901
Version25.7.1
Bundle IDcom.jetpack.alpha
Commit010a901
App Center Buildjetpack-installable-builds #10585
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

self.pluginInfo = .init(name: plugin.name, author: plugin.author, shortDescription: plugin.author)
self.service = service
_viewModel = StateObject(wrappedValue: .init(slug: slug, service: service))
_viewModel = StateObject(wrappedValue: .init(service: service))

@kean kean Feb 20, 2025

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.

Hey, just to confirm, the way it works now is that the ViewModel is stateless and can be re-used for different plugins, correct?

I typically use id to ensure the view is re-created when a new object is displayed, but that is also a common approach.

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.

the ViewModel is stateless

Kind of. It stores fetched data, so it has some state. But it does not aware of view's state (like via the old slug property).

I typically use id to ensure the view is re-created

Do you mean using id in the PluginDetailsView, or in its call sites? If you mean call sites, I think that's implied at the moment because PluginDetailsView is used in ForEach?

@kean
kean self-requested a review February 26, 2025 20:27
@crazytonyli
crazytonyli force-pushed the self-hosted-site-plugin-management-plugins-sections branch from 1ef825d to bcf404e Compare February 27, 2025 10:22
Base automatically changed from self-hosted-site-plugin-management-plugins-sections to trunk February 27, 2025 11:23
@crazytonyli
crazytonyli force-pushed the self-hosted-site-plugin-management-refine-ui branch from ee1205e to 010a901 Compare February 27, 2025 19:44
@crazytonyli
crazytonyli added this pull request to the merge queue Feb 27, 2025
Merged via the queue into trunk with commit 8d1d2f4 Feb 27, 2025
@crazytonyli
crazytonyli deleted the self-hosted-site-plugin-management-refine-ui branch February 27, 2025 23:23
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.

4 participants