Skip to content

Add collapsible 'what's included' disclosure to onboarding template cards#454

Merged
FuJacob merged 3 commits into
mainfrom
feat/onboarding-template-feature-disclosure
May 31, 2026
Merged

Add collapsible 'what's included' disclosure to onboarding template cards#454
FuJacob merged 3 commits into
mainfrom
feat/onboarding-template-feature-disclosure

Conversation

@FuJacob

@FuJacob FuJacob commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

Onboarding template cards (Quick / Everyday / Powerful) now have a collapsed-by-default "What's included" disclosure under the description. Expanding it lists the concrete settings each template will toggle on or off — suggestion length, fast mode, multi-line completions — so users can compare templates without trusting the marketing copy alone.

Implementation

  • New pure helper Cotabby/Support/OnboardingTemplateFeatureList.swift exposes the row list per template, driven from the existing OnboardingTemplate properties so the source of truth doesn't fork.
  • WelcomeTemplateStepView.TemplateCard is split: the selection Button wraps the descriptive content; the disclosure is rendered as a sibling view inside the shared rounded background so its toggle taps never double-fire selection. Each card holds its own @State so opening one doesn't expand the others.
  • New tests in CotabbyTests/OnboardingTemplateFeatureListTests.swift cover all three templates.

Validation

  • xcodegen generate (no drift after commit)
  • xcodebuild ... build (** BUILD SUCCEEDED **)
  • xcodebuild test ... -only-testing:CotabbyTests/OnboardingTemplateFeatureListTests (3 tests, 0 failures)
  • swiftlint lint --quiet (exit 0)

Manual UI verification on real onboarding flow not performed in this session.

Linked issues

None.

Risk / rollout notes

  • New Cotabby.xcodeproj rows reflect XcodeGen rediscovering the two new files; the XcodeGen drift check should pass.
  • Disclosure animation is .easeInOut(duration: 0.18) — short enough to feel responsive, long enough to read as a deliberate expansion.
  • No persisted state for expanded/collapsed — by design, every card starts collapsed each time the step is re-entered.

Greptile Summary

This PR adds a collapsed-by-default "What's included" disclosure to each onboarding template card, and introduces enablesClipboardContext as a new per-template behavior flag (off for Quick, on for Everyday/Powerful). The enablesMultiLine flag is also flattened to always-false across all tiers, and the Quick tier's open-source model is switched to SmolLM2.

  • New OnboardingTemplateFeatureList helper returns ordered feature rows per template driven from the existing properties, keeping the UI and tests in sync with a single source of truth.
  • TemplateCard is restructured so the selection Button and the disclosure toggle are sibling views sharing one rounded background, preventing disclosure taps from double-firing template selection.
  • ResolvedTemplatePlan and WelcomeView are updated to carry and apply enablesClipboardContext, completing the end-to-end wiring for the new flag.

Confidence Score: 4/5

Safe to merge after fixing the clip-shape omission on the card container; everything else is correct.

The disclosure animation uses .move(edge: .top) combined with an .opacity transition, but the outer VStack only has a .background modifier — not a .clipShape. On macOS, .background paints behind the content without clipping it, so the animating rows will visibly overflow the card's rounded rectangle for the entire 0.18 s animation. The rest of the PR — the new enablesClipboardContext wiring, the pure feature-list helper, the test coverage, and the Xcode project additions — is straightforward and correct.

Cotabby/UI/WelcomeTemplateStepView.swift — the body of TemplateCard needs a .clipShape modifier to contain the disclosure animation.

Important Files Changed

Filename Overview
Cotabby/UI/WelcomeTemplateStepView.swift TemplateCard split into selectionButton + featureDisclosure; disclosure animation uses .move(edge: .top) but the outer VStack has no .clipShape, causing rows to overflow the card's rounded rectangle during expand/collapse.
Cotabby/Support/OnboardingTemplateFeatureList.swift New pure helper returning ordered feature rows per template; cleanly delegates to OnboardingTemplate properties, unit-testable with no side effects.
Cotabby/Models/OnboardingTemplate.swift enablesMultiLine flattened to always-false; new enablesClipboardContext property (off for Quick, on for Everyday/Powerful); ResolvedTemplatePlan gains enablesClipboardContext field; Quick model filename changed to SmolLM2.
Cotabby/Support/OnboardingTemplateRecommender.swift Minimal change — passes enablesClipboardContext through to ResolvedTemplatePlan; no logic changes.
Cotabby/UI/WelcomeView.swift applyTemplate now calls setClipboardContextEnabled to persist the new setting; straightforward integration of the new plan field.
CotabbyTests/OnboardingTemplateFeatureListTests.swift New tests for all three templates; correctly derives displayLabel from the property rather than hardcoding strings; everyday and powerful tests skip title-order assertions (covered by the quick test).
CotabbyTests/OnboardingTemplateRecommenderTests.swift Updated to assert enablesClipboardContext on all tiers; enablesMultiLine assertion for Powerful flipped to false; GGUF filename for Quick updated to match model change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[WelcomeTemplateStepView] --> B[ForEach OnboardingTemplate.allCases]
    B --> C[TemplateCard]
    C --> D[selectionButton]
    C --> E[featureDisclosure]
    D -->|onTap| F[onSelect template]
    E --> G{isFeatureListExpanded}
    G -->|false| H[Show chevron toggle]
    G -->|true| I[Show feature rows]
    I --> J[OnboardingTemplateFeatureList.rows]
    F --> N[WelcomeView.applyTemplate]
    N --> S[setClipboardContextEnabled]
Loading

Fix All in Codex Fix All in Claude Code

Reviews (3): Last reviewed commit: "Address Greptile review: animate disclos..." | Re-trigger Greptile

Comment thread Cotabby/UI/WelcomeTemplateStepView.swift
Comment thread CotabbyTests/OnboardingTemplateFeatureListTests.swift Outdated
FuJacob added 2 commits May 30, 2026 19:21
… knob

Three tier-shaped changes, plus surface tweaks so the cards reflect them:

- Quick switches to tabby-1-nano (SmolLM2-135M, ~0.1 GB) — the previous
  ~0.4 GB Qwen3 was the wrong fit for a 'fast and lightweight' tier when
  a smaller model exists in the catalog.
- Multi-line completions are now off in every tier. A fresh user should
  not opt into block completions through tier choice; the General toggle
  remains the way in. The Multi-line row drops out of the per-card
  disclosure since it would be identical (off) on all three.
- Clipboard context becomes a per-tier knob: off on Quick (skip the per-
  keystroke pasteboard read and the extra prompt bytes), on for Everyday
  and Powerful. It takes the slot left by the Multi-line row in the
  disclosure.
- The engine-row footer now names the actual model ('tabby-1-nano ·
  ~0.1 GB download') instead of the generic 'Local model'.
- Powerful's detail copy drops the 'multi-line' phrasing now that the
  flag is off.
…s in tests

- Add a move(edge: .top) + opacity transition so the "What's included" rows
  slide open with the chevron instead of popping in.
- Assert the suggestion-length detail against
  OnboardingTemplate.<tier>.wordCountPreset.displayLabel rather than hardcoded
  strings, so the test tracks the production label instead of snapshotting it.
@FuJacob FuJacob merged commit 47999e5 into main May 31, 2026
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.

1 participant