feat(ui): polish chat and git workflows with mobile UX and reliability fixes (#569)
* feat: add chat option for user message rendering mode * feat: add chat option to toggle sticky user header * feat(ui): overhaul context panel with reusable tabs and embedded session chat Enable parallel context workflows with persistent tabbed views and isolated session chat while reducing resize and background runtime overhead. * feat: polish context panel and git sidebar tabs Refined context panel tab behavior and visuals for smoother switching and resizing Reused the new tabs component in right sidebar and git sidebar with fit layout Improved git section spacing, selection controls, and bulk revert confirmation flow * feat: open diff files in editor at changed lines Add edit actions in diff views to open files at the first changed line Support per-file open-in-editor from All Files headers and icon-only action in single-file view Improve file jump UX with load-aware navigation and reduced visual blink during line targeting * fix: stabilize pill tabs and prevent git commit pathspec failures Unified sortable tab variants to match animated styling behavior with responsive spacing and cleaner sidebar chrome Fixed active tab pill measurement so size/position recalculates correctly when dropdowns reopen Commit API now filters stale file paths before staging to avoid pathspec errors on deleted files * fix: align user message action row spacing and hover behavior * fix: persist user message view preferences in settings Save plain-text and sticky-header toggles to settings.json when changed Restore both chat display preferences from settings.json on startup Validate and accept both preference fields in the settings API * fix: improve git and sidebar tab layout on mobile * fix: refine mobile user message action row spacing Show mobile user-message actions in a consistent external row for sticky and non-sticky modes Tune button row height and vertical position to match both mobile variants Reduce sticky-header gradient tail and tighten assistant gap after user messages * fix: improve chat action hover zones and mobile top shadow logic Expand desktop trigger area so user action buttons reveal across the full row Add sticky-header phantom hover row so inline actions appear from the whole button lane Hide chat top scroll shadow on mobile only when sticky user headers are enabled * fix: remove commit message input scrollbar flicker Added optional scrollbar class support to shared textarea wrapper. Disabled overlay scrollbar for Git commit message input. Kept auto-resize behavior while preventing one-line empty-state micro-scroll. * feat: make model provider groups collapsible in selector Add collapsible provider headers in the chat model dropdown Persist expanded/collapsed provider state across sessions Refine provider header UX with inline chevrons and no hover highlight * feat: arrange chat settings into a compact two-column layout Places User Message Rendering next to Mermaid Rendering. Places Diff Layout next to Diff View Mode. Reduces right-column spacing to better match other settings sections. * fix: show worktree branch edit controls in draft sessions Detect worktree mode from current directory when session metadata is not yet bound Enable immediate branch rename UI in Git sidebar without session switching * feat: add beta badge to side panel menu action
This commit is contained in:
committed by
GitHub
parent
73e533a315
commit
b4cd16f55b
@@ -247,7 +247,8 @@ const getMessageFromStore = (sessionId: string, messageId: string): { info: Mess
|
||||
return message;
|
||||
};
|
||||
|
||||
export const useEventStream = () => {
|
||||
export const useEventStream = (options?: { enabled?: boolean }) => {
|
||||
const enabled = options?.enabled ?? true;
|
||||
const {
|
||||
addStreamingPart,
|
||||
completeStreamingMessage,
|
||||
@@ -373,9 +374,13 @@ export const useEventStream = () => {
|
||||
}, [requestPendingPermissionsRefresh]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
requestPendingPermissionsRefresh(true);
|
||||
requestPendingQuestionsRefresh(true);
|
||||
}, [requestPendingPermissionsRefresh, requestPendingQuestionsRefresh]);
|
||||
}, [enabled, requestPendingPermissionsRefresh, requestPendingQuestionsRefresh]);
|
||||
|
||||
const normalizeDirectory = React.useCallback((value: string | null | undefined): string | null => {
|
||||
if (typeof value !== 'string') return null;
|
||||
@@ -2194,6 +2199,12 @@ export const useEventStream = () => {
|
||||
}, [scheduleReconnect]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
stopStream();
|
||||
publishStatus('idle', null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
window.__messageTracker = trackMessage;
|
||||
}
|
||||
@@ -2430,6 +2441,7 @@ export const useEventStream = () => {
|
||||
publishStatus('idle', null);
|
||||
};
|
||||
}, [
|
||||
enabled,
|
||||
effectiveDirectory,
|
||||
trackMessage,
|
||||
resolveVisibilityState,
|
||||
|
||||
@@ -23,9 +23,10 @@ const sendVisibility = (visible: boolean) => {
|
||||
void apis.push.setVisibility({ visible });
|
||||
};
|
||||
|
||||
export const usePushVisibilityBeacon = () => {
|
||||
export const usePushVisibilityBeacon = (options?: { enabled?: boolean }) => {
|
||||
const enabled = options?.enabled ?? true;
|
||||
React.useEffect(() => {
|
||||
if (!isWebRuntime() || typeof document === 'undefined') {
|
||||
if (!enabled || !isWebRuntime() || typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,5 +59,5 @@ export const usePushVisibilityBeacon = () => {
|
||||
window.removeEventListener('focus', report);
|
||||
window.removeEventListener('blur', report);
|
||||
};
|
||||
}, []);
|
||||
}, [enabled]);
|
||||
};
|
||||
|
||||
@@ -101,7 +101,8 @@ const resolveSessionSendConfig = (sessionId: string) => {
|
||||
};
|
||||
};
|
||||
|
||||
export function useQueuedMessageAutoSend() {
|
||||
export function useQueuedMessageAutoSend(options?: { enabled?: boolean }) {
|
||||
const enabled = options?.enabled ?? true;
|
||||
const queuedMessages = useMessageQueueStore((state) => state.queuedMessages);
|
||||
const sessionStatus = useSessionStore((state) => state.sessionStatus);
|
||||
|
||||
@@ -109,6 +110,10 @@ export function useQueuedMessageAutoSend() {
|
||||
const previousStatusRef = React.useRef<Map<string, SessionStatusType>>(new Map());
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const dispatchSessionQueue = async (sessionId: string, queueSnapshot: QueuedMessage[]) => {
|
||||
if (queueSnapshot.length === 0) {
|
||||
return;
|
||||
@@ -187,6 +192,5 @@ export function useQueuedMessageAutoSend() {
|
||||
});
|
||||
|
||||
previousStatusRef.current = nextStatusMap;
|
||||
}, [queuedMessages, sessionStatus]);
|
||||
}, [enabled, queuedMessages, sessionStatus]);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ export const triggerSessionStatusPoll = () => {
|
||||
* Architecture: server maintains authoritative state, client applies snapshots.
|
||||
* SSE remains the primary transport; snapshots repair missed updates.
|
||||
*/
|
||||
export function useServerSessionStatus() {
|
||||
export function useServerSessionStatus(options?: { enabled?: boolean }) {
|
||||
const enabled = options?.enabled ?? true;
|
||||
const isSyncingRef = React.useRef(false);
|
||||
const hasPendingImmediateSyncRef = React.useRef(false);
|
||||
const lastSyncAtRef = React.useRef(0);
|
||||
@@ -260,6 +261,10 @@ export function useServerSessionStatus() {
|
||||
|
||||
// Initial snapshot sync on mount
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
void fetchSessionStatus(true);
|
||||
|
||||
return () => {
|
||||
@@ -270,10 +275,14 @@ export function useServerSessionStatus() {
|
||||
clearTimeout(followUpTimeoutRef.current);
|
||||
}
|
||||
};
|
||||
}, [fetchSessionStatus]);
|
||||
}, [enabled, fetchSessionStatus]);
|
||||
|
||||
// Sync snapshot when tab becomes visible
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handleVisibilityChange = () => {
|
||||
if (document.visibilityState === 'visible') {
|
||||
triggerImmediatePoll();
|
||||
@@ -284,15 +293,20 @@ export function useServerSessionStatus() {
|
||||
return () => {
|
||||
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
||||
};
|
||||
}, [triggerImmediatePoll]);
|
||||
}, [enabled, triggerImmediatePoll]);
|
||||
|
||||
// Update the ref for external access
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
triggerImmediatePollRef = null;
|
||||
return;
|
||||
}
|
||||
|
||||
triggerImmediatePollRef = triggerImmediatePoll;
|
||||
return () => {
|
||||
triggerImmediatePollRef = null;
|
||||
};
|
||||
}, [triggerImmediatePoll]);
|
||||
}, [enabled, triggerImmediatePoll]);
|
||||
|
||||
return {
|
||||
fetchSessionStatus,
|
||||
|
||||
@@ -57,10 +57,12 @@ type CleanupResult = {
|
||||
|
||||
type CleanupOptions = {
|
||||
autoRun?: boolean;
|
||||
enabled?: boolean;
|
||||
};
|
||||
|
||||
export const useSessionAutoCleanup = (options?: CleanupOptions) => {
|
||||
const autoRun = options?.autoRun !== false;
|
||||
const enabled = options?.enabled ?? true;
|
||||
|
||||
const sessions = useSessionStore((state) => state.sessions);
|
||||
const currentSessionId = useSessionStore((state) => state.currentSessionId);
|
||||
@@ -147,6 +149,10 @@ export const useSessionAutoCleanup = (options?: CleanupOptions) => {
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!autoRun) {
|
||||
return;
|
||||
}
|
||||
@@ -166,6 +172,7 @@ export const useSessionAutoCleanup = (options?: CleanupOptions) => {
|
||||
autoDeleteEnabled,
|
||||
autoDeleteLastRunAt,
|
||||
autoRun,
|
||||
enabled,
|
||||
isLoading,
|
||||
sessions.length,
|
||||
runCleanup,
|
||||
|
||||
@@ -9,8 +9,13 @@ type SessionStatusPayload = {
|
||||
next?: number;
|
||||
};
|
||||
|
||||
export const useSessionStatusBootstrap = () => {
|
||||
export const useSessionStatusBootstrap = (options?: { enabled?: boolean }) => {
|
||||
const enabled = options?.enabled ?? true;
|
||||
React.useEffect(() => {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
let cancelled = false;
|
||||
|
||||
const bootstrap = async () => {
|
||||
@@ -38,5 +43,5 @@ export const useSessionStatusBootstrap = () => {
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, []);
|
||||
}, [enabled]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user