auq-mcp-server 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json
CHANGED
|
@@ -49,6 +49,8 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
49
49
|
const { stdout } = useStdout();
|
|
50
50
|
const terminalRows = stdout?.rows ?? 24;
|
|
51
51
|
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
52
|
+
const isOverflowingRef = useRef(isOverflowing);
|
|
53
|
+
isOverflowingRef.current = isOverflowing;
|
|
52
54
|
// Report progress when question index changes
|
|
53
55
|
useEffect(() => {
|
|
54
56
|
if (onProgress) {
|
|
@@ -65,6 +67,10 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
65
67
|
sessionRequest.questions.length,
|
|
66
68
|
onProgress,
|
|
67
69
|
]);
|
|
70
|
+
// Reset focused option to first when switching between questions
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
setFocusedOptionIndex(0);
|
|
73
|
+
}, [currentQuestionIndex]);
|
|
68
74
|
// Handle option selection (single-select mode)
|
|
69
75
|
const handleSelectOption = (label) => {
|
|
70
76
|
setAnswers((prev) => {
|
|
@@ -205,14 +211,14 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
205
211
|
// Update elapsed time since session creation
|
|
206
212
|
// IMPORTANT: Pause when content overflows terminal to prevent scroll-snapping
|
|
207
213
|
useEffect(() => {
|
|
208
|
-
if (isOverflowing)
|
|
209
|
-
return;
|
|
210
214
|
const timer = setInterval(() => {
|
|
215
|
+
if (isOverflowingRef.current)
|
|
216
|
+
return;
|
|
211
217
|
const elapsed = Math.floor((Date.now() - sessionCreatedAt) / 1000);
|
|
212
218
|
setElapsedSeconds(elapsed >= 0 ? elapsed : 0);
|
|
213
219
|
}, 1000);
|
|
214
220
|
return () => clearInterval(timer);
|
|
215
|
-
}, [sessionCreatedAt
|
|
221
|
+
}, [sessionCreatedAt]);
|
|
216
222
|
// Detect overflow: estimate content height vs terminal rows
|
|
217
223
|
useEffect(() => {
|
|
218
224
|
const currentQ = sessionRequest.questions[safeIndex];
|
|
@@ -341,6 +347,11 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
341
347
|
// Don't handle navigation when showing review, submitting, or confirming rejection
|
|
342
348
|
if (showReview || submitting || showRejectionConfirm)
|
|
343
349
|
return;
|
|
350
|
+
// Derive text-input state from both focusContext and focusedOptionIndex
|
|
351
|
+
// focusContext may lag by one render cycle (set via useEffect in OptionsList)
|
|
352
|
+
// focusedOptionIndex is set directly and always up-to-date
|
|
353
|
+
const isInTextInput = focusContext !== "option" ||
|
|
354
|
+
focusedOptionIndex >= currentQuestion.options.length;
|
|
344
355
|
// Esc key - show rejection confirmation
|
|
345
356
|
if (key.escape) {
|
|
346
357
|
setShowRejectionConfirm(true);
|
|
@@ -350,7 +361,7 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
350
361
|
if (input.toLowerCase() === "r" &&
|
|
351
362
|
key.ctrl &&
|
|
352
363
|
hasAnyRecommendedInSession &&
|
|
353
|
-
|
|
364
|
+
!isInTextInput) {
|
|
354
365
|
// Auto-fill all unanswered questions with recommended options
|
|
355
366
|
const newAnswers = new Map(answers);
|
|
356
367
|
for (let i = 0; i < sessionRequest.questions.length; i++) {
|
|
@@ -386,7 +397,7 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
386
397
|
// R key: Select recommended options for current question
|
|
387
398
|
if (input.toLowerCase() === "r" &&
|
|
388
399
|
!key.ctrl &&
|
|
389
|
-
|
|
400
|
+
!isInTextInput &&
|
|
390
401
|
hasRecommendedOptions) {
|
|
391
402
|
const question = currentQuestion;
|
|
392
403
|
const recommendedOptions = question.options.filter((opt) => isRecommendedOption(opt.label));
|
|
@@ -410,10 +421,7 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
410
421
|
return;
|
|
411
422
|
}
|
|
412
423
|
// Tab/Shift+Tab: Global question navigation
|
|
413
|
-
|
|
414
|
-
if (key.tab &&
|
|
415
|
-
focusContext !== "custom-input" &&
|
|
416
|
-
focusContext !== "elaborate-input") {
|
|
424
|
+
if (key.tab && !isInTextInput) {
|
|
417
425
|
if (key.shift) {
|
|
418
426
|
setCurrentQuestionIndex((prev) => Math.max(0, prev - 1));
|
|
419
427
|
}
|
|
@@ -422,11 +430,11 @@ export const StepperView = ({ onComplete, onProgress, hasMultipleSessions, initi
|
|
|
422
430
|
}
|
|
423
431
|
return;
|
|
424
432
|
}
|
|
425
|
-
|
|
426
|
-
if (
|
|
433
|
+
// Left/Right arrow: question navigation (only when NOT in text input)
|
|
434
|
+
if (!isInTextInput && key.leftArrow && currentQuestionIndex > 0) {
|
|
427
435
|
setCurrentQuestionIndex((prev) => prev - 1);
|
|
428
436
|
}
|
|
429
|
-
if (
|
|
437
|
+
if (!isInTextInput &&
|
|
430
438
|
key.rightArrow &&
|
|
431
439
|
currentQuestionIndex < sessionRequest.questions.length - 1) {
|
|
432
440
|
setCurrentQuestionIndex((prev) => prev + 1);
|