Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
36ad094
feat: use wizard for new session
denysvitali Sep 23, 2025
e91c4e8
fix(settings): resolve YOLO mode persistence and add profile management
ahundt Oct 27, 2025
6c02894
fix: remove invalid .loose() method call in settings.ts
ahundt Oct 27, 2025
cd86183
feat(profiles): enhance tmux integration with advanced environment va…
ahundt Oct 27, 2025
d7774ba
merge: incorporate .loose() fix from main
ahundt Oct 27, 2025
cabc700
fix: resolve TypeScript configuration issues and complete profile man…
ahundt Oct 27, 2025
e6c4140
fix: address maintainer feedback and improve code quality
ahundt Oct 28, 2025
67ea727
perf: optimize profile lookup and environment variable transformation
ahundt Oct 28, 2025
bad6067
feat(WIP): integrate profile system into new session workflow
ahundt Nov 6, 2025
7729bc8
WIP profiles/tmux: implement unified profile system with TypeScript-f…
ahundt Nov 7, 2025
c520a78
WIP profiles/agent: improve profile compatibility filtering and preve…
ahundt Nov 7, 2025
ab1012d
feat: implement comprehensive session creation wizard with AI profile…
ahundt Nov 7, 2025
0ecaffe
feat: add profile synchronization support and fix type exports
ahundt Nov 7, 2025
3ab56be
feat: add comprehensive profile management and wizard integration
ahundt Nov 7, 2025
b4d218a
feat: implement comprehensive profile management and GUI-CLI synchron…
ahundt Nov 7, 2025
20ce116
security: fix critical ProfileSyncService security violations
ahundt Nov 7, 2025
6807055
fix: critical UUID generation and wizard UX bugs in profile management
ahundt Nov 15, 2025
b53ef2e
feat: enable cross-device profile sync with backwards compatibility
ahundt Nov 15, 2025
9aa1cf9
feat(GUI): add development/preview/production variant build scripts w…
ahundt Nov 16, 2025
4b4040a
feat(GUI): add macOS Tauri variant support and reorganize contributor…
ahundt Nov 16, 2025
d8762ef
refactor(sync): remove unused profile API update schemas
ahundt Nov 16, 2025
0abfc20
fix(GUI): change new session wizard from modal to inline navigation
ahundt Nov 16, 2025
80f425a
Merge feature/yolo-mode-persistence-and-profile-management-wizard
ahundt Nov 16, 2025
b618935
docs: add detailed wizard redesign plan with user requirements
ahundt Nov 17, 2025
4a93c7c
docs: add concrete implementation details to wizard refactor plan
ahundt Nov 17, 2025
e9c0634
docs: fix logic errors in plan - keep picker callbacks and clarify wo…
ahundt Nov 17, 2025
1dd0977
docs: add environment variable substitution requirements to plan
ahundt Nov 17, 2025
611615a
refactor: extract AI profile utilities to shared profileUtils.ts module
ahundt Nov 17, 2025
5e50122
refactor(GUI) new/index.tsx: convert multi-step wizard to single-page…
ahundt Nov 17, 2025
5811488
fix(_layout.tsx): add missing new/pick/path route for path picker screen
ahundt Nov 17, 2025
a3092c3
feat(wizard): add 'Manage Profiles' button to navigate to settings panel
ahundt Nov 17, 2025
6096cd2
docs: mark wizard refactor as completed in plan file
ahundt Nov 17, 2025
fe3ab27
docs: mark all implementation checkboxes as completed in plan
ahundt Nov 17, 2025
b151abc
fix: remove restrictive env var filtering that dropped custom profile…
ahundt Nov 17, 2025
bbdaa0d
docs: add Phase 8 CLI/GUI compatibility verification checklist
ahundt Nov 17, 2025
b072da8
fix(wizard): pass selectedPath to path picker to show current selection
ahundt Nov 17, 2025
5ae08d1
refactor: integrate complete profile management into wizard (DRY with…
ahundt Nov 17, 2025
84d1f1f
fix: use useSettingMutable for profiles persistence and add Permissio…
ahundt Nov 17, 2025
ee07268
feat: add profile-level permission mode with UI in editor and wizard
ahundt Nov 17, 2025
739d673
feat: add 4-button permission mode grid UI to wizard
ahundt Nov 17, 2025
91f129c
fix: use ItemGroup/Item pattern for permission mode (matches Denys de…
ahundt Nov 17, 2025
fc4981e
feat: add session type to profiles with auto-selection on profile change
ahundt Nov 17, 2025
f155718
feat: add Duplicate/Delete profile buttons below profile list
ahundt Nov 17, 2025
4a00568
fix: white checkmarks and border for permission mode selection
ahundt Nov 17, 2025
5718c99
fix: white border only on selected permission mode item (not whole gr…
ahundt Nov 17, 2025
6b681f0
docs: add complete technical implementation details to plan
ahundt Nov 17, 2025
5f953a0
fix(GUI): profile edit now responsive full-window panel instead of fi…
ahundt Nov 17, 2025
f0c693e
fix(GUI): custom environment variables now persist and plus button is…
ahundt Nov 17, 2025
00d5434
fix(GUI): replace hardcoded white with theme.colors.button.primary.tint
ahundt Nov 17, 2025
21896b9
fix(GUI): AgentInput now sticky at bottom instead of scrolling with w…
ahundt Nov 17, 2025
898566a
fix(GUI): Duplicate/Delete buttons now always visible, disabled for b…
ahundt Nov 17, 2025
ae82c87
fix(GUI): enable Duplicate button for all profiles, Delete only for c…
ahundt Nov 17, 2025
8efb567
feat(GUI): show all profiles with compatibility status, improve tmux …
ahundt Nov 17, 2025
41fac58
fix(GUI): clarify tmux environment update option with unambiguous des…
ahundt Nov 17, 2025
4a3f656
fix(GUI): clarify tmux option affects SSH agent/X11, NOT API keys
ahundt Nov 17, 2025
d4d6708
feat(GUI): add auth token and env vars checkboxes, enable per-session…
ahundt Nov 17, 2025
0cdb607
feat(GUI): add tmux enable/disable checkbox, change to square checkboxes
ahundt Nov 17, 2025
212bdd9
fix(GUI): tmux checkbox now defaults to 'happy' session when name empty
ahundt Nov 17, 2025
f7f2a1e
feat(GUI): tmux defaults to first existing session instead of creatin…
ahundt Nov 17, 2025
545ffbf
fix(GUI): reduce profile list item height by 30% in new session wizard
ahundt Nov 17, 2025
3f1445b
fix(GUI): critical bugs found in cross-repository maintainer review
ahundt Nov 17, 2025
7066deb
feat(wizard): restore inline path selection with filtering and user-c…
ahundt Nov 17, 2025
4561101
fix(wizard): add collapsible sections and fix path selection highligh…
ahundt Nov 17, 2025
07d01e8
SidebarView.tsx: add + button to header in large screen mode
ahundt Nov 17, 2025
b32c0e2
fix(wizard): path selection expansion and profile permission mode sync
ahundt Nov 17, 2025
b885e40
fix(wizard): improve UX with compact sizing, path memory, and clickab…
ahundt Nov 18, 2025
e3a0a40
fix(wizard): populate path input field with default working directory
ahundt Nov 18, 2025
0de7125
fix(wizard): display custom profiles above built-in profiles
ahundt Nov 18, 2025
27a9eaf
fix(AgentInput): reduce row spacing and align send button with first row
ahundt Nov 18, 2025
ea5f492
fix(AgentInput): display built-in profile names in profile selector b…
ahundt Nov 18, 2025
a6187d4
fix(wizard): show all favorites when path input is auto-populated
ahundt Nov 18, 2025
3cf3f62
fix(wizard): match selected item border radius to ItemGroup container…
ahundt Nov 18, 2025
9a45d0c
feat(wizard): add clear button to path input field
ahundt Nov 18, 2025
26f62f0
fix(profiles): display base URL and model from environmentVariables i…
ahundt Nov 18, 2025
b16f44e
feat(profiles): add comprehensive setup documentation for built-in pr…
ahundt Nov 18, 2025
c3e9c5b
fix(profiles): use window.open() for documentation links on web/Tauri
ahundt Nov 18, 2025
6ec68b0
feat(profiles): retrieve and display actual environment variable valu…
ahundt Nov 19, 2025
8553c23
fix(profiles): correct DeepSeek default model to deepseek-chat per of…
ahundt Nov 19, 2025
5748ec0
fix(profiles): use deepseek-reasoner as default for Claude Code compl…
ahundt Nov 19, 2025
950a08f
feat(profiles): add evaluated values display and startup bash script …
ahundt Nov 19, 2025
0a61df6
fix(profiles): improve add button visibility and match border radii t…
ahundt Nov 19, 2025
4fc9e19
fix(wizard): display meaningful profile subtitles with model and base…
ahundt Nov 19, 2025
69004d2
fix(profiles): add model checkbox and clarify profile compatibility w…
ahundt Nov 20, 2025
645a094
docs: add CLI detection and profile availability implementation plan
ahundt Nov 20, 2025
023c893
feat(wizard): implement automatic non-blocking CLI detection for prof…
ahundt Nov 20, 2025
2998b44
feat(wizard): add Don't show again option to CLI installation warning…
ahundt Nov 20, 2025
8a12f3f
feat(wizard): add per-machine and global dismissal options for CLI wa…
ahundt Nov 20, 2025
f76a2be
fix(wizard): restore X button, inline dismiss options, add machine na…
ahundt Nov 20, 2025
5975af7
fix(wizard): improve CLI warning banner UX with right-aligned dismiss…
ahundt Nov 20, 2025
b763c4e
fix(wizard): use single-line layout with right-justified dismiss opti…
ahundt Nov 20, 2025
345c51f
fix(wizard): move dismiss options to header row with proper wrapping …
ahundt Nov 20, 2025
c67cfde
fix(wizard): use warning icon in CLI banners to match disabled profil…
ahundt Nov 20, 2025
3e5b9b9
fix(wizard): lock X button to top right and increase spacer before di…
ahundt Nov 20, 2025
68adfde
docs: add cumulative user instructions to CLI detection plan
ahundt Nov 20, 2025
93d0225
fix(wizard): increase spacing before X button in CLI warning banners
ahundt Nov 20, 2025
f966809
index.tsx: separate temporary vs permanent CLI banner dismissal with …
ahundt Nov 20, 2025
06652c6
fix(profiles): remove Together AI profile (official Codex CLI not sup…
ahundt Nov 20, 2025
238bcbe
feat(wizard): use Unicode symbols for profile CLI type indicators
ahundt Nov 20, 2025
d00d838
fix(wizard): reorder custom profile buttons for safety and increase s…
ahundt Nov 20, 2025
4e8fd34
feat(wizard): add Built-in indicator and CLI type first in profile su…
ahundt Nov 20, 2025
d719cfd
feat(wizard,AgentInput): add person icon to section header and implem…
ahundt Nov 20, 2025
6372f7b
fix(wizard,ProfileEditForm): update subsection typography for visual …
ahundt Nov 20, 2025
1a8d2e8
fix(wizard): add marginRight to Edit button for consistent spacing
ahundt Nov 20, 2025
ce40a8e
fix(ProfileEditForm): use theme placeholder color for /tmp input field
ahundt Nov 20, 2025
46e96ce
fix(wizard): add machine online status indicator to AgentInput
ahundt Nov 20, 2025
3794574
fix: correct Edit button spacing, translation keys, and remove duplic…
ahundt Nov 20, 2025
054c695
fix(wizard): restore SHOW MORE button in Recent Paths section
ahundt Nov 21, 2025
d70a033
fix(wizard): use gap property for consistent profile button spacing (…
ahundt Nov 21, 2025
3218c59
fix(wizard): use requestAnimationFrame for robust scroll-to-section t…
ahundt Nov 21, 2025
cd617e3
fix(wizard): improve CLI status formatting and clarify profile sectio…
ahundt Nov 21, 2025
aadf7b0
fix(wizard): improve status indicators with red for unavailable, add …
ahundt Nov 21, 2025
e382bfa
fix(wizard): use textDestructive for red colors, DRY status with Stat…
ahundt Nov 21, 2025
82aaac7
docs: add Session 2 requirements (Instructions 28-68) to CLI detectio…
ahundt Nov 21, 2025
e6fb646
fix(new session): increase status indicator spacing and add CLI statu…
ahundt Nov 21, 2025
53102a8
fix(new session): move machine status info box above profile section …
ahundt Nov 21, 2025
685a12a
refactor(new session): create generic SearchableListSelector componen…
ahundt Nov 21, 2025
ce53ca2
fix(SearchableListSelector): remove unhelpful 'Recently used' subtitl…
ahundt Nov 21, 2025
da7452d
fix(new session): add section header icons, use time icon for recent …
ahundt Nov 21, 2025
e79dd5d
fix(SearchableListSelector): properly parameterize getRecentItemIcon …
ahundt Nov 21, 2025
eb87cfc
fix(SearchableListSelector): remove subtitles, enable multiline wrapp…
ahundt Nov 21, 2025
f136968
fix(new session): add 24px spacing below machine and path selector se…
ahundt Nov 21, 2025
81de418
fix(SearchableListSelector): add 'All Machines/Paths' section to show…
ahundt Nov 21, 2025
a1373bb
fix(SearchableListSelector): fix typo, collapse recent/favorites by d…
ahundt Nov 21, 2025
5661c2a
fix(SearchableListSelector): only show collapse toggle for All sectio…
ahundt Nov 21, 2025
fed833d
refactor(SearchableListSelector): DRY - reuse renderItem function for…
ahundt Nov 21, 2025
3c8fd4a
fix(SearchableListSelector): show online/offline status alongside che…
ahundt Nov 21, 2025
ce8d20a
fix(new session): use consistent 'Directories' terminology instead of…
ahundt Nov 21, 2025
c0babb2
fix(SearchableListSelector): add StatusDot with pulsing animation for…
ahundt Nov 21, 2025
15872d5
refactor(SearchableListSelector): DRY - extract renderStatus helper, …
ahundt Nov 21, 2025
acf1d8e
refactor(SearchableListSelector): use existing Typography and Platfor…
ahundt Nov 21, 2025
ed25bc0
fix(new session): change section header to 'Select Working Directory'…
ahundt Nov 21, 2025
dc4fb65
fix(SearchableListSelector): always show toggle header for All sectio…
ahundt Nov 21, 2025
7b3310e
feat(SearchableListSelector): add controlled/uncontrolled collapse st…
ahundt Nov 21, 2025
e38e629
fix(SearchableListSelector): add configurable compact spacing (4px pa…
ahundt Nov 21, 2025
b3be913
fix(SearchableListSelector): add individual item backgrounds with min…
ahundt Nov 21, 2025
1147399
refactor(SearchableListSelector): consolidate borderRadius values int…
ahundt Nov 21, 2025
d5e6f54
docs: add Session 3 implementation details (SearchableListSelector ge…
ahundt Nov 21, 2025
3234b77
feat: evaluate ${VAR} substitutions in profile subtitles and refactor…
ahundt Nov 21, 2025
b0825b7
fix(profiles): restore environment variable evaluation in ProfileEdit…
ahundt Nov 21, 2025
6f030d1
docs: add environment variable configuration UX design specification
ahundt Nov 21, 2025
ec01cf6
refactor(theme): add deleteAction color variable and improve env var …
ahundt Nov 21, 2025
e4220e2
refactor(profiles): migrate OpenAI and Azure config fields to environ…
ahundt Nov 21, 2025
eaecc75
docs: add OODA cross-profile analysis to environment variable UX design
ahundt Nov 21, 2025
c099290
WIP: feat(theme,components): add spacing/sizing to theme and create E…
ahundt Nov 21, 2025
b0c98b5
CLAUDE.md: add macOS Tauri development commands for discoverability
ahundt Nov 21, 2025
8b1ba7c
refactor(profiles): unify all configuration into EnvironmentVariables…
ahundt Nov 21, 2025
433dff0
fix(SessionView): prevent header disappearing on desktop during windo…
ahundt Nov 21, 2025
374f457
fix(EnvironmentVariablesList,Card): restore auto-detection and securi…
ahundt Nov 21, 2025
83f56ba
fix(EnvironmentVariableCard): hide secret values in session preview w…
ahundt Nov 21, 2025
9337d54
fix(EnvironmentVariableCard): show actual variable syntax in secret p…
ahundt Nov 21, 2025
df622a5
fix(SearchableListSelector): match item border radius to container to…
ahundt Nov 21, 2025
19581fc
ProfileEditForm: show Save As for built-in profiles instead of Save
ahundt Nov 22, 2025
6950b1d
ProfileEditForm: fix tmux checkbox not persisting when sessionName is…
ahundt Nov 22, 2025
3efe337
fix(settings.ts,typesRaw.ts): strengthen permission mode schema valid…
ahundt Nov 22, 2025
da8011a
docs(notes): add comprehensive branch readiness and backwards compati…
ahundt Nov 23, 2025
c4d9de5
fix(new/index.tsx): show agent-specific permission modes in wizard an…
ahundt Nov 23, 2025
d395025
fix(AgentInput,reducer,auth): fix Escape key, tests, and DEBUG guards
ahundt Nov 29, 2025
2237429
.gitignore,notes/: remove development planning docs from repo
ahundt Nov 29, 2025
9961214
*.test.ts,*.spec.ts: fix test expectations to match implementation
ahundt Nov 29, 2025
ee25d39
Merge remote-tracking branch 'origin/main' into feature/new-session-w…
ahundt Dec 10, 2025
e943687
fix(env-vars,settings): bash parameter expansion regex and profile va…
ahundt Dec 10, 2025
99184ab
sync.ts: call applyMessagesLoaded after fetchMessages to set isLoaded…
ahundt Dec 12, 2025
2bc613b
Merge branch 'main' into feature/new-session-wizard-ux-improvements
ahundt Jan 1, 2026
c7e043f
feat(new-session): add A/B test for enhanced wizard UI + fix realtime…
ahundt Jan 1, 2026
1d019c7
fix(wizard): validate agent selection against CLI availability for al…
ahundt Jan 8, 2026
92f00fe
feat(wizard): add gemini CLI status to AgentInput message panel
ahundt Jan 8, 2026
42f8da6
merge: origin/main into feature branch (WOLOG superset preservation)
ahundt Jan 8, 2026
e003827
i18n(it,ja): add feature-branch translations and fix Italian accent m…
ahundt Jan 8, 2026
4f41022
fix(AskUserQuestionView): move StyleSheet.create outside component to…
ahundt Jan 8, 2026
05bfb69
fix(iOS): enable development builds with NitroModules and Skia compat…
ahundt Jan 9, 2026
5a9b79e
fix(sync): upgrade to type-safe Zod transform for WOLOG content norma…
ahundt Jan 9, 2026
d089f87
fix(new-session): handle optional navigation state in machine/path pi…
ahundt Jan 9, 2026
e517a88
fix(i18n): add missing translation keys to English translations
ahundt Jan 9, 2026
36a22a3
test(sync): add comprehensive Zod transform validation tests
ahundt Jan 9, 2026
811afc8
typesRaw.ts: add Claude extended thinking content type support
ahundt Jan 9, 2026
2eafbf1
fix(sync): complete end-to-end integration for extended thinking and …
ahundt Jan 9, 2026
9f36a7e
typesRaw.ts,typesRaw.spec.ts: preserve unknown fields end-to-end in n…
ahundt Jan 9, 2026
f94989b
reducer.ts: format thinking content with italic markdown for visual d…
ahundt Jan 9, 2026
0fbe2a9
SidebarView.tsx: fix title/icon overlap on wide screens with adaptive…
ahundt Jan 9, 2026
eac5cb9
fix(sync): preserve pending changes on version-mismatch by merging wi…
ahundt Jan 12, 2026
510e513
Merge main into feature/new-session-wizard-ux-improvements
bra1nDump Jan 12, 2026
b96132c
Gate thinking state rendering behind experiments flag
bra1nDump Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ yarn-error.*

CLAUDE.local.md

.dev/worktree/*
.dev/worktree/*

# Development planning notes (keep local, don't commit)
notes/
8 changes: 7 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
### Development
- `yarn start` - Start the Expo development server
- `yarn ios` - Run the app on iOS simulator
- `yarn android` - Run the app on Android emulator
- `yarn android` - Run the app on Android emulator
- `yarn web` - Run the app in web browser
- `yarn prebuild` - Generate native iOS and Android directories
- `yarn typecheck` - Run TypeScript type checking after all changes

### macOS Desktop (Tauri)
- `yarn tauri:dev` - Run macOS desktop app with hot reload
- `yarn tauri:build:dev` - Build development variant
- `yarn tauri:build:preview` - Build preview variant
- `yarn tauri:build:production` - Build production variant

### Testing
- `yarn test` - Run tests in watch mode (Jest with jest-expo preset)
- No existing tests in the codebase yet
Expand Down
308 changes: 308 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
# Contributing to Happy

## Development Workflow: Build Variants

The Happy app supports three build variants across **iOS, Android, and macOS desktop**, each with separate bundle IDs so all three can be installed simultaneously:

| Variant | Bundle ID | App Name | Use Case |
|---------|-----------|----------|----------|
| **Development** | `com.slopus.happy.dev` | Happy (dev) | Local development with hot reload |
| **Preview** | `com.slopus.happy.preview` | Happy (preview) | Beta testing & OTA updates before production |
| **Production** | `com.ex3ndr.happy` | Happy | Public App Store release |

**Why Preview?**
- **Development**: Fast iteration, dev server, instant reload
- **Preview**: Beta testers get OTA updates (`eas update --branch preview`) without app store submission
- **Production**: Stable App Store builds

This allows you to test production-like builds with real users before releasing to the App Store.

## Quick Start

### iOS Development

```bash
# Development variant (default)
npm run ios:dev

# Preview variant
npm run ios:preview

# Production variant
npm run ios:production
```

### Android Development

```bash
# Development variant
npm run android:dev

# Preview variant
npm run android:preview

# Production variant
npm run android:production
```

### macOS Desktop (Tauri)

```bash
# Development variant - run with hot reload
npm run tauri:dev

# Build development variant
npm run tauri:build:dev

# Build preview variant
npm run tauri:build:preview

# Build production variant
npm run tauri:build:production
```

**How Tauri Variants Work:**
- Base config: `src-tauri/tauri.conf.json` (production defaults)
- Partial configs: `tauri.dev.conf.json`, `tauri.preview.conf.json`
- Tauri merges partial configs using [JSON Merge Patch (RFC 7396)](https://datatracker.ietf.org/doc/html/rfc7396)
- Only differences need to be specified in partial configs (DRY principle)

### Development Server

```bash
# Start dev server for development variant
npm run start:dev

# Start dev server for preview variant
npm run start:preview

# Start dev server for production variant
npm run start:production
```

## Visual Differences

Each variant displays a different app name on your device:
- **Development**: "Happy (dev)" - Yellow/orange theme
- **Preview**: "Happy (preview)" - Preview theme
- **Production**: "Happy" - Standard theme

This makes it easy to distinguish which version you're testing!

## Common Workflows

### Testing Development Changes

1. **Build development variant:**
```bash
npm run ios:dev
```

2. **Make your changes** to the code

3. **Hot reload** automatically updates the app

4. **Rebuild if needed** for native changes:
```bash
npm run ios:dev
```

### Testing Preview (Pre-Release)

1. **Build preview variant:**
```bash
npm run ios:preview
```

2. **Test OTA updates:**
```bash
npm run ota # Publishes to preview branch
```

3. **Verify** the preview build works as expected

### Production Release

1. **Build production variant:**
```bash
npm run ios:production
```

2. **Submit to App Store:**
```bash
npm run submit
```

3. **Deploy OTA updates:**
```bash
npm run ota:production
```

## All Variants Simultaneously

You can install all three variants on the same device:

```bash
# Build all three variants
npm run ios:dev
npm run ios:preview
npm run ios:production
```

All three apps appear on your device with different icons and names!

## EAS Build Profiles

The project includes EAS build profiles for automated builds:

```bash
# Development build
eas build --profile development

# Production build
eas build --profile production
```

## Environment Variables

Each variant can use different environment variables via `APP_ENV`:

```javascript
// In app.config.js
const variant = process.env.APP_ENV || 'development';
```

This controls:
- Bundle identifier
- App name
- Associated domains (deep linking)
- Intent filters (Android)
- Other variant-specific configuration

## Deep Linking

Only **production** variant has deep linking configured:

- **Production**: `https://app.happy.engineering/*`
- **Development**: No deep linking
- **Preview**: No deep linking

This prevents dev/preview builds from interfering with production deep links.

## Testing Connected to Different Servers

You can connect different variants to different Happy CLI instances:

```bash
# Development app → Dev CLI daemon
npm run android:dev
# Connect to CLI running: npm run dev:daemon:start

# Production app → Stable CLI daemon
npm run android:production
# Connect to CLI running: npm run stable:daemon:start
```

Each app maintains separate authentication and sessions!

## Local Server Development

To test with a local Happy server:

```bash
npm run start:local-server
```

This sets:
- `EXPO_PUBLIC_HAPPY_SERVER_URL=http://localhost:3005`
- `EXPO_PUBLIC_DEBUG=1`
- Debug logging enabled

## Troubleshooting

### Build fails with "Bundle identifier already in use"

This shouldn't happen - each variant has a unique bundle ID. If it does:

1. Check `app.config.js` - verify `bundleId` is set correctly for the variant
2. Clean build:
```bash
npm run prebuild
npm run ios:dev # or whichever variant
```

### App not updating after changes

1. **For JS changes**: Hot reload should work automatically
2. **For native changes**: Rebuild the variant:
```bash
npm run ios:dev # Force rebuild
```
3. **For config changes**: Clean and prebuild:
```bash
npm run prebuild
npm run ios:dev
```

### All three apps look the same

Check the app name on the home screen:
- "Happy (dev)"
- "Happy (preview)"
- "Happy"

If they're all the same name, the variant might not be set correctly. Verify:

```bash
# Check what APP_ENV is set to
echo $APP_ENV

# Or look at the build output
npm run ios:dev # Should show "Happy (dev)" as the name
```

### Connected device not found

For iOS connected device testing:

```bash
# List available devices
xcrun devicectl list devices

# Run on specific connected device
npm run ios:connected-device
```

## Tips

1. **Use development variant for active work** - Fast iteration, debug features enabled
2. **Use preview for pre-release testing** - Test OTA updates before production
3. **Use production for final validation** - Exact configuration that ships to users
4. **Install all three simultaneously** - Compare behaviors side-by-side
5. **Different CLI instances** - Connect dev app to dev CLI, prod app to stable CLI
6. **Check app name** - Always visible which variant you're testing

## How It Works

The `app.config.js` file reads the `APP_ENV` environment variable:

```javascript
const variant = process.env.APP_ENV || 'development';
const bundleId = {
development: "com.slopus.happy.dev",
preview: "com.slopus.happy.preview",
production: "com.ex3ndr.happy"
}[variant];
```

The `cross-env` package ensures this works cross-platform:

```json
{
"scripts": {
"ios:dev": "cross-env APP_ENV=development expo run:ios"
}
}
```

Cross-platform via `cross-env` - works identically on Windows, macOS, and Linux!
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ We're engineers scattered across Bay Area coffee shops and hacker houses, consta
## 📚 Documentation & Contributing

- **[Documentation Website](https://happy.engineering/docs/)** - Learn how to use Happy Coder effectively
- **[CONTRIBUTING.md](CONTRIBUTING.md)** - Development setup including iOS, Android, and macOS desktop variant builds
- **[Edit docs at github.com/slopus/slopus.github.io](https://github.com/slopus/slopus.github.io)** - Help improve our documentation and guides

## License
Expand Down
22 changes: 20 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
module.exports = function (api) {
api.cache(true);

// Determine which worklets plugin to use based on installed versions
// Reanimated v4+ uses react-native-worklets/plugin
// Reanimated v3.x uses react-native-reanimated/plugin
let workletsPlugin = 'react-native-worklets/plugin';
try {
const reanimatedVersion = require('react-native-reanimated/package.json').version;
const majorVersion = parseInt(reanimatedVersion.split('.')[0], 10);

// For Reanimated v3.x, use the old plugin
if (majorVersion < 4) {
workletsPlugin = 'react-native-reanimated/plugin';
}
} catch (e) {
// If reanimated isn't installed, default to newer plugin
// This won't cause issues since the plugin won't be needed anyway
}

return {
presets: ['babel-preset-expo'],
env: {
Expand All @@ -8,8 +26,8 @@ module.exports = function (api) {
},
},
plugins: [
'react-native-worklets/plugin',
['react-native-unistyles/plugin', { root: 'sources' }]
['react-native-unistyles/plugin', { root: 'sources' }],
workletsPlugin // Must be last - automatically selects correct plugin for version
],
};
};
Loading