feat: move projects to sidebar rail and speed up session switching (#506)
* feat: move projects from header tabs to left sidebar rail * refactor: remove variant from git generation session context * feat: implemented drandrop action for navrails * refactor: improve sidebar drag-and-drop smoothness and remove floating overlay * fix: prevent mobile nav rail touch from closing drawer and opening menu * fix: hide header tabs on desktop * fix: prevent session flicker when switching projects * style: soften chat panel divider borders * style: improve icon contrast across core navigation * fix: stabilize session selection during project switching * style: unify sidebar surfaces and transparent section layers * style: remove UI shadows and keep only scroll shadow * perf: speed up project switching with cached session loading * perf: speed up Git changes view and background refresh * perf: make session switching lighter and less aggressive * perf: optimized sessions list loading while project switching * perf: smooth chat rendering and reduce interaction spikes * fix: restore reliable load older messages visibility
This commit is contained in:
committed by
GitHub
parent
4c69bccf56
commit
10851bd7ac
@@ -176,8 +176,8 @@ export const ChatContainer: React.FC = () => {
|
||||
const [turnStart, setTurnStart] = React.useState(0);
|
||||
const turnHandleRef = React.useRef<number | null>(null);
|
||||
const turnIdleRef = React.useRef(false);
|
||||
const TURN_INIT = 20;
|
||||
const TURN_BATCH = 20;
|
||||
const TURN_INIT = 5;
|
||||
const TURN_BATCH = 8;
|
||||
|
||||
const userTurnIndexes = React.useMemo(() => {
|
||||
const indexes: number[] = [];
|
||||
@@ -304,7 +304,7 @@ export const ChatContainer: React.FC = () => {
|
||||
|
||||
const hasMoreAbove = React.useMemo(() => {
|
||||
if (!memoryState) {
|
||||
return false;
|
||||
return sessionMessages.length >= getMemoryLimits().HISTORICAL_MESSAGES;
|
||||
}
|
||||
if (memoryState.historyComplete === true) {
|
||||
return false;
|
||||
@@ -323,6 +323,13 @@ export const ChatContainer: React.FC = () => {
|
||||
|
||||
return false;
|
||||
}, [memoryState, sessionMessages.length]);
|
||||
|
||||
const hasHistoryMetadata = React.useMemo(() => {
|
||||
if (!memoryState) {
|
||||
return false;
|
||||
}
|
||||
return memoryState.hasMoreAbove !== undefined || memoryState.historyComplete !== undefined;
|
||||
}, [memoryState]);
|
||||
const [isLoadingOlder, setIsLoadingOlder] = React.useState(false);
|
||||
React.useEffect(() => {
|
||||
setIsLoadingOlder(false);
|
||||
@@ -384,7 +391,7 @@ export const ChatContainer: React.FC = () => {
|
||||
}
|
||||
|
||||
const hasSessionMessages = hasSessionMessagesEntry;
|
||||
if (hasSessionMessages) {
|
||||
if (hasSessionMessages && hasHistoryMetadata) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -410,7 +417,7 @@ export const ChatContainer: React.FC = () => {
|
||||
};
|
||||
|
||||
void load();
|
||||
}, [currentSessionId, hasSessionMessagesEntry, isPinned, loadMessages, scrollToBottom, sessionMessages.length, sessionStatusForCurrent.type]);
|
||||
}, [currentSessionId, hasHistoryMetadata, hasSessionMessagesEntry, isPinned, loadMessages, scrollToBottom, sessionMessages.length, sessionStatusForCurrent.type]);
|
||||
|
||||
if (!currentSessionId && !draftOpen) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user