mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 13:39:41 +02:00
feat(web): remove /compact button from mobile keyboard accessory bar
Drops /compact from both the simple and extended accessory-bar layouts, the action handler (case folded back to clear-only), the refocus guard, and the JSDoc. /clear retains its double-tap confirmation. Verified on a touch-emulated viewport: neither layout renders a compact action. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,10 +4,10 @@
|
|||||||
* Defines two exports:
|
* Defines two exports:
|
||||||
*
|
*
|
||||||
* - KeyboardAccessoryBar (singleton object) — Quick action buttons shown above the virtual
|
* - KeyboardAccessoryBar (singleton object) — Quick action buttons shown above the virtual
|
||||||
* keyboard on mobile: arrow up/down, /init, /clear, /compact, paste, and dismiss.
|
* keyboard on mobile: arrow up/down, /init, /clear, paste, and dismiss.
|
||||||
* The paste button opens a dialog that handles both text paste and image attach
|
* The paste button opens a dialog that handles both text paste and image attach
|
||||||
* (native picker + best-effort image paste, routed through app._uploadAndInsertImages).
|
* (native picker + best-effort image paste, routed through app._uploadAndInsertImages).
|
||||||
* Destructive actions (/clear, /compact) require double-tap confirmation (2s amber state).
|
* Destructive actions (/clear) require double-tap confirmation (2s amber state).
|
||||||
* Commands are sent as text + Enter separately for Ink compatibility.
|
* Commands are sent as text + Enter separately for Ink compatibility.
|
||||||
* Only initializes on touch devices (MobileDetection.isTouchDevice guard).
|
* Only initializes on touch devices (MobileDetection.isTouchDevice guard).
|
||||||
*
|
*
|
||||||
@@ -51,7 +51,6 @@ const KeyboardAccessoryBar = {
|
|||||||
</button>
|
</button>
|
||||||
<button class="accessory-btn" data-action="init" title="/init">/init</button>
|
<button class="accessory-btn" data-action="init" title="/init">/init</button>
|
||||||
<button class="accessory-btn" data-action="clear" title="/clear">/clear</button>
|
<button class="accessory-btn" data-action="clear" title="/clear">/clear</button>
|
||||||
<button class="accessory-btn" data-action="compact" title="/compact">/compact</button>
|
|
||||||
<button class="accessory-btn" data-action="paste" title="Paste from clipboard">
|
<button class="accessory-btn" data-action="paste" title="Paste from clipboard">
|
||||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
|
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
|
||||||
@@ -100,7 +99,6 @@ const KeyboardAccessoryBar = {
|
|||||||
<button class="accessory-btn" data-action="esc" title="Escape">Esc</button>
|
<button class="accessory-btn" data-action="esc" title="Escape">Esc</button>
|
||||||
<button class="accessory-btn" data-action="init" title="/init">/init</button>
|
<button class="accessory-btn" data-action="init" title="/init">/init</button>
|
||||||
<button class="accessory-btn" data-action="clear" title="/clear">/clear</button>
|
<button class="accessory-btn" data-action="clear" title="/clear">/clear</button>
|
||||||
<button class="accessory-btn" data-action="compact" title="/compact">/compact</button>
|
|
||||||
<button class="accessory-btn accessory-btn-dismiss" data-action="dismiss" title="Dismiss keyboard">
|
<button class="accessory-btn accessory-btn-dismiss" data-action="dismiss" title="Dismiss keyboard">
|
||||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3">
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3">
|
||||||
<path d="M19 9l-7 7-7-7"/>
|
<path d="M19 9l-7 7-7-7"/>
|
||||||
@@ -130,7 +128,7 @@ const KeyboardAccessoryBar = {
|
|||||||
// Refocus terminal so keyboard stays open (tap blurs terminal → keyboard dismisses → toolbar shifts)
|
// Refocus terminal so keyboard stays open (tap blurs terminal → keyboard dismisses → toolbar shifts)
|
||||||
const refocusActions = new Set(['scroll-up', 'scroll-down', 'arrow-left', 'arrow-right', 'tab', 'shift-tab', 'ctrl-o', 'opt-enter', 'esc', 'effort-max']);
|
const refocusActions = new Set(['scroll-up', 'scroll-down', 'arrow-left', 'arrow-right', 'tab', 'shift-tab', 'ctrl-o', 'opt-enter', 'esc', 'effort-max']);
|
||||||
if (refocusActions.has(action) ||
|
if (refocusActions.has(action) ||
|
||||||
((action === 'clear' || action === 'compact') && this._confirmAction)) {
|
(action === 'clear' && this._confirmAction)) {
|
||||||
if (typeof app !== 'undefined' && app.terminal) {
|
if (typeof app !== 'undefined' && app.terminal) {
|
||||||
app.terminal.focus();
|
app.terminal.focus();
|
||||||
}
|
}
|
||||||
@@ -193,13 +191,11 @@ const KeyboardAccessoryBar = {
|
|||||||
case 'init':
|
case 'init':
|
||||||
this.sendCommand('/init');
|
this.sendCommand('/init');
|
||||||
break;
|
break;
|
||||||
case 'clear':
|
case 'clear': {
|
||||||
case 'compact': {
|
|
||||||
// Require double-tap: first tap turns amber, second tap within 2s sends
|
// Require double-tap: first tap turns amber, second tap within 2s sends
|
||||||
const cmd = action === 'clear' ? '/clear' : '/compact';
|
|
||||||
if (this._confirmAction === action && this._confirmTimer) {
|
if (this._confirmAction === action && this._confirmTimer) {
|
||||||
this.clearConfirm();
|
this.clearConfirm();
|
||||||
this.sendCommand(cmd);
|
this.sendCommand('/clear');
|
||||||
} else {
|
} else {
|
||||||
this.setConfirm(action, btn);
|
this.setConfirm(action, btn);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user