Skip to content

fix(ai-agent): claim mod+backslash only while the panel holds focus - #307

Closed
maksimzinchuk wants to merge 1 commit into
fix/VCST-5632-popup-reopen-and-inertfrom
fix/VCST-5746-panel-chord-scope
Closed

fix(ai-agent): claim mod+backslash only while the panel holds focus#307
maksimzinchuk wants to merge 1 commit into
fix/VCST-5632-popup-reopen-and-inertfrom
fix/VCST-5746-panel-chord-scope

Conversation

@maksimzinchuk

Copy link
Copy Markdown
Collaborator

Closes VCST-5746.

Base is fix/VCST-5632-popup-reopen-and-inert, not main — both branches touch VcAiAgentPanel.vue. Retarget to main after #306 merges.

Problem

The panel consumed mod+\ whenever it was open, so while the assistant was up there was no keyboard route to maximize a blade at all — even with focus demonstrably inside one. That contradicts the targeting model the shell settled on in VCST-5680: a blade shortcut acts on the blade holding focus.

Change

The chord is claimed only when document.activeElement is inside the panel; otherwise the event is left alone and the blade dispatcher handles it. Escape is untouched — consuming it while the panel is open is what keeps the blade behind from closing.

Verified live

Focus location Result
Control in the middle blade, panel open that blade gains vc-blade--maximized; panel stays 362px
Panel's own Maximize control panel 362px500px, --expanded; no blade maximized
Host, panel open Escape closes the panel, all 3 blades intact — unchanged

One caveat about the tests

Focus inside the chat iframe never reaches the host at all — the keystroke goes to the iframe's own document, the same barrier as VCST-5673. So the branch covering the iframe element is unreachable in a browser; it passes in jsdom only because there is no cross-origin boundary there. Do not read that test as proof of browser behaviour.

Expanding the panel from the keyboard while the chat has focus needs the chat-side relay that VCST-5673 describes.

Verification

403 files / 3802 tests green on this branch.

Closes VCST-5746. Built on the VCST-5632 branch, which touches the same
component.

The panel consumed `mod+\` whenever it was open, so while the assistant
was up there was no keyboard route to maximize a blade at all -- even with
focus demonstrably inside one. That contradicts the targeting model the
shell settled on in VCST-5680: a blade shortcut acts on the blade holding
focus.

The chord is now claimed only when `document.activeElement` is inside the
panel; otherwise the event is left alone and the blade dispatcher handles
it. Escape is untouched -- consuming it while the panel is open is what
keeps the blade behind from closing.

Measured live: focus in the middle blade maximizes that blade and leaves
the panel at 362px; focus on the panel's own Maximize control expands the
panel to 500px and maximizes no blade; Escape from the host still closes
the panel with all three blades intact.

One caveat for whoever reads the tests: focus *inside the chat iframe*
never reaches the host at all -- the keystroke goes to the iframe's own
document, same barrier as VCST-5673. So the branch covering the iframe
element is unreachable in a browser; it passes in jsdom only because
there is no cross-origin boundary there. Expanding the panel from the
keyboard while the chat has focus needs the VirtoOz-side relay.
@github-actions

Copy link
Copy Markdown

📦 Preview published for commit 72245d2

Install the preview with dist-tag:

npm install @vc-shell/framework@pr-307

Or pin to the exact commit:

npm install @vc-shell/framework@2.4.0-pr307.72245d2

Published packages (dist-tag pr-307, version 2.4.0-pr307.72245d2):

  • @vc-shell/framework
  • @vc-shell/api-client-generator
  • @vc-shell/create-vc-app
  • @vc-shell/config-generator
  • @vc-shell/migrate
  • @vc-shell/ts-config
  • @vc-shell/mf-config
  • @vc-shell/mf-host
  • @vc-shell/mf-module
  • @vc-shell/vc-app-skill

@maksimzinchuk
maksimzinchuk deleted the branch fix/VCST-5632-popup-reopen-and-inert August 19, 2026 07:19
maksimzinchuk added a commit that referenced this pull request Aug 19, 2026
…310)

Closes VCST-5746.

Replaces #307, which GitHub auto-closed when its base branch
(`fix/VCST-5632-popup-reopen-and-inert`) was deleted on merge of #306.
The branch has since been rebased onto `main`, so it now carries only
its own commit.

## Problem

The panel consumed `mod+\` whenever it was open, so while the assistant
was up there was **no keyboard route to maximize a blade at all** — even
with focus demonstrably inside one. That contradicts the targeting model
the shell settled on in VCST-5680: a blade shortcut acts on the blade
holding focus.

## Change

The chord is claimed only when `document.activeElement` is inside the
panel; otherwise the event is left alone and the blade dispatcher
handles it. Escape is untouched — consuming it while the panel is open
is what keeps the blade behind from closing.

## Verified live

| Focus location | Result |
| --- | --- |
| Control in the middle blade, panel open | that blade gains
`vc-blade--maximized`; panel stays `362px` |
| Panel's own Maximize control | panel `362px` → `500px`, `--expanded`;
no blade maximized |
| Host, panel open | Escape closes the panel, all 3 blades intact —
unchanged |

## One caveat about the tests

Focus *inside the chat iframe* never reaches the host at all — the
keystroke goes to the iframe's own document, the same barrier as
VCST-5673. So the branch covering the iframe element is unreachable in a
browser; it passes in jsdom only because there is no cross-origin
boundary there. Do not read that test as proof of browser behaviour.

Expanding the panel from the keyboard while the chat has focus needs the
relay filed as VirtoCommerce/virto-oz#17.

## Verification

`407 files / 3830 tests` green on this branch, rebased onto current
`main`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant