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.

836 B
Raw Blame
import { useSoup } from '@app/features/next-soup/soup-context';
import { lastExecutedCommand } from '@core/hotkey/state';
import { TOKENS } from '@core/hotkey/tokens';
import { createMemo } from 'solid-js';

export function useNavigatedFromJK() {
  const soup = useSoup();
  const navigatedFromJK = createMemo(() => {
    const rows = soup.rows();
    if (!rows) return false;
    return (
      rows.length > 0 &&
      document.documentElement.getAttribute('data-modality') === 'keyboard' &&
      (lastExecutedCommand()?.hotkeyToken === TOKENS.entity.step.end ||
        lastExecutedCommand()?.hotkeyToken === TOKENS.entity.step.start ||
        lastExecutedCommand()?.hotkeyToken === TOKENS.entity.select.end ||
        lastExecutedCommand()?.hotkeyToken === TOKENS.entity.select.start)
    );
  });
  return { navigatedFromJK };
}