fix(web): delay thread shortcut hints by 200 ms (#8172)
This commit is contained in:
1 parent
afc8342801
commit
e6d487e4f5
2 files changed
+8
-5
No files matched your search
@@ -15,7 +15,7 @@ import { isLatestTurnSettled } from "../session-logic";
|
||||
import { resolveServerBackedAppStageLabel } from "../branding.logic";
|
||||
|
||||
export const THREAD_SELECTION_SAFE_SELECTOR = "[data-thread-item], [data-thread-selection-safe]";
|
||||
export const THREAD_JUMP_HINT_SHOW_DELAY_MS = 100;
|
||||
export const THREAD_JUMP_HINT_SHOW_DELAY_MS = 200;
|
||||
// Visible sidebar rows are prewarmed into the thread-detail cache so opening a
|
||||
// nearby thread usually reuses an already-hot subscription. Each prewarmed
|
||||
// thread holds a live, fully hydrated detail subscription (all messages and
|
||||
|
||||
@@ -142,6 +142,7 @@ import {
|
||||
sortPinnedThreadsForSidebar,
|
||||
sortSettledThreadsForSidebar,
|
||||
sortThreadsForSidebar,
|
||||
useThreadJumpHintVisibility,
|
||||
} from "./Sidebar.logic";
|
||||
import { resolveLocalCheckoutBranchMismatch } from "./BranchToolbar.logic";
|
||||
import {
|
||||
@@ -2308,7 +2309,7 @@ export default function Sidebar() {
|
||||
}
|
||||
return mapping;
|
||||
}, [keybindings, orderedThreadKeys]);
|
||||
const [showJumpHints, setShowJumpHints] = useState(false);
|
||||
const { showThreadJumpHints, updateThreadJumpHintsVisibility } = useThreadJumpHintVisibility();
|
||||
|
||||
// Settled threads are live shells, so opening one is plain navigation:
|
||||
// history stays readable without un-settling, and sending a message or
|
||||
@@ -3342,8 +3343,8 @@ export default function Sidebar() {
|
||||
},
|
||||
);
|
||||
useEffect(() => {
|
||||
setShowJumpHints(shouldShowJumpHintsNow);
|
||||
}, [shouldShowJumpHintsNow]);
|
||||
updateThreadJumpHintsVisibility(shouldShowJumpHintsNow);
|
||||
}, [shouldShowJumpHintsNow, updateThreadJumpHintsVisibility]);
|
||||
|
||||
const attachListAutoAnimateRef = useCallback((node: HTMLUListElement | null) => {
|
||||
if (!node) return;
|
||||
@@ -3721,7 +3722,9 @@ export default function Sidebar() {
|
||||
wokeAt={threadWokeAt(thread, { now: snoozeNow })}
|
||||
isActive={routeThreadKey === threadKey}
|
||||
openPullRequestsInRightPanel={routeThreadRef !== null}
|
||||
jumpLabel={showJumpHints ? (jumpLabelByKey.get(threadKey) ?? null) : null}
|
||||
jumpLabel={
|
||||
showThreadJumpHints ? (jumpLabelByKey.get(threadKey) ?? null) : null
|
||||
}
|
||||
currentEnvironmentId={primaryEnvironmentId}
|
||||
environmentLabel={environmentLabelById.get(thread.environmentId) ?? null}
|
||||
projectCwd={
|
||||
|
||||
Reference in new issue
Block a user