**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.
81 lines
2.3 KiB
PowerShell
81 lines
2.3 KiB
PowerShell
param(
|
|
[string]$EnvPath = (Join-Path $PSScriptRoot ".env"),
|
|
[int]$Port = 8000,
|
|
[string]$Renderer = "auto", # Options: auto, canvaskit, html
|
|
[switch]$NoWasmDryRun
|
|
)
|
|
|
|
function Parse-Env($path) {
|
|
$vals = @{}
|
|
if (-not (Test-Path $path)) {
|
|
Write-Host "No .env file found at ${path}. Falling back to defaults." -ForegroundColor Yellow
|
|
return $vals
|
|
}
|
|
Get-Content $path | ForEach-Object {
|
|
$line = $_.Trim()
|
|
if ($line.Length -eq 0 -or $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)
|
|
}
|
|
$vals[$key] = $value
|
|
}
|
|
return $vals
|
|
}
|
|
|
|
$values = Parse-Env $EnvPath
|
|
|
|
# Collect dart-defines we actually use on web.
|
|
$defineArgs = @()
|
|
$keysOfInterest = @('API_BASE_URL', 'FIREBASE_WEB_VAPID_KEY')
|
|
foreach ($k in $keysOfInterest) {
|
|
if ($values.ContainsKey($k) -and -not [string]::IsNullOrWhiteSpace($values[$k])) {
|
|
$defineArgs += "--dart-define=$k=$($values[$k])"
|
|
}
|
|
}
|
|
|
|
# Ensure API_BASE_URL always points to the public https endpoint.
|
|
if (-not $values.ContainsKey('API_BASE_URL') -or [string]::IsNullOrWhiteSpace($values['API_BASE_URL'])) {
|
|
$defineArgs += "--dart-define=API_BASE_URL=https://api.gosojorn.com/api/v1"
|
|
$currentApi = 'https://api.gosojorn.com/api/v1'
|
|
} else {
|
|
$currentApi = $values['API_BASE_URL']
|
|
if ($currentApi.StartsWith('http://api.gosojorn.com:8080')) {
|
|
$currentApi = $currentApi.Replace('http://api.gosojorn.com:8080', 'https://api.gosojorn.com')
|
|
$defineArgs = $defineArgs | Where-Object { -not ($_ -like '--dart-define=API_BASE_URL=*') }
|
|
$defineArgs += "--dart-define=API_BASE_URL=$currentApi"
|
|
}
|
|
}
|
|
|
|
Write-Host "Launching Sojorn Web..." -ForegroundColor Cyan
|
|
Write-Host "Port: $Port"
|
|
Write-Host "Renderer: $Renderer"
|
|
Write-Host "API: $currentApi"
|
|
|
|
Push-Location (Join-Path $PSScriptRoot -ChildPath "sojorn_app")
|
|
try {
|
|
$cmdArgs = @(
|
|
'run',
|
|
'-d',
|
|
'chrome',
|
|
'--web-hostname',
|
|
'localhost',
|
|
'--web-port',
|
|
"$Port"
|
|
)
|
|
$cmdArgs += $defineArgs
|
|
|
|
if ($NoWasmDryRun) {
|
|
$cmdArgs += '--no-wasm-dry-run'
|
|
}
|
|
|
|
Write-Host "Running: flutter $($cmdArgs -join ' ')" -ForegroundColor DarkGray
|
|
& flutter $cmdArgs
|
|
}
|
|
finally {
|
|
Pop-Location
|
|
}
|