GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(web): terminal reuses Sidebar's thread shortcut context · pingdotgg/t3code@de963b1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src/components
    • ThreadTerminalDrawer.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/ThreadTerminalDrawer.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/ThreadTerminalDrawer.tsx
+3-11Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ import { openTerminalLinkInPreview } from "./preview/openTerminalLinkInPreview";
9292
import { useAtomCommand } from "../state/use-atom-command";
9393
import { preventTerminalCloseShortcut } from "../lib/terminalCloseShortcut";
9494
import { observeResize } from "../lib/observeResize";
95-
import { selectActiveRightPanel, useRightPanelStore } from "../rightPanelStore";
96-
import { selectThreadTerminalUiState, useTerminalUiStateStore } from "../terminalUiStateStore";
95+
import { threadShortcutContext } from "./Sidebar.logic";
9796
import {
9897
consumePendingTerminalFocus,
9998
focusTerminal,
@@ -578,14 +577,7 @@ function TerminalSessionViewport({
578577
const hasHandledExitRef = useRef(false);
579578
const selectionActionRequestIdRef = useRef(0);
580579
const readKeybindings = useEffectEvent(() => keybindings);
581-
const readThreadNavigationContext = useEffectEvent(() => ({
582-
terminalOpen: selectThreadTerminalUiState(
583-
useTerminalUiStateStore.getState().terminalUiStateByThreadKey,
584-
threadRef,
585-
).terminalOpen,
586-
previewOpen:
587-
selectActiveRightPanel(useRightPanelStore.getState().byThreadKey, threadRef) === "preview",
588-
}));
580+
const readThreadShortcutContext = useEffectEvent(() => threadShortcutContext(threadRef));
589581
const handleSessionExited = useEffectEvent(() => {
590582
if (hasTerminalWriteAccess()) onSessionExited();
591583
});
@@ -952,7 +944,7 @@ function TerminalSessionViewport({
952944
isDiffToggleShortcut(event, currentKeybindings, options) ||
953945
// Match Sidebar's context, or a key it will reject skips the shell.
954946
isThreadNavigationShortcut(event, currentKeybindings, {
955-
context: { ...options.context, ...readThreadNavigationContext() },
947+
context: { ...readThreadShortcutContext(), terminalFocus: true },
956948
})
957949
) {
958950
return false;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.