-
Notifications
You must be signed in to change notification settings - Fork 463
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
Chat and other minor fixes #827
Conversation
WalkthroughThis pull request primarily focuses on enhancing user interaction and updating branding details. Changes include UI adjustments for button styling and behavior, improved plugin selection logic on the home page, and updates to header strings and privacy policy URLs to reflect a new domain. Changes
Uplevel your code reviews with Entelligence.AI ProEntelligence.AI ProIf you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, Entelligence.AI Pro is free for open source projects. |
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.
Files selected (5)
- app/lib/pages/capture/widgets/widgets.dart (1)
- app/lib/pages/home/page.dart (1)
- app/lib/pages/memory_detail/share.dart (1)
- app/lib/pages/plugins/page.dart (1)
- app/lib/providers/auth_provider.dart (1)
Files skipped from review due to trivial changes (3)
- app/lib/pages/memory_detail/share.dart
- app/lib/pages/plugins/page.dart
- app/lib/providers/auth_provider.dart
Review comments generated (2)
- Review: 2
- LGTM: 0
Tips
Chat with Entelligence.AI Bot (@Entelligence.AI
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@Entelligence.AI
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@Entelligence.AI: ignore
anywhere in the PR description to pause further reviews from the bot.
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 0), | ||
decoration: BoxDecoration( | ||
border: const GradientBoxBorder( | ||
gradient: LinearGradient(colors: [ | ||
Color.fromARGB(127, 208, 208, 208), | ||
Color.fromARGB(127, 188, 99, 121), | ||
Color.fromARGB(127, 86, 101, 182), | ||
Color.fromARGB(127, 126, 190, 236) | ||
]), | ||
width: 2, | ||
), | ||
child: TextButton( | ||
onPressed: () { | ||
launchUrl(Uri.parse('https://basedhardware.com')); | ||
MixpanelManager().getFriendClicked(); | ||
}, | ||
child: const Text( | ||
'Get a Friend', | ||
style: TextStyle(color: Colors.white, fontSize: 16), | ||
))), | ||
borderRadius: BorderRadius.circular(12), | ||
), | ||
child: TextButton( | ||
onPressed: () { | ||
launchUrl(Uri.parse('https://omi.me')); | ||
MixpanelManager().getFriendClicked(); | ||
}, | ||
child: const Text( | ||
'Get a Friend', | ||
style: TextStyle(color: Colors.white, fontSize: 16), | ||
), | ||
), |
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.
The URL in the launchUrl
function has been updated from 'https://basedhardware.com' to 'https://omi.me'. Ensure that this new URL is correct and functional. Also, make sure that the associated analytics event MixpanelManager().getFriendClicked();
is still relevant and correctly configured for this new URL.
- launchUrl(Uri.parse('https://basedhardware.com'));
+ launchUrl(Uri.parse('https://omi.me'));
MixpanelManager().getFriendClicked();
If there are any changes needed in the analytics configuration due to this URL change, please update it accordingly.
child: provider.plugins.where((p) => p.enabled).isEmpty | ||
? GestureDetector( | ||
onTap: () { | ||
Navigator.of(context) | ||
.push(MaterialPageRoute(builder: (c) => const PluginsPage(filterChatOnly: true))); | ||
}, | ||
child: const Row( | ||
children: [ | ||
Icon(size: 20, Icons.chat, color: Colors.white), | ||
SizedBox(width: 10), | ||
Text('Enable Plugins', | ||
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 16)), | ||
], | ||
), | ||
) | ||
: Container( | ||
padding: const EdgeInsets.symmetric(horizontal: 16), | ||
child: DropdownButton<String>( | ||
menuMaxHeight: 350, | ||
value: SharedPreferencesUtil().selectedChatPluginId, | ||
onChanged: (s) async { | ||
if ((s == 'no_selected' && provider.plugins.where((p) => p.enabled).isEmpty) || | ||
s == 'enable') { | ||
await routeToPage(context, const PluginsPage(filterChatOnly: true)); | ||
return; | ||
} | ||
print('Selected: $s prefs: ${SharedPreferencesUtil().selectedChatPluginId}'); | ||
if (s == null || s == SharedPreferencesUtil().selectedChatPluginId) return; | ||
SharedPreferencesUtil().selectedChatPluginId = s; | ||
var plugin = provider.plugins.firstWhereOrNull((p) => p.id == s); | ||
chatPageKey.currentState?.sendInitialPluginMessage(plugin); | ||
}, | ||
icon: Container(), | ||
alignment: Alignment.center, | ||
dropdownColor: Colors.black, | ||
style: const TextStyle(color: Colors.white, fontSize: 16), | ||
underline: Container(height: 0, color: Colors.transparent), | ||
isExpanded: false, | ||
itemHeight: 48, | ||
padding: EdgeInsets.zero, | ||
items: _getPluginsDropdownItems(context, provider), | ||
), | ||
), |
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.
The new code introduces a check to see if any plugins are enabled. If no plugins are enabled, it shows a message prompting the user to enable them. This is a good UX improvement as it provides clear instructions to the user when no plugins are enabled. However, there's a potential issue with this implementation. The SharedPreferencesUtil().selectedChatPluginId
is being accessed multiple times in this function. Each access could potentially result in a disk I/O operation which can be expensive and slow down the UI. It would be better to store the value in a local variable at the start of the function and use that instead.
- value: SharedPreferencesUtil().selectedChatPluginId,
+ String selectedChatPluginId = SharedPreferencesUtil().selectedChatPluginId;
+ value: selectedChatPluginId,
- print('Selected: $s prefs: ${SharedPreferencesUtil().selectedChatPluginId}');
+ print('Selected: $s prefs: $selectedChatPluginId');
- if (s == null || s == SharedPreferencesUtil().selectedChatPluginId) return;
+ if (s == null || s == selectedChatPluginId) return;
- SharedPreferencesUtil().selectedChatPluginId = s;
+ selectedChatPluginId = s;
Also, the print statement on line 465 seems like debug code that should not be in production. Consider removing it or replacing it with proper logging if necessary.
Summary by Entelligence.AI