Skip to content

feat(ui): add AppButton/AppLinkButton primitives and migrate app action controls - #273

Merged
Caneryy merged 3 commits into
stolla-labs:mainfrom
karagozemin:feat/app-button-primitives
Aug 30, 2026
Merged

feat(ui): add AppButton/AppLinkButton primitives and migrate app action controls#273
Caneryy merged 3 commits into
stolla-labs:mainfrom
karagozemin:feat/app-button-primitives

Conversation

@karagozemin

Copy link
Copy Markdown
Contributor

Closes #272

Summary

Adds app-specific AppButton and AppLinkButton primitives and migrates representative app action controls to them, removing duplicated Tailwind action class lists.

What changed

  • Primitives (components/ui/AppButton.tsx, AppLinkButton.tsx) — tone="primary | secondary | danger | success" and size="sm | md", plus className for layout-only additions. Visual state (color, border, typography, hover, focus, disabled) lives in the primitive.
  • Behavior preservation — native type, disabled, aria-*, data-*, handlers, and forwarded refs pass through; AppLinkButton preserves Next.js navigation + anchor attributes.
  • Migration — migrated representative action controls in CommunityDetailView, CommunityNotFound, and the community route page.
  • Tests (AppButton.test.tsx) — every tone, both sizes, class merging, ref forwarding, disabled semantics, and link attributes.

Verification

  • npm run lint && npm run typecheck && npm test

…on controls (stolla-labs#272)

- Add AppButton and AppLinkButton with primary/secondary/danger/success tones
  and sm/md sizes; visual state classes live in the primitive, layout classes
  stay at the call site
- Preserve native button attributes, handlers, disabled semantics, and refs;
  AppLinkButton keeps Next.js navigation and anchor attributes
- Migrate representative action controls in community detail/not-found views
  and the community route page
- Add primitive tests covering every tone, both sizes, class merging, ref
  forwarding, disabled behavior, and link attributes
Copilot AI lite review requested due to automatic review settings August 26, 2026 11:34
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@karagozemin is attempting to deploy a commit to the caneryy's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Caneryy

Caneryy commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the initial primitive implementation. The primitive direction is sound, but this PR does not yet satisfy #272: the issue requires migration across the app route group and the dashboard/community components, not a representative sample.

Please complete the eligible production migration below before requesting another review:

  • apps/web/src/app/(app)/communities/[id]/page.tsx — finish copy, explorer, back, share, and external-link actions left in this already-modified file
  • apps/web/src/app/(app)/communities/[id]/proposals/page.tsx — retry, load-more, and browse actions
  • apps/web/src/app/(app)/communities/[id]/proposals/[proposalId]/page.tsx — fallback browse/back action
  • apps/web/src/app/(app)/communities/create/page.tsx — discard, connect, edit, back, continue, and submit actions
  • apps/web/src/app/(app)/communities/page.tsx — create, clear, retry, clear-search, and load-more actions
  • apps/web/src/app/(app)/community/page.tsx — retry, delegate, and mint actions
  • apps/web/src/app/(app)/proposals/page.tsx — create, retry, and load-more actions
  • apps/web/src/app/(app)/proposals/[id]/page.tsx — fallback back links and copy actions
  • apps/web/src/components/CommunityCard.tsx — View community CTA
  • apps/web/src/components/CommunityDeploymentPanel.tsx — simulate, deploy, recovery, copy/explorer, and success-navigation actions
  • apps/web/src/components/CommunitySwitcher.tsx — menu trigger action; keep list navigation structural
  • apps/web/src/components/Header.tsx — connect and disconnect actions; keep navigation links structural
  • apps/web/src/components/ProposalSummaryCard.tsx — retry-state and copy actions
  • apps/web/src/components/SimulatedFeeDisplay.tsx — re-simulate action
  • apps/web/src/components/TransactionLifecycleStatus.tsx — explorer action
  • apps/web/src/components/community/CreateCommunityWizard.tsx — simulate/deploy, confirmation, discard, back, and next actions; keep step selectors structural

Keep the issue exclusions intact: do not modify landing components, lp-* styles, VoteActions, breadcrumbs, card-wide navigation, or ordinary inline links.

Two primitive-level fixes are also needed:

  1. Default AppButton to type="button" when the caller does not provide a type. Otherwise a future use inside a form implicitly submits it. Add a regression test for the default and preserve explicit type="submit".
  2. The current “renders every tone” test only proves the buttons exist. Assert the expected tone class for each table entry so a broken variant mapping cannot pass.

Update the affected consumer tests by accessible role/name where their rendered element changes. Please complete the checklist as one coherent migration and avoid unrelated formatting or generated churn.

…edback (stolla-labs#272)

- Default AppButton to type=button; preserve explicit type=submit
- Assert per-tone classes in the primitive test; add default-type regression test
- Migrate remaining action controls across the app route group:
  communities (listing/detail/proposals/create), community, and proposals pages
- Migrate CommunityCard and CommunityDeploymentPanel actions (primary/secondary/
  danger/success)
@karagozemin

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review — addressed both primitive-level fixes and completed the eligible migration.

Primitive fixes

  • AppButton now defaults to type="button" and preserves an explicit type="submit" (regression test added).
  • renders every tone now asserts the expected tone class per entry so a broken variant map can't pass.

Migration completed

  • App routes: communities/[id] (+ proposals and proposal detail), communities (listing), communities/create, community, and proposals (+ detail) — primary/secondary/danger/success action controls migrated.
  • Components: CommunityDetailView, CommunityNotFound, CommunityCard, and CommunityDeploymentPanel actions migrated.

Left intentionally unchanged (per the issue's exclusions / no matching tone): landing components and lp-* styles, VoteActions, breadcrumbs, card-wide navigation, ordinary inline text links, wizard step selectors, and compact header/menu/chip controls (they don't fit the min-h action-button primitive).

@Caneryy

Caneryy commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

The latest update is still incomplete for #272. Several eligible production action controls were excluded as “compact” even though the new primitives already provide a size="sm" variant for that use case.

Please complete the remaining in-scope migrations below:

  • apps/web/src/components/Header.tsx — migrate wallet connect, disconnect, and mobile-menu action buttons; use size="sm" for compact controls and keep structural navigation links unchanged
  • apps/web/src/components/CommunitySwitcher.tsx — migrate the menu trigger action with size="sm"; keep community list links as structural navigation
  • apps/web/src/components/ProposalSummaryCard.tsx — migrate retry-state and copy-ID buttons with size="sm"; keep the card-wide proposal link unchanged
  • apps/web/src/components/SimulatedFeeDisplay.tsx — migrate the re-simulate action
  • apps/web/src/components/TransactionLifecycleStatus.tsx — migrate the explorer action to AppLinkButton while preserving target, rel, and the exact URL
  • apps/web/src/components/community/CreateCommunityWizard.tsx — migrate simulate, deploy, confirmation, discard, back, and next actions; keep wizard step selectors and ordinary explorer text links unchanged

These are direct consumers of the action styles this issue is consolidating, so leaving them on bespoke button/link styling would preserve the inconsistency the shared primitives are intended to remove.

Update existing behavioral tests only where the rendered element change requires it. Preserve labels, handlers, navigation destinations, responsive layout, menu behavior, external-link attributes, and the landing/VoteActions exclusions. Avoid unrelated formatting or generated churn.

Please complete the checklist and reply with the migrated paths before requesting re-review.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Caneryy
Caneryy merged commit 6b80984 into stolla-labs:main Aug 30, 2026
0 of 4 checks passed
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.

Migrate app action controls to shared button primitives

3 participants