You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Positron notebooks have no concept of "output focused" as a distinct focus state. The selection state machine tracks cell-level states (NoCells, SingleSelection, MultiSelection, EditingSelection) but nothing for outputs. Output DOM elements have no tabIndex and focusNotebookCell('output') is a no-op stub.
This means there's no way to bind keyboard shortcuts like Cmd+C to copy an image only when the user has explicitly focused the output area. Without this, Cmd+C either always copies cell source (current behavior after #12331) or always copies the image when one exists (which overrides the more common copy-source operation).
Proposed behavior
Add tabIndex={0} to the output section so users can Tab or click into it
Add a positronNotebookOutputFocused context key that tracks when the output area has DOM focus
When output is focused and the cell has image output, Cmd+C copies the image to clipboard
When the cell container is focused (command mode), Cmd+C copies cell source as usual
Visual focus indicator on the output area so the user knows which region is active
Context
Upstream VSCode notebooks have NOTEBOOK_OUTPUT_FOCUSED (notebookContextKeys.ts) and CellFocusMode.Output for this purpose
There's already a focus trap div between the editor and outputs (CellEditorMonacoWidget.tsx) that could serve as a natural entry point to output focus
Currently Positron notebooks have no concept of "output focused" as a distinct focus state. The selection state machine tracks cell-level states (NoCells, SingleSelection, MultiSelection, EditingSelection) but nothing for outputs. Output DOM elements have no
tabIndexandfocusNotebookCell('output')is a no-op stub.This means there's no way to bind keyboard shortcuts like Cmd+C to copy an image only when the user has explicitly focused the output area. Without this, Cmd+C either always copies cell source (current behavior after #12331) or always copies the image when one exists (which overrides the more common copy-source operation).
Proposed behavior
tabIndex={0}to the output section so users can Tab or click into itpositronNotebookOutputFocusedcontext key that tracks when the output area has DOM focusContext
NOTEBOOK_OUTPUT_FOCUSED(notebookContextKeys.ts) andCellFocusMode.Outputfor this purposeCellEditorMonacoWidget.tsx) that could serve as a natural entry point to output focusReferences
selectionMachine.ts-- Would need a new state or sub-state for output focusContextKeysManager.ts-- Where the new context key would be definedNotebookCodeCell.tsx-- Output section DOM needs focusable elementsCellEditorMonacoWidget.tsx:73-88-- Existing focus trap between editor and outputs