Skip to content

fix(tui): clear channel picker subscriptions on sub-step transitions (#792)#797

Merged
Aaronontheweb merged 2 commits into
devfrom
claude-wt-init-wizard-race-fix
Apr 29, 2026
Merged

fix(tui): clear channel picker subscriptions on sub-step transitions (#792)#797
Aaronontheweb merged 2 commits into
devfrom
claude-wt-init-wizard-race-fix

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Summary

  • Fix subscription accumulation race in ChannelPickerStepView that caused Slack/Discord bot token sub-step to loop instead of advancing (Bug: Slack/Discord bot token sub-step loops back instead of advancing #792)
  • ManagesOwnFocusState = true prevented InitWizardPage from clearing step-scoped subscriptions; now ChannelPickerStepView.BuildContent() clears them itself before delegating to adapter views
  • Add ClearFocusState() call on adapter view before delegation to prevent stale TextInputNode instances from intercepting keys
  • Add 2 deterministic regression tests verifying subscription count stays bounded across re-renders and sub-step transitions

Test plan

  • All 544 existing tests pass (dotnet test src/Netclaw.Cli.Tests/)
  • New regression tests pass: SubFlow_BuildContent_ClearsSubscriptionsOnReRender, SubFlow_BuildContent_ClearsSubscriptionsAcrossSubStepTransitions
  • dotnet slopwatch analyze — no new violations
  • Copyright headers verified
  • Manual: netclaw init → Channel Picker → Slack → enter xoxb-... → press Enter → should advance to App Token

Closes #792

…792)

ChannelPickerStepView.ManagesOwnFocusState returns true, which prevents
InitWizardPage from clearing step-scoped subscriptions between sub-step
renders. Each SlackStepView/DiscordStepView.BuildContent() call added
new Submitted subscriptions without disposing old ones. A cursor blink
timer re-triggering the DynamicLayoutNode factory created duplicates,
causing multiple AdvanceStep() calls per Enter and erratic navigation.

Clear callbacks.Subscriptions at the top of ChannelPickerStepView
.BuildContent() and call ClearFocusState() on the adapter view before
delegation. Add regression tests verifying subscription count stays
bounded across re-renders and sub-step transitions.
@Aaronontheweb
Aaronontheweb marked this pull request as ready for review April 29, 2026 03:46
@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) April 29, 2026 03:46
@Aaronontheweb
Aaronontheweb merged commit be656f9 into dev Apr 29, 2026
5 checks passed
@Aaronontheweb
Aaronontheweb deleted the claude-wt-init-wizard-race-fix branch April 29, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Slack/Discord bot token sub-step loops back instead of advancing

1 participant