Revert "Make memory and context views mobile-friendly"#817
Conversation
This reverts commit 583c3eb.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... 📒 Files selected for processing (30)
✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. ✨ 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 |
Summary of ChangesHello @gsxdsm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request performs a complete revert of a previous change that introduced mobile-friendly layouts for the Memory and Context views. The changes restore the desktop-first design for these sections of the application, removing all associated mobile-specific UI components, styling, and a large suite of related end-to-end tests. Additionally, it includes minor cleanups in Playwright configuration and test utilities, and removes several temporary test project files. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request reverts a previous change that made the memory and context views mobile-friendly. The changes primarily involve removing responsive layout logic, mobile-specific UI components, and their corresponding tests. While the revert appears to be correctly implemented, it has reintroduced some code duplication for helper functions. I've added comments with suggestions to address this maintainability issue by keeping these helpers in a shared utility file.
| const isMarkdownFile = (filename: string): boolean => { | ||
| const ext = filename.toLowerCase().substring(filename.lastIndexOf('.')); | ||
| return ext === '.md' || ext === '.markdown'; | ||
| }; | ||
|
|
||
| // Determine if a file is an image based on extension | ||
| const isImageFile = (filename: string): boolean => { | ||
| const imageExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.svg', '.bmp']; | ||
| const ext = filename.toLowerCase().substring(filename.lastIndexOf('.')); | ||
| return imageExtensions.includes(ext); | ||
| }; |
There was a problem hiding this comment.
These helper functions, isMarkdownFile and isImageFile, are also defined in apps/ui/src/components/views/memory-view.tsx. This code duplication was likely reintroduced by this revert. To improve maintainability, it would be better to keep these functions in a shared utility file, like apps/ui/src/lib/image-utils.ts where they were previously. This avoids code duplication and potential logic inconsistencies between views.
Additionally, the current implementation of substring(filename.lastIndexOf('.')) can behave unexpectedly for filenames without an extension. The previous implementation in image-utils.ts handled this edge case more robustly by checking if lastIndexOf('.') returns -1.
| const isMarkdownFile = (filename: string): boolean => { | ||
| const ext = filename.toLowerCase().substring(filename.lastIndexOf('.')); | ||
| return ext === '.md' || ext === '.markdown'; | ||
| }; |
There was a problem hiding this comment.
This isMarkdownFile helper function is also defined in apps/ui/src/components/views/context-view.tsx. This code duplication was likely reintroduced by this revert. To improve maintainability, it would be better to keep this function in a shared utility file, like apps/ui/src/lib/image-utils.ts where it was previously. This avoids code duplication and potential logic inconsistencies between views.
Reverts #813
Summary by CodeRabbit
Release Notes