Skip to content

fix(ui): bypass organization selection for ui command#136

Open
Dav-14 wants to merge 1 commit intomainfrom
fix/fctl-ui
Open

fix(ui): bypass organization selection for ui command#136
Dav-14 wants to merge 1 commit intomainfrom
fix/fctl-ui

Conversation

@Dav-14
Copy link
Copy Markdown
Contributor

@Dav-14 Dav-14 commented Mar 20, 2026

Summary

  • Refactors cmd/ui/ui.go to not require organization selection for opening the console UI
  • Uses fctl.NewCommand instead of fctl.NewStackCommand for the ui command
  • Creates membership client directly with membershipclient.New(...) to fetch server info, bypassing NewMembershipClientForOrganizationFromFlags
  • Only cmd/ changes from fix: fctl ui #115 — SDK regeneration dropped since current main SDK is already correct

Changes

  • cmd/ui/ui.go: Changed from fctl.NewStackCommand to fctl.NewCommand, removing the requirement for organization/stack context
  • cmd/ui/ui.go: Create membership client directly to get server info (console URL) without organization selection
  • Skipped cmd/stack/create.go change from fix: fctl ui #115: the CreateStackResponse type on current main still uses ReadStackResponse as its field — the PR fix: fctl ui #115 change was tied to a regenerated SDK that isn't on main
  • Skipped cmd/root.go change from fix: fctl ui #115: the apierrors.Error type still exists on current main, removing the case would lose error handling

Test plan

  • Run fctl ui without selecting an organization — should open console URL directly
  • Verify fctl ui still works when authenticated

Supersedes #115

🤖 Generated with Claude Code

The ui command only needs server info to get the console URL, not a
full organization-scoped client. Create the membership client directly
to avoid forcing users through organization selection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Dav-14 Dav-14 requested a review from a team as a code owner March 20, 2026 11:07
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 32f71327-3d5e-4c48-bac7-1573cdb3b47c

📥 Commits

Reviewing files that changed from the base of the PR and between 061c4d0 and 0576f34.

📒 Files selected for processing (1)
  • cmd/ui/ui.go

Walkthrough

The UI command refactors how it constructs a membership client, replacing the interactive dialog-based approach via fctl.NewMembershipClientForOrganizationFromFlags with direct client instantiation using the current profile's membership server URL and HTTP client, while also changing the command factory from NewStackCommand to NewCommand.

Changes

Cohort / File(s) Summary
Membership Client Construction
cmd/ui/ui.go
Refactored client initialization to construct membership client directly via membershipclient.New(...) instead of fctl.NewMembershipClientForOrganizationFromFlags(...), removed profileName usage, and switched command factory from NewStackCommand to NewCommand.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A hop, a skip, no dialog dance—
The client builds straight, no interactive chance!
From stack to command, the refactor's so neat,
Profile and HTTP client, a membership treat! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: refactoring the UI command to bypass organization selection.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the refactoring, changes made, rationale, and test plan.

✏️ 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 fix/fctl-ui
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant