Skip to content
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

Make left side bar move in/out #192

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

odkhang
Copy link
Collaborator

@odkhang odkhang commented Aug 2, 2024

Summary by Sourcery

Implement a toggle functionality for the left sidebar, allowing it to move in and out with smooth transitions. Refactor the layout to use fixed positioning for the sidebar and adjust the main content area accordingly.

Enhancements:

  • Implement a toggle functionality for the left sidebar, allowing it to move in and out.
  • Add smooth transition effects for the sidebar and related elements to enhance user experience.
  • Refactor the layout to use fixed positioning for the sidebar and adjust the main content area accordingly.

Copy link

sourcery-ai bot commented Aug 2, 2024

Reviewer's Guide by Sourcery

This pull request refactors the sidebar functionality to allow it to move in and out using a button. Key changes include adding ref attributes to key elements, updating the toggleSidebar method to manipulate styles directly, and modifying CSS for smooth transitions. Additionally, several components were updated to ensure full height layout consistency.

File-Level Changes

Files Changes
webapp/src/App.vue
webapp/src/components/RoomsSidebar.vue
webapp/src/components/MediaSource.vue
Refactored sidebar functionality to use direct style manipulation and added a button for toggling the sidebar.
webapp/src/components/Scrollbars.vue
webapp/src/views/rooms/RoomHeader.vue
webapp/src/views/rooms/item.vue
webapp/src/views/schedule/index.vue
Updated various components to ensure full height layout consistency.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @odkhang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using CSS classes instead of inline styles for toggling sidebar visibility. This would improve maintainability and separation of concerns.
  • Replace hard-coded values (e.g., '280px') with CSS variables for better consistency and easier future modifications.
  • Remove commented-out code that is no longer needed to improve code cleanliness.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -151,7 +156,21 @@ export default {
this.$store.dispatch('notifications/clearDesktopNotifications')
},
toggleSidebar () {
this.showSidebar = !this.showSidebar
if(this.$refs.roomsSidebar && this.$refs.roomsSidebar.$el) {
this.$refs.roomsSidebar.$el.style.width = !!this.$refs.roomsSidebar.$el.offsetWidth ? '0px' : '280px';
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider using CSS variables instead of magic numbers

Replace hard-coded values like '280px' with CSS variables. This will improve maintainability and make it easier to adjust these values globally.

this.$refs.roomsSidebar.$el.style.width = !!this.$refs.roomsSidebar.$el.offsetWidth ? '0px' : 'var(--sidebar-width, 280px)';

@@ -210,6 +210,7 @@ $thumb-width-hovered = 12px
box-sizing: border-box
min-height: 0
flex: auto
height: 100vh
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Be cautious with 100vh on mobile browsers

Using 100vh can cause issues on mobile browsers where the viewport height changes when the address bar appears/disappears. Consider using a more robust solution, such as the '100dvh' unit or a JavaScript-based approach.

@mariobehling
Copy link
Member

Yes, the moving in of the sidebar looks good, but how to handle the mobile view? This breaks the mobile view.

This PR:
Screenshot from 2024-08-02 07-24-13
Screenshot from 2024-08-02 07-23-55

Current view on production:
Screenshot from 2024-08-02 07-23-37

@mariobehling
Copy link
Member

I think we could keep the way it currently works on mobile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants