Overhaul Compose UI with adaptive navigation and component architecture#50
Overhaul Compose UI with adaptive navigation and component architecture#50
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restructure the monolithic 1,348-line App.kt into a modular component architecture with proper separation of concerns: - Add Motrix-style left sidebar navigation with status filters and task counts - Introduce custom Material 3 dark/light theme with brand color palette - Extract centralized AppState for UI state management - Split download list items into composable components (progress, actions, toggles) - Add collapsible toggle icons for speed limit, priority, schedule, and task info - Add bottom status bar showing backend info and download speed - Add comprehensive tests for format utilities and status filter logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Include Idle state in Downloading filter so sub-counts sum to All - Use mutableStateMapOf for reactive task state tracking and clean stale entries - Use Card onClick instead of Modifier.clickable for proper ripple clipping - Reorder sidebar filters: All, Downloading, Completed, Paused, Failed - Add copy-to-clipboard button on URL row in task info panel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Calculate bytesPerSecond in DownloadCoordinator.buildContext using elapsed time delta (sampled every 500ms) and pass it to DownloadProgress. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace four independent AnimatedVisibility blocks with a single AnimatedContent keyed on the expanded panel enum, so panel transitions crossfade smoothly without intermediate height changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use NavigationSuiteScaffold with material3-adaptive to automatically switch between bottom nav (compact), navigation rail (medium), and custom sidebar (expanded). Add FAB for new task on compact/medium layouts and adaptive touch targets (48dp on mobile, 32dp on desktop). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5b6ba084e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| totalBytes: Long, | ||
| headers: Map<String, String> | ||
| ): DownloadContext { | ||
| var lastBytes = 0L |
There was a problem hiding this comment.
Initialize speed baseline from resumed progress
When a task resumes with partially downloaded segments, HttpDownloadSource.downloadSegments immediately calls onProgress with a non-zero downloaded value (segments.sumOf { it.downloadedBytes }). Because lastBytes is initialized to 0 here, the first elapsed-window calculation includes bytes downloaded before this session and reports a wildly inflated bytesPerSecond for the first update after resume. Seed the baseline from the first observed downloaded value (or skip the first delta sample) so resumed tasks report accurate speed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Fixed resumed-download speed sampling by seeding the speed baseline from the first observed
downloadedvalue inbuildContext, so pre-existing bytes from earlier sessions are not counted in the first delta sample. This prevents an inflated initialbytesPerSecondafter resume while preserving the existing 500ms update window behavior. library/core/src/commonMain/kotlin/com/linroid/kdown/core/engine/DownloadCoordinator.ktL587-L610 - Added a
hasProgressBaselineguard so the first callback initializeslastBytes/lastMarkand subsequent callbacks compute speed normally. library/core/src/commonMain/kotlin/com/linroid/kdown/core/engine/DownloadCoordinator.ktL590-L603 - Committed the change as
e75d37fand created a follow-up PR entry via themake_prtool as requested.
Testing
⚠️ cd /workspace/KDown && ./gradlew :library:core:compileCommonMainKotlinMetadata(blocked in this environment because Gradle could not resolveorg.gradle.toolchains.foojay-resolver-convention:1.0.0from configured plugin repositories).
Remove filter labels on compact/medium nav, increase nav icons to 32dp. Move delete action from inline action buttons to the bottom-right of each card, sharing the row with panel toggle icons. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts keeping adaptive UI changes (NavigationSuiteScaffold, adaptive touch targets, delete button in panel row, filterIcon internal). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
App.kt(1300+ lines) into focused composable components organized by feature:ui/list/,ui/sidebar/,ui/toolbar/,ui/dialog/,ui/common/NavigationSuiteScaffoldfrom material3-adaptive: auto-switches between bottom nav bar (compact <600dp), navigation rail (medium 600-840dp), and custom sidebar (expanded >=840dp)AppStateclass andStatusFilterenum with sidebar badge countsFormatUtilsandStatusFilterTest plan
./gradlew :app:shared:compileCommonMainKotlinMetadatapasses🤖 Generated with Claude Code