Skip to content

Overhaul Compose UI with adaptive navigation and component architecture#50

Merged
linroid merged 11 commits intomainfrom
ui-overhaul
Feb 12, 2026
Merged

Overhaul Compose UI with adaptive navigation and component architecture#50
linroid merged 11 commits intomainfrom
ui-overhaul

Conversation

@linroid
Copy link
Owner

@linroid linroid commented Feb 12, 2026

Summary

  • Decomposed monolithic App.kt (1300+ lines) into focused composable components organized by feature: ui/list/, ui/sidebar/, ui/toolbar/, ui/dialog/, ui/common/
  • Added adaptive navigation using NavigationSuiteScaffold from material3-adaptive: auto-switches between bottom nav bar (compact <600dp), navigation rail (medium 600-840dp), and custom sidebar (expanded >=840dp)
  • Added FAB for "New Task" on compact/medium layouts where the sidebar isn't visible
  • Adaptive touch targets: 48dp buttons on mobile (Material3 minimum), 32dp on desktop
  • Adaptive spacing: larger padding on compact layouts for comfortable touch interaction
  • Extracted shared state into AppState class and StatusFilter enum with sidebar badge counts
  • Added theme system with Material 3 light/dark color schemes
  • Fixed download speed always showing 0 B/s by collecting progress from task state flows
  • Fixed sidebar counts to properly track task state transitions
  • Added unit tests for FormatUtils and StatusFilter

Test plan

  • Verify desktop app renders with sidebar navigation at expanded width
  • Resize window below 840dp to confirm navigation rail appears
  • Resize window below 600dp to confirm bottom navigation bar appears
  • Verify FAB appears on compact/medium and is hidden on expanded
  • Test on Android device/emulator for proper touch targets
  • Verify download speed updates in real-time during active downloads
  • Run ./gradlew :app:shared:compileCommonMainKotlinMetadata passes

🤖 Generated with Claude Code

linroid and others added 8 commits February 12, 2026 11:55
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>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fix it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • ⚠️ cd /workspace/KDown && ./gradlew :library:core:compileCommonMainKotlinMetadata (blocked in this environment because Gradle could not resolve org.gradle.toolchains.foojay-resolver-convention:1.0.0 from configured plugin repositories).

View task →

linroid and others added 3 commits February 12, 2026 17:41
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>
@linroid linroid merged commit 08c1752 into main Feb 12, 2026
4 checks passed
@linroid linroid deleted the ui-overhaul branch February 12, 2026 09:49
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