chore: update workspace dependencies and chat behavior
- Adjust package metadata and lockfiles across the workspace - Refine chat sidebar and auto-scroll behavior in the UI - Update PWA install handling alongside runtime package changes
This commit is contained in:
@@ -584,6 +584,7 @@ export const ChatContainer: React.FC = () => {
|
||||
const handleSessionReselected = (event: Event) => {
|
||||
const customEvent = event as CustomEvent<string>;
|
||||
if (customEvent.detail !== currentSessionId) return;
|
||||
if (isPinned || !isOverflowing || isProgrammaticFollowActive) return;
|
||||
resumeToBottomInstant();
|
||||
};
|
||||
|
||||
@@ -591,7 +592,7 @@ export const ChatContainer: React.FC = () => {
|
||||
return () => {
|
||||
window.removeEventListener(SESSION_RESELECTED_EVENT, handleSessionReselected as EventListener);
|
||||
};
|
||||
}, [currentSessionId, resumeToBottomInstant]);
|
||||
}, [currentSessionId, isOverflowing, isPinned, isProgrammaticFollowActive, resumeToBottomInstant]);
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
const container = scrollRef.current;
|
||||
|
||||
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { toast } from '@/components/ui';
|
||||
import { isWebRuntime } from '@/lib/desktop';
|
||||
import { usePwaDetection } from '@/hooks/usePwaDetection';
|
||||
import { getSafeSessionStorage } from '@/stores/utils/safeStorage';
|
||||
|
||||
type InstallPromptOutcome = 'accepted' | 'dismissed';
|
||||
|
||||
@@ -10,6 +11,8 @@ type BeforeInstallPromptEvent = Event & {
|
||||
userChoice: Promise<{ outcome: InstallPromptOutcome }>;
|
||||
};
|
||||
|
||||
const INSTALL_TOAST_SESSION_KEY = 'pwa-install-toast-shown';
|
||||
|
||||
export const usePwaInstallPrompt = () => {
|
||||
const { browserTab } = usePwaDetection();
|
||||
|
||||
@@ -54,10 +57,17 @@ export const usePwaInstallPrompt = () => {
|
||||
installEvent.preventDefault();
|
||||
deferredPrompt = installEvent;
|
||||
|
||||
const sessionStorage = getSafeSessionStorage();
|
||||
if (sessionStorage.getItem(INSTALL_TOAST_SESSION_KEY) === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (installToastId !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
sessionStorage.setItem(INSTALL_TOAST_SESSION_KEY, 'true');
|
||||
|
||||
installToastId = toast.info('Install OpenChamber for quicker access', {
|
||||
duration: Infinity,
|
||||
action: {
|
||||
|
||||
Reference in New Issue
Block a user