sojorn/sojorn_app/build_web.ps1
Patrick Britton 3c4680bdd7 Initial commit: Complete threaded conversation system with inline replies
**Major Features Added:**
- **Inline Reply System**: Replace compose screen with inline reply boxes
- **Thread Navigation**: Parent/child navigation with jump functionality
- **Chain Flow UI**: Reply counts, expand/collapse animations, visual hierarchy
- **Enhanced Animations**: Smooth transitions, hover effects, micro-interactions

 **Frontend Changes:**
- **ThreadedCommentWidget**: Complete rewrite with animations and navigation
- **ThreadNode Model**: Added parent references and descendant counting
- **ThreadedConversationScreen**: Integrated navigation handlers
- **PostDetailScreen**: Replaced with threaded conversation view
- **ComposeScreen**: Added reply indicators and context
- **PostActions**: Fixed visibility checks for chain buttons

 **Backend Changes:**
- **API Route**: Added /posts/:id/thread endpoint
- **Post Repository**: Include allow_chain and visibility fields in feed
- **Thread Handler**: Support for fetching post chains

 **UI/UX Improvements:**
- **Reply Context**: Clear indication when replying to specific posts
- **Character Counting**: 500 character limit with live counter
- **Visual Hierarchy**: Depth-based indentation and styling
- **Smooth Animations**: SizeTransition, FadeTransition, hover states
- **Chain Navigation**: Parent/child buttons with visual feedback

 **Technical Enhancements:**
- **Animation Controllers**: Proper lifecycle management
- **State Management**: Clean separation of concerns
- **Navigation Callbacks**: Reusable navigation system
- **Error Handling**: Graceful fallbacks and user feedback

This creates a Reddit-style threaded conversation experience with smooth
animations, inline replies, and intuitive navigation between posts in a chain.
2026-01-30 07:40:19 -06:00

85 lines
2.2 KiB
PowerShell

param(
[string]$EnvPath = (Join-Path $PSScriptRoot "..\.env"),
[switch]$Release
)
if (-not (Test-Path $EnvPath)) {
Write-Error "Env file not found: ${EnvPath}"
exit 1
}
$values = @{}
Get-Content $EnvPath | ForEach-Object {
$line = $_.Trim()
if ($line.Length -eq 0) { return }
if ($line.StartsWith('#')) { return }
$parts = $line -split '=', 2
if ($parts.Count -lt 2) { return }
$key = $parts[0].Trim()
$value = $parts[1].Trim()
if ($value.StartsWith('"') -and $value.EndsWith('"')) {
$value = $value.Substring(1, $value.Length - 2)
}
$values[$key] = $value
}
$required = @('SUPABASE_URL', 'SUPABASE_ANON_KEY', 'API_BASE_URL')
$missing = $required | Where-Object {
-not $values.ContainsKey($_ ) -or [string]::IsNullOrWhiteSpace($values[$_])
}
if ($missing.Count -gt 0) {
Write-Error "Missing required keys in ${EnvPath}: $($missing -join ', ')"
exit 1
}
$defineArgs = @(
"--dart-define=SUPABASE_URL=$($values['SUPABASE_URL'])",
"--dart-define=SUPABASE_ANON_KEY=$($values['SUPABASE_ANON_KEY'])",
"--dart-define=API_BASE_URL=$($values['API_BASE_URL'])"
)
$optionalDefines = @(
'SUPABASE_PUBLISHABLE_KEY',
'SUPABASE_SECRET_KEY',
'SUPABASE_JWT_KID',
'SUPABASE_JWKS_URI'
)
foreach ($opt in $optionalDefines) {
if ($values.ContainsKey($opt) -and -not [string]::IsNullOrWhiteSpace($values[$opt])) {
$defineArgs += "--dart-define=$opt=$($values[$opt])"
}
}
$buildMode = if ($Release) { "release" } else { "debug" }
Write-Host "Building Sojorn web for ${buildMode} mode..." -ForegroundColor Green
Write-Host ""
$ErrorActionPreference = "Continue"
$Error | Out-File -FilePath "web_errors.log" -Append
Push-Location $PSScriptRoot
try {
flutter build web --$buildMode @defineArgs
} finally {
Pop-Location
}
if (Test-Path "web_errors.log") {
Write-Host ""
Write-Host "=== Errors & Warnings ===" -ForegroundColor Yellow
Get-Content "web_errors.log" | Select-String -Pattern "error|warning|Error|Warning" -AllMatches | ForEach-Object {
Write-Host $_ -ForegroundColor Red
}
Write-Host ""
Write-Host "Full log saved to: sojorn_app/web_errors.log" -ForegroundColor Cyan
}
Write-Host ""
Write-Host "Build complete! Output in: sojorn_app/build/web" -ForegroundColor Green