Skip to content

fix(app): dismiss question dock after skipping when all questions are settled#387

Merged
Astro-Han merged 2 commits into
devfrom
pawwork/fix-question-skip-single
May 2, 2026
Merged

fix(app): dismiss question dock after skipping when all questions are settled#387
Astro-Han merged 2 commits into
devfrom
pawwork/fix-question-skip-single

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

When the user clicks "Skip" on a single-question dock (or the last question), the dock now auto-submits and closes instead of staying open with no visible action.

Why

skipCurrent cleared the answer to [] but then just refocused the same question when no unsettled questions remained. The user had to notice the subtle progress-dot change and click Submit as a second step. On a single-question dock, this made skipping feel broken.

next() already handled the last-question case by calling submit()skipCurrent now does the same.

Related Issue

None.

Review Focus

  • The extracted resolveSkipAction pure function and its test coverage
  • The changed behavior: skip on last question → auto-submit (same as pressing Submit)

Risk Notes

None. The behavior change only applies when all questions are already settled after skipping, which is exactly the case where the user wants to dismiss the dock.

How To Verify

Focused tests: 5 passed (resolveSkipAction)
Full unit suite: 670 passed, 0 failed
TypeScript: clean

Checklist

  • Human review status is pending
  • No related issue
  • Requesting maintainer labeling
  • Review focus and risks described
  • Verification steps listed with results
  • No unrelated refactors or file changes
  • No visible UI change (behavioral fix only)
  • Cross-platform: N/A (web-only component)
  • Final diff reviewed, no suspicious changes
  • Targeting dev, Conventional Commits in English

Summary by CodeRabbit

  • Tests

    • Added comprehensive unit tests covering skip-question behavior, including navigation to the next unsettled question (including wrap-around), and submit behavior when all questions are settled.
  • Bug Fixes

    • Skip action now navigates to the appropriate next unsettled question (preferring subsequent tabs, then earlier ones) and automatically submits when no unsettled questions remain.

… settled

When skipCurrent was called on the last question (or when there is only
one question), it cleared the answer but stayed on the same page without
any visible action. The user was stuck and needed to click Submit
separately.

Extract resolveSkipAction as a pure decision function and make
skipCurrent call submit() when no unsettled questions remain,
consistent with how next() already auto-submits on the last question.
@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 578e67e3-ea7f-499b-a571-da073c7abc71

📥 Commits

Reviewing files that changed from the base of the PR and between b8da4f6 and 367b604.

📒 Files selected for processing (1)
  • packages/app/src/pages/session/composer/session-question-dock.tsx

📝 Walkthrough

Walkthrough

Adds an exported helper resolveSkipAction that decides whether skipping the current question should navigate to the next unsettled question (preferring later tabs, then earlier) or trigger submission, and updates skipCurrent to use it. Adds Bun tests covering five scenarios for this behavior.

Changes

Skip Logic Enhancement

Layer / File(s) Summary
Data / Decision Shape
packages/app/src/pages/session/composer/session-question-dock.tsx
Adds exported resolveSkipAction(currentTab: number, isSettled: (i:number)=>boolean, total: number) returning { type: "navigate"; tab } or { type: "submit" }.
Core Integration
packages/app/src/pages/session/composer/session-question-dock.tsx (…lines ~424–431)
skipCurrent clears current answers/custom state, calls resolveSkipAction(...), and either sets store.tab + focuses the target or calls submit() when action is {type:"submit"}.
Tests
packages/app/src/pages/session/composer/session-question-dock.test.ts
New Bun test suite with five cases asserting navigation or submit outcomes across forward, wrap, and all-settled scenarios.

Sequence Diagram(s)

(Skipped — changes are focused and don't introduce a multi-component sequential interaction needing visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped a question, cleared the slate,
I looked ahead, then scanned the gate.
If none remain I shout "Submit!" — what fun,
Else hop to the next till all are done.
🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: auto-dismissing the question dock when all questions are settled after skipping.
Description check ✅ Passed The description covers all major template sections: summary, why, related issue, review focus, risk notes, verification steps, and a completed checklist.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pawwork/fix-question-skip-single

Review rate limit: 8/10 reviews remaining, refill in 9 minutes and 10 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a resolveSkipAction utility to handle navigation or submission logic after a question is skipped, along with corresponding unit tests. Feedback was provided to optimize the search for unsettled questions by avoiding redundant checks in the second loop of the utility function.

Comment thread packages/app/src/pages/session/composer/session-question-dock.tsx Outdated
@Astro-Han Astro-Han added bug Something isn't working app Application behavior and product flows P1 High priority labels May 2, 2026
@Astro-Han Astro-Han merged commit b07dc93 into dev May 2, 2026
27 checks passed
@Astro-Han Astro-Han deleted the pawwork/fix-question-skip-single branch May 2, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P1 High priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant