Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(md): remove jank legacy jk handlers from md block to fix focus bug (#3643)

Seamusdc1dbd32d6cb
diff --git a/js/app/packages/app/component/useNavigatedFromJK.ts b/js/app/packages/app/component/useNavigatedFromJK.ts
index 8d7a113b68..bc0e174d54 100644
--- a/js/app/packages/app/component/useNavigatedFromJK.ts
+++ b/js/app/packages/app/component/useNavigatedFromJK.ts
@@ -12,7 +12,9 @@ export function useNavigatedFromJK() {
rows.length > 0 &&
document.documentElement.getAttribute('data-modality') === 'keyboard' &&
(lastExecutedCommand()?.hotkeyToken === TOKENS.entity.step.end ||
- lastExecutedCommand()?.hotkeyToken === TOKENS.entity.select.end)
+ lastExecutedCommand()?.hotkeyToken === TOKENS.entity.step.start ||
+ lastExecutedCommand()?.hotkeyToken === TOKENS.entity.select.end ||
+ lastExecutedCommand()?.hotkeyToken === TOKENS.entity.select.start)
);
});
return { navigatedFromJK };
diff --git a/js/app/packages/block-md/component/Notebook.tsx b/js/app/packages/block-md/component/Notebook.tsx
index 87283ec956..1ff89ecabd 100644
--- a/js/app/packages/block-md/component/Notebook.tsx
+++ b/js/app/packages/block-md/component/Notebook.tsx
@@ -1,4 +1,3 @@
-import { useNavigatedFromJK } from '@app/component/useNavigatedFromJK';
import { CommentMargin } from '@block-md/comments/CommentMargin';
import {
commentsStore,
@@ -84,7 +83,6 @@ export function Notebook() {
const [layoutMode, setLayoutMode] = createSignal(CommentLayoutMode.none);
const [width, setWidth] = createSignal(0);
const [leftFloatX, setLeftFloatX] = createSignal(0);
- const { navigatedFromJK } = useNavigatedFromJK();
const comments = commentsStore.get;
const hasComment = createMemo(() => {
@@ -264,14 +262,14 @@ export function Notebook() {
return (
<div class={containerClasses()} ref={notebookRef}>
<div class={contentDivClasses()} ref={contentRef}>
- <TitleEditor autoFocusOnMount={!navigatedFromJK()} />
+ <TitleEditor autoFocusOnMount />
<div class="spacer h-3" />
<div class="mb-6 flex flex-row flex-wrap items-center gap-2 text-sm empty:hidden">
<InlineTaskProperties />
<InlineTaskGithubPullRequests />
</div>
<ParamsProvider>
- <MarkdownEditor autoFocusOnMount={!navigatedFromJK()} />
+ <MarkdownEditor />
<Show when={ENABLE_RAIL_CHAT_TASK_COMMENTS && isTask}>
<TaskDiscussion />
</Show>