Skip to content

Commit 5676e81

Browse files
committed
fix: satisfy CI formatting and complexity gates
oxfmt on three touched files; buildKeyboardActionSummary split so the dismiss wording (incl. the safeAreaTap mechanism disclosure) lives in its own helper below the complexity threshold.
1 parent 5a604a4 commit 5676e81

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

‎src/cli/parser/__tests__/cli-help-topics.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ test('usageForCommand resolves workflow help topic', async () => {
278278
assert.match(help, /To hide the keyboard, use keyboard dismiss/);
279279
assert.match(help, /falls back to a snapshot-derived safe-area tap/);
280280
assert.match(help, /discloses which mechanism worked \(dismissKey or safeAreaTap\)/);
281-
assert.match(help, /On iOS, if it still returns UNSUPPORTED_OPERATION, both mechanisms were exhausted/);
281+
assert.match(
282+
help,
283+
/On iOS, if it still returns UNSUPPORTED_OPERATION, both mechanisms were exhausted/,
284+
);
282285
assert.match(help, /On Android, keyboard dismiss first avoids navigation/);
283286
assert.match(help, /use back only when normal back behavior is acceptable/);
284287
assert.match(help, /UNSUPPORTED_OPERATION/);

‎src/core/dispatch.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,9 @@ async function handleIosKeyboardCommand(
512512
runnerCtx,
513513
);
514514
const mechanism =
515-
typeof result.keyboardDismissMechanism === 'string' ? result.keyboardDismissMechanism : undefined;
515+
typeof result.keyboardDismissMechanism === 'string'
516+
? result.keyboardDismissMechanism
517+
: undefined;
516518
return {
517519
platform: 'ios',
518520
action: 'dismiss',

‎src/daemon/session-event-action-presentation.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,20 @@ function buildClipboardActionSummary(result: Record<string, unknown>): string {
193193
function buildKeyboardActionSummary(result: Record<string, unknown>): string {
194194
const action = readSessionEventString(result.action);
195195
if (!action || !isKeyboardAction(action)) return 'Used keyboard';
196-
if (action === 'dismiss') {
197-
if (readBoolean(result.dismissed) === false) return 'Keyboard was already hidden';
198-
const mechanism = readSessionEventString(result.mechanism);
199-
return mechanism === 'safeAreaTap' ? 'Dismissed keyboard (safe-area tap)' : 'Dismissed keyboard';
200-
}
196+
if (action === 'dismiss') return buildKeyboardDismissSummary(result);
201197
if (action === 'enter' || action === 'return') return 'Pressed keyboard return';
202198
const visible = readBoolean(result.visible);
203199
if (visible === undefined) return 'Inspected keyboard';
204200
return visible ? 'Keyboard is visible' : 'Keyboard is hidden';
205201
}
206202

203+
function buildKeyboardDismissSummary(result: Record<string, unknown>): string {
204+
if (readBoolean(result.dismissed) === false) return 'Keyboard was already hidden';
205+
return readSessionEventString(result.mechanism) === 'safeAreaTap'
206+
? 'Dismissed keyboard (safe-area tap)'
207+
: 'Dismissed keyboard';
208+
}
209+
207210
function buildKeyboardActionDetails(result: Record<string, unknown>): Record<string, unknown> {
208211
const action = readSessionEventString(result.action);
209212
return compactDetails({

0 commit comments

Comments
 (0)