Skip to content

Conversation

@newprogrammer07
Copy link

@newprogrammer07 newprogrammer07 commented Dec 13, 2025

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:

  • Imported share_plus package.
  • Added an IconButton to the RoomAppBar area using a Stack for precise positioning.
  • Configured the button to share a dynamic invite message.

Fixes #xxxx

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Manually tested on an Android emulator.
  • Verified that clicking the "Share" icon opens the system share sheet.
  • Verified that the text "Join me in the room..." appears correctly in the shared message.

Maintainer Checklist

  • closes #xxxx

Summary by CodeRabbit

  • New Features

    • Added a share button to the room screen, allowing users to easily share room names. The button adapts to light and dark themes.
  • Bug Fixes

    • Improved signup reliability by preventing concurrent signup requests.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

🎉 Welcome @newprogrammer07!
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
Copy link

coderabbitai bot commented Dec 13, 2025

Walkthrough

This 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

Cohort / File(s) Summary
Code Ownership Configuration
.github/CODEOWNERS
Added CODEOWNERS file designating ownership
Signup Concurrency Protection
lib/controllers/authentication_controller.dart
Added early guard check (if (isLoading.value) return false;) to prevent concurrent signup invocations
Room Screen Share Feature
lib/views/screens/room_screen.dart
Added share_plus import and implemented right-aligned share button wrapped in Stack overlay with theme-aware styling

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the isLoading guard in signup doesn't introduce unintended side effects or bypass other validation logic
  • Confirm share_plus is already declared as a dependency in pubspec.yaml
  • Validate share button styling renders correctly in both light and dark theme contexts

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 A button to share, so shiny and new,
Guards on the signup, protecting what's true,
CODEOWNERS assigned with a hop and a bound,
The room screen's now social, with sharing profound! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'added share button [Unstoppable Hackathon]' directly and clearly summarizes the main change: adding a share button feature to the room screen as required by the Unstoppable Hackathon task.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between b063ecb and 49fc404.

📒 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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Comment on lines +69 to +70
Future<bool> signup(BuildContext context) async {
if (isLoading.value) return false;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Comment on lines +66 to +86
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! 🚀',
);
},
),
),
],
),
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find . -name "*room_app_bar*" -type f

Repository: AOSSIE-Org/Resonate

Length of output: 100


🏁 Script executed:

cat -n ./lib/views/widgets/room_app_bar.dart

Repository: AOSSIE-Org/Resonate

Length of output: 1225


🏁 Script executed:

sed -n '50,100p' ./lib/views/screens/room_screen.dart | cat -n

Repository: AOSSIE-Org/Resonate

Length of output: 2067


🏁 Script executed:

rg "Positioned.*top:" lib/views/screens/ -A 2 -B 2

Repository: 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).

Comment on lines +79 to +81
Share.share(
'Join me in the room "${widget.room.name}" on Resonate! 🚀',
);
Copy link

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.

@M4dhav
Copy link
Contributor

M4dhav commented Dec 17, 2025

Please create an issue to go along with this PR

@M4dhav
Copy link
Contributor

M4dhav commented Jan 3, 2026

Closing as not planned as discussed in #653

@M4dhav M4dhav closed this Jan 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

PR Closed - Thank You, @newprogrammer07!

  • If this PR was merged: Congratulations! Your contribution is now part of the project. 🚀
  • If this PR was closed without merging: Don’t worry! You can always improve it and submit again. 💪

We appreciate your effort and look forward to more contributions from you! 🤝

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

Labels

unstoppable-hackathon wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants