danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, AWS, OpenAI, Assistants API, Azure, Groq, o1, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
19.05k stars 3.16k forks source link

ios PWA Showing navigation bar on chat selection #2360

Closed davecrab closed 7 months ago

davecrab commented 7 months ago

What happened?

On iOS when using it as a PWA it launches ok and is full screen. However when selecting a chat from the sidebar the top and bottom bars are showing as if it’s opened the chat in a new tab. This was on a fresh install of librechat using the default docker compose I’ve tried clearing the browser cache but had no luck.

Steps to Reproduce

  1. Add librechat to the iOS home screen
  2. Open side bar
  3. Click on a previous chat

What browsers are you seeing the problem on?

Mobile (iOS)

Relevant log output

No response

Screenshots

Screenshot 2024-04-08 at 8 23 13 PM jpeg Screenshot 2024-04-08 at 8 23 31 PM jpeg

Code of Conduct

danny-avila commented 7 months ago

Can't really reproduce this using an iPhone 11 on latest iOS. Also I'm not clear on the exact issue, as all functionality is as expected.

davecrab commented 7 months ago

Hmm weird. Maybe it's something to do with iOS 17.5 or I just completely missed something.

Added vite-plugin-pwa to it and built locally which seems to have fixed it for me.

Thanks for taking a look

danny-avila commented 7 months ago

Hmm weird. Maybe it's something to do with iOS 17.5 or I just completely missed something.

Added vite-plugin-pwa to it and built locally which seems to have fixed it for me.

Thanks for taking a look

interesting, if you think it's useful to the repo as a whole please make a PR!

webzit commented 7 months ago

Thanks to @davecrab for contributing his fixes as a PR. I am experiencing the same issues on both iPadOS 17.4.1 and iOS 17.4.1.

There also seems to be an issue with trying to hide the keyboard by pressing the "Hide keyboard" button on the iPadOS, but only in the PWA and not in Safari itself. (The app does not automatically scroll down again.)

davecrab commented 7 months ago

I have a pr in for it already 👍

webzit commented 6 months ago

Thank you, @davecrab, I tested your PR and it works fine!

I additional commented out "textAreaRef.current?.focus();" in ./client/src/hooks/Input/useTextarea.ts to not always trigger the iOS Keyboard when switching the chat, as it is quite annoying in the pwa app.

I also tried to disable the Safari gestures (Previous/Next) in the pwa app, but to no avail. It would be nice to replace these gestures with expanding/hiding the side menus.