fix: prevent crash when mobile workspace list is empty#8753
Open
hitesh358-str wants to merge 1 commit into
Open
fix: prevent crash when mobile workspace list is empty#8753hitesh358-str wants to merge 1 commit into
hitesh358-str wants to merge 1 commit into
Conversation
Contributor
|
🧙 Sourcery is reviewing your pull request! Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In the widget test, consider using a more specific finder (e.g., by text or a key) instead of
find.byType(ElevatedButton)to avoid brittleness if additional buttons are added to the screen in the future. - The
onPressedlogic inMobileWorkspaceStartScreen’sElevatedButtonis starting to get a bit dense; consider extracting the workspace-selection and_popToWorkspacedecision into a small helper method to keep thebuildmethod easier to scan.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the widget test, consider using a more specific finder (e.g., by text or a key) instead of `find.byType(ElevatedButton)` to avoid brittleness if additional buttons are added to the screen in the future.
- The `onPressed` logic in `MobileWorkspaceStartScreen`’s `ElevatedButton` is starting to get a bit dense; consider extracting the workspace-selection and `_popToWorkspace` decision into a small helper method to keep the `build` method easier to scan.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR prevents a crash in
MobileWorkspaceStartScreenwhen the workspace list is empty.Root Cause
The
Get Startedbutton accessed:widget.workspaceState.workspaces.firstwhen
selectedWorkspace == null.If the workspace list was empty, this caused:
Bad state: No elementChanges
Testing
.firstaccess occurs on empty listsPR Checklist
Summary by Sourcery
Prevent MobileWorkspaceStartScreen from crashing when the workspace list is empty and add coverage for the empty state.
Bug Fixes:
Tests: