Skip to content

Migrate Resonate to Feature Based MVVM with Riverpod - #839

Open
M4dhav wants to merge 17 commits into
devfrom
state_migration
Open

Migrate Resonate to Feature Based MVVM with Riverpod#839
M4dhav wants to merge 17 commits into
devfrom
state_migration

Conversation

@M4dhav

@M4dhav M4dhav commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR merges all state migration changes to port Resonate to Riverpod by @Mayank4352

Type of change

Please delete options that are not relevant.

  • Refactor (does not change functionality, e.g. code style improvements, linting)

How Has This Been Tested?

Tests passing

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Tag the PR with the appropriate labels

Mayank4352 and others added 12 commits May 27, 2026 18:34
feat: Refactored Auth feature to Riverpod and MVVM
* fix: Fixed the state error in app prefs page

* feat: Refactor Profile feature to Riverpod and MVVM

* fix: fixed broken workflow

---------

Co-authored-by: Madhav Gupta <114633095+M4dhav@users.noreply.github.com>
* fix: Fixed the state error in app prefs page

* feat: MIGRATED ROOMS FROM GETX TO RIVERPOD

* feat: Refactor Profile feature to Riverpod and MVVM

* chore: regenerate code-gen outputs after merge

* fix: fixed broken workflow

* fix: added left localizations & subfolders for repo and service in data

* fix: fixed search overlay bug and room deleation

---------

Co-authored-by: Madhav Gupta <114633095+M4dhav@users.noreply.github.com>
…827)

* fix: Fixed the state error in app prefs page

* feat: MIGRATED ROOMS FROM GETX TO RIVERPOD

* feat: Refactor Profile feature to Riverpod and MVVM

* chore: regenerate code-gen outputs after merge

* feat: friends migration

* fix: fixed broken workflow

* fix: added left localizations & subfolders for repo and service in data

* fix: fixed search overlay bug and room deleation

* feat: commit for untranslated.txt

---------

