Skip to content

Offer the free-key link inline with the API-key sheet's rationale - #106

Draft
aurpsis-aai wants to merge 1 commit into
mainfrom
aurpsis/get-free-key-link
Draft

Offer the free-key link inline with the API-key sheet's rationale#106
aurpsis-aai wants to merge 1 commit into
mainfrom
aurpsis/get-free-key-link

Conversation

@aurpsis-aai

Copy link
Copy Markdown
Contributor

What

In the API-key entry sheet, a keyless user now finds "Don't have a key? Get a free one" as a text link directly under the rationale sentence ("Blurt needs an AssemblyAI API key to transcribe your speech…"), instead of the "Get a Free Key" push button that sat at the leading edge of the button row.

  • The link opens https://www.assemblyai.com/dashboard/api-keys and leaves the sheet open behind the browser, ready for the paste (unchanged behavior).
  • Shown only in first-connect mode; a user rotating a stored key doesn't see it (unchanged behavior).
  • Rendered as a Button with .buttonStyle(.link) so it reads as a link but remains a button element for XCUITest and VoiceOver; carries accessibilityLabel("Get a free API key") so the label is self-describing when reached via rotor/Tab, where the "Don't have a key?" prefix isn't read.
  • The sheet's button row is now a plain Cancel / default-action pair.

Why

Where to get a key was the sheet's least discoverable affordance: the answer to "where do I get one?" lived in the action row rather than with the sentence that raises the question. Link styling also matches what the control does — navigation to the web, not one of the sheet's commit-or-cancel actions.

Destination note: key generation lives on the dashboard's API-keys page (the playground pages under /dashboard/playground/* have no key-generation UI), so the existing APIKeyStore.dashboardURL target is kept.

Testing

  • New UI test testGetKeyLinkShownOnlyBeforeFirstConnect: link present on the first-connect sheet, absent after a key is stored.
  • swift format lint clean on both files; macOS HIG review pass done (link-vs-button semantics, placement, accessibility label).
  • No Xcode on this machine — CI check is the build/UI-test gate.

🤖 Generated with Claude Code

A keyless user reading "Blurt needs an AssemblyAI API key" now finds
"Don't have a key? Get a free one" in the same breath, as a text link,
instead of having to spot the "Get a Free Key" push button down in the
action row. The link opens the dashboard's key page and leaves the sheet
open behind the browser, ready for the paste; it stays hidden once a key
is stored. The button row is now a plain Cancel / default-action pair.

Co-Authored-By: Claude Fable 5 (Jeeves) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 4, 2026 21:14

Copilot AI 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.

Pull request overview

This PR improves the API-key entry sheet UX by moving the “get a free key” affordance into the rationale text area as an inline, link-styled control (shown only before first connect), and simplifies the sheet action row to just Cancel + default action. It also adds a UI test to ensure the link is present only in first-connect mode.

Changes:

  • Updated APIKeyEditorSheet to show a link-styled “Get a free one” button inline under the rationale when no key is stored, with a more descriptive accessibility label.
  • Simplified the sheet’s button row by removing the prior leading “Get a Free Key” button.
  • Added a UI test validating the link is shown only before the first successful connect.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
App/Blurt/Blurt/Wizard/Steps/APIKeyStepView.swift Moves the “get key” action inline under rationale as a link-styled SwiftUI Button, and simplifies the action row.
App/Blurt/BlurtUITests/SettingsUITests.swift Adds a UI test to verify the get-key link appears only in first-connect mode.
Suppressed comments (1)

App/Blurt/BlurtUITests/SettingsUITests.swift:157

  • Same issue here: asserting against reopened.buttons[...] can be brittle if the link-styled control is not surfaced as a Button element type. Match by identifier across element types using anyDescendant(identified:), and use waitForExistence (expecting false) so the assertion can’t pass just because the view hasn’t finished building yet.
    XCTAssertFalse(
      reopened.buttons[UITestIdentifiers.apiKeyGetKey].exists,
      "A stored key means the user has found the dashboard — no link on rotate")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +146 to +148
XCTAssertTrue(
sheet.buttons[UITestIdentifiers.apiKeyGetKey].waitForExistence(timeout: 5),
"The first-connect sheet should offer the get-a-free-key link")
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.

2 participants