-
Notifications
You must be signed in to change notification settings - Fork 305
added share button [Unstoppable Hackathon] #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added share button [Unstoppable Hackathon] #650
Conversation
|
🎉 Welcome @newprogrammer07!
We appreciate your contribution! 🚀 |
WalkthroughThis PR adds ownership configuration via CODEOWNERS, implements a concurrency guard in signup to prevent overlapping requests, and introduces a theme-aware share button to the room screen using the share_plus package. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/CODEOWNERS(1 hunks)lib/controllers/authentication_controller.dart(1 hunks)lib/views/screens/room_screen.dart(3 hunks)
| @@ -0,0 +1 @@ | |||
| * @M4dhav No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this unrelated change to a separate PR.
The CODEOWNERS file change is unrelated to the share button feature described in the PR objectives. Code ownership configuration should be reviewed and merged separately as it affects the review process for all future PRs.
🤖 Prompt for AI Agents
.github/CODEOWNERS lines 1-1: This change to CODEOWNERS is unrelated to the
share button feature and must be moved to a separate PR; revert or remove this
line from the current branch so the CODEOWNERS file in this PR remains
unchanged, then create a new dedicated branch/PR containing only the CODEOWNERS
modification with a clear title and description for reviewers to approve
independently.
| Future<bool> signup(BuildContext context) async { | ||
| if (isLoading.value) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this unrelated change to a separate PR.
The concurrency guard for signup is unrelated to the share button feature described in the PR objectives. While the implementation is correct, this functional change should be reviewed and tested separately.
🤖 Prompt for AI Agents
In lib/controllers/authentication_controller.dart around lines 69 to 70, the
added concurrency guard "if (isLoading.value) return false;" is an unrelated
functional change and should not be included in this PR; revert that addition in
this branch so the signup behavior remains as before, commit the revert, and
keep the share-button feature changes isolated, then create a new branch/PR for
the concurrency guard where you add the guard, include unit/widget tests for the
new behavior, and document the change in the PR description for separate review
and testing.
| Stack( | ||
| alignment: Alignment.centerRight, | ||
| children: [ | ||
| const RoomAppBar(), | ||
| Positioned( | ||
| right: 16, | ||
| top: 40, // Adjusts for Status Bar | ||
| child: IconButton( | ||
| icon: const Icon(Icons.share), | ||
| color: Theme.of(context).brightness == Brightness.light | ||
| ? Colors.black | ||
| : Colors.white, | ||
| onPressed: () { | ||
| Share.share( | ||
| 'Join me in the room "${widget.room.name}" on Resonate! 🚀', | ||
| ); | ||
| }, | ||
| ), | ||
| ), | ||
| ], | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
find . -name "*room_app_bar*" -type fRepository: AOSSIE-Org/Resonate
Length of output: 100
🏁 Script executed:
cat -n ./lib/views/widgets/room_app_bar.dartRepository: AOSSIE-Org/Resonate
Length of output: 1225
🏁 Script executed:
sed -n '50,100p' ./lib/views/screens/room_screen.dart | cat -nRepository: AOSSIE-Org/Resonate
Length of output: 2067
🏁 Script executed:
rg "Positioned.*top:" lib/views/screens/ -A 2 -B 2Repository: AOSSIE-Org/Resonate
Length of output: 45
Fix hardcoded status bar offset for cross-device compatibility.
The top: 40 value assumes a fixed status bar height, which varies significantly across devices (iOS: 20-44dp+ with notch/dynamic island, Android: 24-25dp). Use MediaQuery.of(context).padding.top + 8 instead to adapt to the actual device status bar height.
The Stack sizing and RoomAppBar structure are appropriate—AppBar provides intrinsic dimensions automatically, and there are no layout conflicts since RoomAppBar currently has no trailing actions.
Stack(
alignment: Alignment.centerRight,
children: [
const RoomAppBar(),
Positioned(
right: 16,
- top: 40, // Adjusts for Status Bar
+ top: MediaQuery.of(context).padding.top + 8,
child: IconButton(🤖 Prompt for AI Agents
In lib/views/screens/room_screen.dart around lines 66 to 86 the share IconButton
uses a hardcoded top: 40 to offset the status bar which breaks on devices with
different status bar heights; replace the fixed value with a dynamic offset
using MediaQuery.of(context).padding.top + 8 so the button is positioned
relative to the actual status bar height (use the existing BuildContext already
in scope).
| Share.share( | ||
| 'Join me in the room "${widget.room.name}" on Resonate! 🚀', | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Share a joinable deep link instead of plain text.
The current implementation shares only descriptive text without a functional link. Users receiving the share cannot actually join the room. Consider implementing deep linking or including a web URL that directs users to the room.
Example implementation with a deep link:
onPressed: () {
final roomId = widget.room.id; // or appropriate identifier
final deepLink = 'resonate://room/$roomId'; // or https://resonate.app/room/$roomId
Share.share(
'Join me in the room "${widget.room.name}" on Resonate! 🚀\n\n$deepLink',
);
},🤖 Prompt for AI Agents
In lib/views/screens/room_screen.dart around lines 79 to 81, the Share.share
call only sends descriptive text; change it to include a joinable deep link or
web URL so recipients can open/join the room. Construct the link using the room
identifier (e.g., widget.room.id) and append it to the share body (use a
resonate://deep-link or https://resonate.app/room/<id>), URL-encode the id if
needed, and update the Share.share invocation to include both the message and
the generated link; also guard against a missing id by providing a fallback URL
or message.
|
Please create an issue to go along with this PR |
|
Closing as not planned as discussed in #653 |
|
✅ PR Closed - Thank You, @newprogrammer07!
We appreciate your effort and look forward to more contributions from you! 🤝 |
Description
The Feature: Added a "Share" button to the Room Screen's AppBar.
Motivation: As per the "Unstoppable Hackathon Tasks" list, the app required better shareability. This button triggers the native system share dialog, allowing users to share the room link to external apps (WhatsApp, Twitter, etc.).
Implementation:
share_pluspackage.IconButtonto theRoomAppBararea using aStackfor precise positioning.Fixes #xxxx
Type of change
How Has This Been Tested?
Maintainer Checklist
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.