bannert1337 / open-webui

User-friendly WebUI for LLMs (Formerly Ollama WebUI)
https://openwebui.com
MIT License
0 stars 0 forks source link

sweep: Side Panel Stays Open on Mobile After Selecting "Workspace" #6

Open bannert1337 opened 1 month ago

bannert1337 commented 1 month ago

Bug Report

Description

Bug Summary: On mobile devices, after pressing “Workspace,” the side panel stays open. The workspace opens in the background, but the side panel should close after a selection is made.

Steps to Reproduce:

  1. Open the application on a mobile device.
  2. Press the “Workspace” button on the side panel.
  3. Observe that the side panel remains open while the workspace opens in the background.

Expected Behavior: The side panel should close after selecting “Workspace.”

Actual Behavior: The side panel stays open, obstructing the view of the workspace.

sweep-ai[bot] commented 1 month ago

🚀 Here's the PR! #7

💎 Sweep Pro: You have unlimited Sweep issues

Actions

Step 1: 🔎 Searching

(Click to expand) Here are the code search results. I'm now analyzing these search results to write the PR. https://github.com/bannert1337/open-webui/blob/a8d80f936a69c7e4254c2306b9c88aa7c3e09088/src/lib/components/layout/Sidebar.svelte#L1-L778 https://github.com/bannert1337/open-webui/blob/a8d80f936a69c7e4254c2306b9c88aa7c3e09088/src/routes/(app)/workspace/+layout.svelte#L1-L77 https://github.com/bannert1337/open-webui/blob/a8d80f936a69c7e4254c2306b9c88aa7c3e09088/src/routes/(app)/admin/+layout.svelte#L1-L77 https://github.com/bannert1337/open-webui/blob/a8d80f936a69c7e4254c2306b9c88aa7c3e09088/src/lib/i18n/locales/en-GB/translation.json#L1-L541 https://github.com/bannert1337/open-webui/blob/a8d80f936a69c7e4254c2306b9c88aa7c3e09088/src/lib/i18n/locales/en-US/translation.json#L1-L541

Step 2: ⌨️ Coding

I'm going to follow the following steps to help you solve the GitHub issue:

  1. Close the side panel when the "Workspace" button is clicked on mobile devices.
  2. Detect if the user is on a mobile device before closing the side panel.

Here are the changes we decided to make. I'm done making edits and now I'm just validating the changes using a linter to catch any mistakes like syntax errors or undefined variables:

src/lib/components/layout/Sidebar.svelte

Update the `on:click` event handler for the "Workspace" button to close the side panel on mobile devices.
--- 
+++ 
@@ -5,6 +5,9 @@
                    on:click={() => {
                        selectedChatId = null;
                        chatId.set('');
+                       if ($mobile) {
+                           showSidebar.set(false);
+                       }
                    }}
                    draggable="false"
                >

Step 3: 🔄️ Validating

Your changes have been successfully made to the branch sweep/side_panel_stays_open_on_mobile_after_se. I have validated these changes using a syntax checker and a linter.


[!TIP] To recreate the pull request, edit the issue title or description.

This is an automated message generated by Sweep AI.