Skip to content

Conversation

@micahflee
Copy link
Member

Fixes #586

I did this refactoring with heavy use of Claude Code (very supervised, of course).

I haven't written tests for it all (none of it was tested before), so it will require manual testing of every single feature of Cyd. Once this is merged, the #587 issue is for writing tests.

Here are the main changes:

  • Platforms now have a usePlatformView composable, and PlatformView.vue, which both platforms (X and Facebook) share.
  • There was a lot of repeated code in the platform wizard, like with the breadcrumbs at the top, the buttons at the bottom, etc. So now there is a useWizardPage composable and a BaseWizardPage.vue component which all wizard pages use.
  • I've introduced PlatformConfig (which XPlatformConfig and FacebookPlatformConfig inherit from), that defines specific things about that platform. We pass a platform config into usePlatformView.
  • I've reorganized all of the X/Facebook component files so it's simpler to tell what's a component, what's a wizard page, etc.

I haven't done a ton of manual testing of the Facebook platform because it isn't stable and will probably be rewritten anyway. So I think the real thing we should do is thoroughly test that this doesn't break anything in the X platform.

@micahflee micahflee requested a review from SaptakS October 6, 2025 19:37
Copy link
Contributor

@SaptakS SaptakS left a comment

Choose a reason for hiding this comment

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

I have taken a quick look and like the approach here. I do feel we can refactor even more and make parts of the pages more reusable. For example, some of the forms and the options shown are very similar, so we can move them out to a separate component and then reuse them in the wizard pages with correct props depending on the page.

I wonder if we can even make FacebookWizardBuildOptionsPage and XWizardBuildOptionsPage into a single reusable wizard page that gets implemented based on props. This may be going too far (especially if the UX flow for the other platforms are very different, but I am thinking from a perspective, where we can add platform support with almost not writing any component and just some settings/config stuff)

@redshiftzero
Copy link
Contributor

Did some exploratory testing, checked the following work as advertised:

  • Archive only mode - existing user
    • Import of X archive
  • Archive only mode - new user
    • Import of X archive
  • Backup of existing account from scratch (i.e. no import of X archive)
  • Backup of new account from scratch (i.e. no import of X archive)
    • Also tested HTML backup

I haven't tested deletion or migration to Bluesky yet

@SaptakS
Copy link
Contributor

SaptakS commented Oct 27, 2025

I did some testing of the deletion functionalities and looks good to me.

@SaptakS SaptakS merged commit bb5cc42 into main Oct 28, 2025
1 check passed
@SaptakS SaptakS deleted the 586-component-refactoring branch October 28, 2025 11: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.

Refactor XView components to share code with other platforms

4 participants