Co-authored-by: Madhav Gupta <114633095+M4dhav@users.noreply.github.com>
…re (#829)

* fix: Fixed the state error in app prefs page

* feat: MIGRATED ROOMS FROM GETX TO RIVERPOD

* feat: Refactor Profile feature to Riverpod and MVVM

* chore: regenerate code-gen outputs after merge

* feat: friends migration

* fix: fixed broken workflow

* fix: added left localizations & subfolders for repo and service in data

* fix: fixed search overlay bug and room deleation

* feat: commit for untranslated.txt

* feat: initial migartion from Stories and Chapter Logic

* feat: Added tests for stories and chapters

* feat: added widgte tests and fixed bugs

---------

Co-authored-by: Madhav Gupta <114633095+M4dhav@users.noreply.github.com>
* fix: Fixed the state error in app prefs page

* feat: MIGRATED ROOMS FROM GETX TO RIVERPOD

* feat: Refactor Profile feature to Riverpod and MVVM

* chore: regenerate code-gen outputs after merge

* feat: friends migration

* fix: fixed broken workflow

* fix: added left localizations & subfolders for repo and service in data

* fix: fixed search overlay bug and room deleation

* feat: commit for untranslated.txt

* feat: initial migartion from Stories and Chapter Logic

* feat: Added tests for stories and chapters

* feat: added widgte tests and fixed bugs

* feat: Migrated themes, snackbar and removed the Getx dependencies

* fix: fixed snackbar, static sizing and live chapter bug

---------

Co-authored-by: Madhav Gupta <114633095+M4dhav@users.noreply.github.com>
* fix: Fixed the state error in app prefs page

* feat: MIGRATED ROOMS FROM GETX TO RIVERPOD

* feat: Refactor Profile feature to Riverpod and MVVM

* chore: regenerate code-gen outputs after merge

* feat: friends migration

* fix: fixed broken workflow

* fix: added left localizations & subfolders for repo and service in data

* fix: fixed search overlay bug and room deleation

* feat: commit for untranslated.txt

* feat: initial migartion from Stories and Chapter Logic

* feat: Added tests for stories and chapters

* feat: added widgte tests and fixed bugs

* feat: Migrated themes, snackbar and removed the Getx dependencies

* fix: fixed snackbar, static sizing and live chapter bug

* feat: Added the leftover tests after complete migration

---------

Co-authored-by: Madhav Gupta <114633095+M4dhav@users.noreply.github.com>
* fix: Fixed the state error in app prefs page

* feat: MIGRATED ROOMS FROM GETX TO RIVERPOD

* feat: Refactor Profile feature to Riverpod and MVVM

* chore: regenerate code-gen outputs after merge

* feat: friends migration

* fix: fixed broken workflow

* fix: added left localizations & subfolders for repo and service in data

* fix: fixed search overlay bug and room deleation

* feat: commit for untranslated.txt

* feat: initial migartion from Stories and Chapter Logic

* feat: Added tests for stories and chapters

* feat: added widgte tests and fixed bugs

* feat: Migrated themes, snackbar and removed the Getx dependencies

* fix: fixed snackbar, static sizing and live chapter bug

* feat: Added the leftover tests after complete migration

* refactor: post migration cleanup

---------

Co-authored-by: Madhav Gupta <114633095+M4dhav@users.noreply.github.com>
@M4dhav M4dhav added gsoc Part of Google Summer of Code season migration labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🎉 Welcome @M4dhav!
Thank you for your pull request! Our team will review it soon. 🔍

  • Please ensure your PR follows the contribution guidelines. ✅
  • All automated tests should pass before merging. 🔄
  • If this PR fixes an issue, link it in the description. 🔗

We appreciate your contribution! 🚀

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 667adf0d-cf1a-42ba-97e3-def56518f2c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@M4dhav M4dhav left a comment

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.

I noticed that in some places in the implementation, A view accesses multiple ViewModels and ViewModels sometimes access each other. This is not consistent with the MVVM pattern, according to which each View should have a 1-1 relationship with ViewModels, and ViewModels should only access the Repository Layer.

Please make changes to restructure the code.

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.

Leave the client as a riverpod keep alive provider but for the rest of them make them static classes

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.

I'd recommend to keep it this way only as it'll make our life vey easy while injecting them in mocks

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.

Make it a static function instead of a riverpod provider

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.

I'd recommend to keep it this way only as mentioned above

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.

GetStorage isn't referenced in many places so the provider shouldn't be keepAlive

Comment thread lib/utils/enums/audio_format.dart Outdated

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.

Making an enum for this is unnecessary as we only use this list to reference pickable audio files

Comment thread lib/utils/enums/lyrics_format.dart Outdated

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.

This is also unnecessary similar to AudioFormat enums

Comment thread lib/shared/widgets/loading_dialog.dart Outdated

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.

This is already present in utils

Comment on lines +11 to +28
String _placeholderIdFor(String themeName) {
switch (themeName) {
case 'amber':
return amberUserProfileImagePlaceholderID;
case 'vintage':
return vintageUserProfileImagePlaceholderID;
case 'time':
return timeUserProfileImagePlaceholderID;
case 'classic':
return classicUserProfileImagePlaceholderID;
case 'forest':
return forestUserProfileImagePlaceholderID;
case 'cream':
return creamUserProfileImagePlaceholderID;
default:
return creamUserProfileImagePlaceholderID;
}
}

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.

Change themes to use an enum instead of a string

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.

Move the search story functionality to explore story notifier

import 'package:resonate/utils/constants.dart';

// Converts the response from the createPairChat API into the parameters needed to join a LiveKit room.
// Temporary, when the full livekit cluster is migrated, it'll be added to core

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.

This comment mentions a migration which is never done

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.

Instead of this special mapper just add these conversions to Story's freezed model

@M4dhav

M4dhav commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@Mayank4352 Please check the review comments above. Feel free to push directly to the state_migration branch for your changes now

@Mayank4352

Copy link
Copy Markdown
Contributor

Hey @M4dhav, Kindly review this PR

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

Labels

gsoc Part of Google Summer of Code season migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants