Skip to content

Add agent project guidance#74

Merged
ohmzi merged 52 commits into
masterfrom
develop
May 20, 2026
Merged

Add agent project guidance#74
ohmzi merged 52 commits into
masterfrom
develop

Conversation

@ohmzi
Copy link
Copy Markdown
Owner

@ohmzi ohmzi commented May 19, 2026

Summary

  • Add a root AGENTS.md with workflow, git attribution, and cross-platform UX parity guidance for future agents
  • Document the mobile calendar behavior contract learned from the Android/iOS parity work
  • Link AGENTS.md from the README documentation table

Verification

  • git diff --check

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented May 19, 2026

DeepSource Code Review

We reviewed changes in e24d14a...2039f2e on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript May 20, 2026 11:44p.m. Review ↗
Kotlin May 20, 2026 11:44p.m. Review ↗
Secrets May 20, 2026 11:44p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

ohmzi added 20 commits May 19, 2026 10:15
…eline screens.

This update introduces a dynamic top inset for the first item in the first section of the timeline, providing a smoother visual transition ("elastic clearance") as the screen title collapses.

- **Timeline UI Improvements**:
    - Implement `firstPinnedRowElasticTopInset` in `TodoListScreen` and `CompletedScreen` to calculate dynamic padding based on `titleCollapseProgress`.
    - Apply this inset specifically to the first item of the first section when certain view modes (Overdue, Scheduled, or specific "earlier" priority groups) are active.
    - Update `ForEach` loops in both screens to use enumerated arrays to identify the first item (`itemIndex == 0`) for padding application.

- **Metrics & Constants**:
    - Add `firstPinnedRowElasticClearance` (34pt), `firstPinnedRowElasticStart` (0.42), and `firstPinnedRowElasticEnd` (1.0) to `TodoTimelineMetrics` to control the animation threshold and distance.
This update refactors the elastic clearance logic used in `CompletedScreen` and `TodoListScreen` to improve visual consistency during scroll interactions. It ensures that pinned headers and the first items in sections respect collapse progress metrics, while also introducing a custom button style for the timeline top bar.

- **Elastic Layout Improvements**:
    - Rename `firstPinnedRowElastic` constants to `firstPinnedElastic` in `TodoTimelineMetrics` to reflect broader usage across headers and rows.
    - Implement `firstPinnedHeaderElasticTopInset` in both `CompletedScreen` and `TodoListScreen` to apply dynamic top padding to pinned section headers based on scroll progress.
    - Refactor row clearance into a reusable `firstPinnedElasticClearance` helper function.
    - Update `shouldApplyFirstPinnedElasticClearance` in `TodoListScreen` to include the "Today" view mode and specific section IDs ("earlier").

- **UI & Components**:
    - Introduce `TimelineTopBarButtonStyle`, a custom `ButtonStyle` that replaces `TdayPressButtonStyle` for top bar actions, featuring refined ripple effects, scale transforms, and dynamic shadows based on the button's fill state.
    - Update `minimalTimelineRow` in `TodoListScreen` to use an enumerated `ForEach` to correctly identify the first item in a section for applying elastic offsets.

- **Refactoring**:
    - Consolidate logic for calculating top insets for pinned elements to reduce duplication and improve maintainability of the timeline's "sticky" behavior.
…reen.

This change introduces a dynamic top inset for the mode tabs that responds to the calendar's scroll progress, ensuring smoother visual transitions as the title collapses.

- **Animation & Metrics**:
    - Add `modeTabsElasticClearance`, `modeTabsElasticStart`, and `modeTabsElasticEnd` constants to `CalendarTitleHandoff` to define the elastic animation range.
    - Implement `modeTabsElasticTopInset` computed property to calculate the dynamic offset based on `titleCollapseProgress`.
- **UI Integration**: Update the `CalendarModeTabs` list row in `CalendarScreen.swift` to apply the calculated elastic top padding.
This change improves the visual feedback and touch behavior for date cells within the `CalendarScreen` by implementing a bounded ripple effect and ensuring proper clipping.

- **UI & Interaction**:
    - Update `CalendarDayCell` to use a bounded `ripple` indication with a fixed radius of 28.dp.
    - Explicitly clip the cell to its defined `cellShape` to ensure the click interaction and ripple are contained within the cell boundaries.
    - Implement `MutableInteractionSource` for the cell's clickable modifier.
…s on iOS and Android.

This update replaces custom-built tab implementations with platform-standard components—`Picker` on iOS and `SegmentedButton` on Android. This change simplifies the UI logic while maintaining a consistent visual identity across both platforms.

- **iOS (SwiftUI)**:
    - Replace the custom `HStack` and `Button` layout in `CalendarViewModeTabs` with a native `Picker` using the `.segmented` picker style.
    - Add an `accentColor` parameter to `CalendarViewModeTabs` to drive the picker's tint.
    - Implement a local `Binding` to bridge the picker’s selection state with the existing `onSelect` callback.

- **Android (Compose)**:
    - Replace the custom `Card` and `Row` implementation with Material 3 `SingleChoiceSegmentedButtonRow` and `SegmentedButton`.
    - Define a custom color scheme for the segmented buttons using `CalendarAccentPurple` for active states and standard surface colors for inactive states.
    - Simplify the layout logic by using `SegmentedButtonDefaults.itemShape` and removing manual padding and background management.
This update simplifies the layout logic for the `CalendarScreen` by removing elastic inset calculations for the mode tabs and standardizing the title row height.

- **Layout & Metrics**:
    - Replace `expandedTitleHeight` with a local `titleRowHeight` constant (mapped to `TodoTimelineMetrics.titleCollapseDistance`) for the calendar header.
    - Remove `modeTabsElasticTopInset` logic, including its associated progress calculation and constants (`modeTabsElasticStart`, `modeTabsElasticEnd`, and `modeTabsElasticClearance`).
    - Set the top inset of the task mode tabs to a static `0`, removing the dynamic shifting behavior during scroll.
- **UI Consistency**: Ensure the header title frame explicitly uses the new `titleRowHeight` for both minimum and maximum height constraints.
…for the Android Compose client.

This update replaces the standard Material 3 `SingleChoiceSegmentedButtonRow` with a custom-built animated selector and adjusts the layout spacing and dimensions of the calendar navigation cards for a more polished look.

- **Calendar View Mode Tabs**:
    - Implement a custom `CalendarViewModeTabs` using a sliding background selector with `animateDpAsState`.
    - Add tactile feedback using scale animations and custom ripple effects on selection.
    - Enhance visual styling with a semi-transparent `surfaceVariant` background, custom shadows, and `CalendarAccentPurple` highlights.
    - Replace the `ExperimentalMaterial3Api` segmented buttons with a manual `Row` and `selectableGroup` implementation.

- **Mini-Calendar UI Refinement**:
    - Adjust `RoundedCornerShape` values across calendar cards from 28.dp to 24.dp.
    - Standardize card heights and increase vertical spacing/padding for better visual balance.
    - Update `CalendarDayItem` shape and height to match the new layout constraints.
    - Add explicit height constraints to navigation rows and animated content containers to prevent layout jumping during transitions.
…and iOS platforms.

This update introduces a custom segmented control for calendar view modes on iOS, enhances the visual feedback of the selection UI on Android, and refactors timeline header elasticity to improve list scrolling behavior.

- **iOS Calendar & UI**:
    - Implement `ThickSegmentedControl`, a custom `UISegmentedControl` subclass with a fixed 52pt height for improved touch targets.
    - Replace the standard SwiftUI `Picker` with a `UIViewRepresentable` implementation of the new thick control.
    - Add `tint` support to `TimelineTopBarAction` and `TimelineTopBarButton` to allow accent-colored header actions.
    - Apply the calendar accent color to the "Jump to Today" button.

- **Android Calendar UI**:
    - Enhance `CalendarViewModeSelector` with sophisticated press animations, including scaling effects and dynamic alpha adjustments for surface and accent layers.
    - Implement a "press halo" background effect for unselected segments when pressed.
    - Integrate haptic feedback (`CLOCK_TICK`) when switching between calendar modes.
    - Update the "Jump to Today" top bar button to support accent-colored styling with a dedicated border and tint.

- **Task Timeline Refinement**:
    - Remove elastic top insets from pinned section headers in `TodoListScreen` and `CompletedScreen`, applying the clearance solely to the first row of the section.
    - Rename elastic metrics from `firstPinnedElastic*` to `firstPinnedRowElastic*` to more accurately reflect their application to list items rather than headers.
    - Simplify `EdgeInsets` logic in timeline lists to use static offsets for non-primary sections.
…the iOS client.

This update restores the system swipe-to-back gesture when using custom navigation configurations and improves the visual consistency of the todo list interface, particularly for the "List" view mode.

- **Navigation**:
    - Implement `NavigationInteractivePopGestureConfigurator` to re-enable the interactive pop gesture (swipe-to-back) even when the default back button is hidden or customized.
    - Add `.navigationInteractivePopGesture()` view extension to simplify gesture attachment.

- **UI & Components**:
    - Enhance `TimelineTopBarButton` with a new `.outlined` chrome style featuring a subtle border.
    - Update `TimelineTopBarAction` to support optional circular chrome, used for the settings button in list view.
    - Update the "List" mode icon from `slider.horizontal.3` to `ellipsis`.

- **Todo List Logic**:
    - Refactor `TodoListScreen` to treat `.list` mode as a minimal timeline mode, improving layout consistency with `.scheduled` and `.priority` views.
    - Align `todoTimelineSections` for `.list` mode with the standard future timeline builder to ensure consistent section grouping and sorting.
    - Update todo row metadata in `.list` mode to explicitly display "Overdue" status when applicable.
This update applies the `.navigationInteractivePopGesture()` modifier to the main navigation stack in `AppRootView.swift`, ensuring that users can use the standard edge-swipe gesture to navigate back even when custom navigation configurations are present.
…discovery.

This update improves the consistency of the custom back gesture by introducing more robust navigation controller lookup and addressing timing issues during view transitions.

- **Gesture Handling & Reliability**:
    - Update `scheduleGestureUpdate` to perform multiple state applications with incremental delays (0ms, 50ms, and 200ms) to ensure the gesture state is correctly applied after layout transitions.
    - Trigger gesture updates in `viewDidAppear` to handle cases where the view re-enters the hierarchy.
    - Set `cancelsTouchesInView` to true on the `interactivePopGestureRecognizer` to prevent touch conflicts.
    - Implement `shouldRecognizeSimultaneouslyWith` to allow the interactive pop gesture to operate alongside other gesture recognizers.

- **Navigation Controller Discovery**:
    - Add a recursive extension `nearestNavigationControllerInHierarchy()` to `UIViewController` to better locate the active navigation stack.
    - Refactor discovery logic to traverse the entire window hierarchy, including child and presented view controllers, ensuring the correct `UINavigationController` is targeted even in complex nested layouts.
…tUI client.

This update replaces the standard navigation bar with a custom-designed header to align with the application's visual style. The new header features stylized "Cancel" and "Submit" buttons with a capsule-shaped geometry and refined typography.

- **Header Implementation**:
    - Create `CreateTaskSheetHeader` to replace the default navigation title and toolbar.
    - Implement `CreateTaskSheetHeaderButton` using a `Capsule` shape, custom border stroke, and `tdayRounded` typography.
    - Add `CreateTaskSheetHeaderButtonStyle` to handle press interactions with scale and opacity animations.

- **UI Refactoring**:
    - Wrap the `Form` and the new header in a `VStack` within `CreateTaskSheet`.
    - Hide the standard navigation bar using `.toolbar(.hidden, for: .navigationBar)`.
    - Adjust padding and layout constraints to ensure the header remains fixed at the top of the sheet.
    - Update the submit button logic to display "Saving..." during the asynchronous submission process.
…ents.

This update replaces hardcoded layout values with centralized constants for the calendar period card components, ensuring visual consistency across platforms and simplifying future layout adjustments.

- **iOS (SwiftUI)**:
    - Introduce `CalendarPeriodCardMetrics` to define shared spacing, height, and padding values.
    - Standardize the pager height at 78pt for both week and day views.
    - Update `CalendarPeriodCard` and `CalendarDayCard` to use the new metric constants.
- **Android (Compose)**:
    - Introduce `CalendarPeriodCardPageHeight` (78.dp) and `CalendarPeriodCardBottomPadding` (18.dp) constants.
    - Standardize the height of the calendar pager across the `CalendarPeriodCard` and `DayPager` components.
    - Adjust the bottom padding of the day view to match the week view's layout.
…e calendar's visual consistency across both Android and iOS platforms.

- **iOS UI/UX Enhancements**:
    - Redesign `CreateTaskSheet` and `ListSettingsSheet` headers, replacing text-based "Cancel" and "Save" buttons with circular icon buttons (xmark/checkmark) featuring colored strokes and custom press styles.
    - Update sheet titles from "Create Task" to "New task" for brevity and increased font weight/size.
    - Implement a custom `ListSettingsSheetHeader` to standardize the appearance of list configuration screens.
    - Refine accent colors for destructive and affirmative actions across various action sheets.

- **Android Calendar Refinement**:
    - Introduce a comprehensive set of design tokens for the `CalendarScreen` to manage dimensions, paddings, and typography consistently.
    - Redesign the mini-calendar month grid: cells now feature a circular background for the selected date/today and a more compact layout for task indicators.
    - Update navigation buttons with specific dimensions and active/pressed state background colors.
    - Adjust weekday headers and day cell typography for improved readability and alignment.

- **Cross-Platform Consistency**:
    - Align header heights and horizontal paddings in calendar period cards across both iOS and Android.
    - Standardize task count summary styling and date range formatting in calendar views.
…o unify the visual style, improve spacing, and enhance "today" highlighting.

- **Unified Styling & Colors**:
    - Introduce a dedicated "today" tint color (Blue #509AE6) for both platforms to distinguish current day from selection (Purple).
    - Update day cell backgrounds, borders, and text colors to use subtler opacities and thicker strokes for active states.
    - Synchronize typography across both platforms, notably increasing the calendar header title size to 21sp/pt.

- **Android (Compose) Enhancements**:
    - Wrap the calendar card in a `Box` with consistent shadow, clipping, and `AnimatedContent` size transformations to prevent layout jumps during view mode transitions.
    - Refactor `CalendarMonthDateCell` and `CalendarPeriodDayCell` with updated dimensions (42dp height) and rounded rectangle shapes (16dp).
    - Implement a custom interaction state for month cells, replacing the standard ripple with a bespoke background/border animation.
    - Adjust grid spacing from 11dp to 8dp and inner content arrangement for a denser, cleaner look.

- **iOS (SwiftUI) Enhancements**:
    - Update `CalendarMonthGridMetrics` and `CalendarPeriodCardMetrics` to match Android's new spacing and sizing logic.
    - Refactor month day cells to use a `RoundedRectangle` background and stroke instead of the previous `Circle` highlight.
    - Implement `CalendarNavButton` to standardize the appearance and behavior of navigation chevrons.
    - Adjust cell horizontal gutters and vertical spacing to improve alignment within the paging component.

- **Shared Logic**:
    - Standardize task count indicators with a consistent dot size (4.6dp) and refined typography.
    - Update navigation logic to ensure consistency in disabled states and padding across week, month, and day views.
…o unify the visual style, improve spacing, and enhance "today" highlighting.

- **Unified Styling & Colors**:
    - Introduce a dedicated "today" tint color (Blue #509AE6) for both platforms to distinguish current day from selection (Purple).
    - Update day cell backgrounds, borders, and text colors to use subtler opacities and thicker strokes for active states.
    - Synchronize typography across both platforms, notably increasing the calendar header title size to 21sp/pt.

- **Android (Compose) Enhancements**:
    - Wrap the calendar card in a `Box` with consistent shadow, clipping, and `AnimatedContent` size transformations to prevent layout jumps during view mode transitions.
    - Refactor `CalendarMonthDateCell` and `CalendarPeriodDayCell` with updated dimensions (42dp height) and rounded rectangle shapes (16dp).
    - Implement a custom interaction state for month cells, replacing the standard ripple with a bespoke background/border animation.
    - Adjust grid spacing from 11dp to 8dp and inner content arrangement for a denser, cleaner look.

- **iOS (SwiftUI) Enhancements**:
    - Update `CalendarMonthGridMetrics` and `CalendarPeriodCardMetrics` to match Android's new spacing and sizing logic.
    - Refactor month day cells to use a `RoundedRectangle` background and stroke instead of the previous `Circle` highlight.
    - Implement `CalendarNavButton` to standardize the appearance and behavior of navigation chevrons.
    - Adjust cell horizontal gutters and vertical spacing to improve alignment within the paging component.

- **Shared Logic**:
    - Standardize task count indicators with a consistent dot size (4.6dp) and refined typography.
    - Update navigation logic to ensure consistency in disabled states and padding across week, month, and day views.
…OS and Android platforms.

This update focuses on polishing the layout of the list creation interface, improving typography, and enhancing the visual transition of the top bar during scroll interactions.

- **iOS Todo List Enhancements**:
    - Introduce "handoff cover" metrics and logic in `TodoListScreen` to provide a smoother visual transition for the top bar as content scrolls beneath it.
    - Simplify `shouldApplyFirstPinnedRowElasticClearance` by using a comprehensive switch statement over `viewModel.mode`.
    - Add a background overlay to the top bar with dynamic opacity (`handoffCoverOpacity`) to blend with the background during scroll.

- **iOS Home & List Creation**:
    - Remove the outer `ScrollView` from the `CreateListSheet` and adjust the layout to a fixed `VStack` with a flexible `fraction(0.8)` detent.
    - Reduce font sizes for the "New list" title, section headers, and the list name `TextField` for a more compact design.
    - Adjust padding and corner radii within the list creation cards and input fields.

- **Android Home & List Creation**:
    - Remove `verticalScroll` from the list creation sheet to maintain a stable layout.
    - Implement auto-focus logic using `FocusRequester` and `LaunchedEffect` to automatically show the keyboard when the "New list" sheet appears.
    - Remove the redundant "List" section title to match the streamlined iOS layout.
…n both iOS and Android platforms."

This reverts commit 1d94a36.
…(SwiftUI) to improve UI consistency, simplify navigation, and enhance the user experience.

This update replaces multi-page navigation flows with single-page scrollable layouts, introduces dropdown menus for selection on Android, and refines typography and spacing across both platforms.

- **Android (Compose)**:
    - **Simplified Task Creation**: Remove `TaskSheetPage` state and multi-page navigation. Consolidate scheduling and organization into a single view.
    - **Dropdown Selection**: Replace full-page selection screens for Lists, Priority, and Repeat options with `DropdownMenu` components (`SheetDropdownRow`).
    - **Improved UX**: Add `FocusRequester` to the "New List" sheet to automatically focus the name field and show the keyboard on launch.
    - **UI Polish**: Update icons (e.g., `ExpandMore` instead of `ChevronRight`) and refine layout spacing in `CreateTaskBottomSheet` and `HomeScreen`.

- **iOS (SwiftUI)**:
    - **Task Sheet Redesign**: Replace `Form` and `Picker` with custom `CreateTaskSheetGroupCard` and `Menu` based rows for a more modern, integrated look.
    - **New Components**: Implement `CreateTaskSheetDueRow` with integrated `DatePicker` chips and `CreateTaskSheetMenuRow` for list/priority/repeat selection.
    - **Color & Style**: Add helper functions for consistent color swatches across lists, priorities, and repeat rules. Update typography to use `tdayRounded` with revised weights and sizes.
    - **Presentation**: Adjust sheet presentation to use a `0.8` fraction detent and a larger corner radius (34pt).

- **Shared UI Logic**:
    - Harmonize section titles and headers across both platforms for a consistent brand identity.
    - Update list and task creation headers to use a more compact typography style.
This update focuses on improving the visual consistency and responsiveness of "Create Task" and "Create List" sheets. It introduces a custom dialog-based selector on Android to replace standard dropdowns and implements dynamic sheet heights on iOS to better accommodate keyboard states and content size.

- **Create Task UI Improvements**:
    - **iOS**: Replace `ViewThatFits` with a simplified `HStack` layout for date and time chips. Implement a custom `ZStack` for `DatePicker` to allow better text styling (bold, rounded) while maintaining native picker functionality.
    - **Android**: Refactor `SheetRow` to improve alignment of value text and chevron icons.
    - **Unified Component**: Update `CreateTaskSheetDatePickerChip` and `SheetRow` with consistent padding and geometry.

- **Selection Dialogs (Android)**:
    - Replace `DropdownMenu` with `CenteredSelectorDialog`, a custom modal dialog providing a more focused selection experience for list colors and icons.
    - Implement `CenteredSelectorRow` with support for color swatches, checkmark indicators, and bold typography.

- **Dynamic Sheet Behavior (iOS)**:
    - Implement dynamic height adjustment for the "Create List" sheet using `PreferenceKey` and `GeometryReader`.
    - Add support for multiple presentation detents, automatically switching between a compact height and a "typing" height (80% fraction) when the name field is focused.

- **Keyboard & Focus Handling (Android)**:
    - Update `CreateListBottomSheet` to dynamically toggle between `wrap_content` and `fillMaxHeight(0.8f)` based on IME (keyboard) visibility and focus state.
    - Center-align text within the list name input field.
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@Composable
private fun CreateListBottomSheet(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`CreateListBottomSheet` has a cyclomatic complexity of 17 with "High" risk


Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A function with high cyclomatic
complexity can be hard to understand and maintain. A higher cyclomatic
complexity indicates that the function has more decision points and is more complex.

ohmzi added 7 commits May 19, 2026 18:40
… standard system menus with a custom overlay-based selector and a unified date-time control.

- **Custom Selector UI**:
    - Introduce `CreateTaskSheetSelector` enum to manage the state of active selection overlays for lists, priorities, and recurrence rules.
    - Replace `CreateTaskSheetMenuRow` (using system `Menu`) with `CreateTaskSheetSelectorTriggerRow` and a dedicated `selectorOverlay` using `CreateTaskSheetSelectorCard`.
    - Implement `CreateTaskSheetSelectorRow` to provide a consistent, branded selection experience with color swatches and checkmark indicators.

- **Date & Time Picking**:
    - Replace individual date and time chips with a unified `CreateTaskSheetDateTimeControl` component.
    - Refactor the underlying layout to use a single container with a custom border and a vertical divider between date and time labels.
    - Update typography to use `.tdayRounded` weight `.heavy` for improved legibility in the date-time display.

- **Component Refactoring**:
    - Extract repeated UI patterns into new sub-views: `CreateTaskSheetSelectorCard`, `CreateTaskSheetSelectorRow`, and `CreateTaskSheetSelectorDivider`.
    - Adjust styles for existing components, including updated corner radii, background opacities, and font weights to align with a more refined design language.
This update renames the `.repeat` case to `.recurrence` within the `CreateTaskSheetSelector` enum and its associated logic. This change improves code clarity and avoids potential conflicts with the `repeat` keyword.

- **Refactoring**:
    - Rename `CreateTaskSheetSelector.repeat` to `CreateTaskSheetSelector.recurrence`.
    - Update `activeSelector` assignments and switch-case statements in `CreateTaskSheet.swift` to reflect the rename.
    - Ensure the UI display title for the `.recurrence` case remains "Repeat".
…ss Android and iOS clients.

This update introduces tracking for list creation dates (`createdAt`) in the local offline cache. This data is utilized to implement a standardized sorting mechanism (`orderListsLikeWeb`) that orders lists by creation date descending, ensuring UI consistency with the web platform.

- **Data Model & Persistence**:
    - Add `createdAtEpochMs` to `CachedListEntity` (Android) and `CachedListRecord` (iOS).
    - **Android**: Increment Room database version to 3 and implement `MIGRATION_2_3` to add the `createdAtEpochMs` column to the `cached_lists` table.
    - **iOS**: Update `CachedListEntity` SwiftData model and `CachedListRecord` to include the optional creation timestamp.
    - Update entity mappers and DTO parsers on both platforms to handle the new `createdAt` field.

- **Sorting Logic**:
    - Implement `orderListsLikeWeb` utility function to sort lists by `createdAtEpochMs` in descending order, falling back to original indices for stability.
    - Integrate the new sorting logic into `SyncManager`, `TodoRepository`, and `ListRepository` on both Android and iOS to ensure a consistent list display.
    - Replace previous alphabetical sorting in the iOS `ListRepository` with the creation-date-based order.

- **Refinement & Testing**:
    - Update `ListSummary` domain models to include the `createdAt` property.
    - Enhance `CacheMappersTest.kt` with new test cases for round-trip mapping and sorting verification of list creation timestamps.
    - Ensure local list creation accurately captures and persists the current timestamp.
…for both Android and iOS.

This update replaces the standard system-styled settings on iOS with a bespoke, branded design and introduces a dedicated "App Version" screen to track releases. Additionally, it refines the timeline experience by adding smooth expand/collapse animations and visual feedback for section headers.

- **Settings & Versioning (iOS)**:
    - Redesign `SettingsScreen` with custom cards, iconography, and a tailored typography system, moving away from `Form` and `Picker` defaults.
    - Implement `LatestReleaseScreen` to display GitHub release notes, version compatibility status, and links to official releases.
    - Add `GitHubRelease` model and update `AppViewModel` to fetch release metadata and changelogs from the GitHub API.
    - Update `AppRoute` and `AppRootView` to support navigation to the new version details screen.

- **Timeline UI & Animations (Multi-platform)**:
    - **Android (Compose)**: Implement `AnimatedVisibility` with `expandVertically` and `shrinkVertically` for todo and completed sections. Add rotation animations and state-aware color tinting to section chevrons.
    - **iOS (SwiftUI)**: Implement a custom multi-phase collapse/reveal system in `CompletedScreen` and `TodoListScreen` to manage view rendering and opacity transitions during section toggling.
    - Enhance section headers with press-responsive brightness adjustments and smoother haptic-like visual feedback.

- **Admin Features**:
    - Improve the "AI task summary" toggle in settings with loading states, error handling for validation, and clearer "saving" indicators.

- **Navigation**:
    - Add `latest-release` deep-link path and update navigation logic to handle the new versioning view.
… and iOS clients to improve performance and animation smoothness.

This update simplifies the rendering logic for collapsible list sections by moving away from manual opacity/visibility tracking in favor of native transition and animation systems.

- **Android (Compose)**:
    - Flatten `LazyColumn` structure by replacing nested `AnimatedVisibility` with direct item-level rendering conditional on the collapse state.
    - Utilize `animateItem()` with custom `fadeInSpec`, `fadeOutSpec`, and `placementSpec` (FastOutSlowInEasing) for smoother row transitions.
    - Refactor `CompletedTimelineSection` and `TimelineSectionBody` into granular header and row components to reduce recomposition scope.
    - Animate the bottom spacing of section headers during transitions using `animateDpAsState`.

- **iOS (SwiftUI)**:
    - Remove redundant `@State` properties (`collapsingSectionIDs`, `revealingSectionIDs`) used for manual animation orchestration.
    - Replace custom opacity logic with `AnyTransition.asymmetric` combining opacity and vertical movement for rows.
    - Update `toggleTimelineSection` to use a spring animation (`response: 0.28`, `dampingFraction: 0.9`) for a more responsive feel.
    - Prevent empty sections from being marked as collapsible.

- **General**:
    - Synchronize animation durations across platforms (approx. 200–300ms) for a consistent user experience.
    - Improve "Quick Add" logic to properly handle section collapse states.
This change optimizes the task list rendering by removing invisible spacer rows previously used for empty sections.

- **UI Refinement**: Remove the `Color.clear` placeholder and its associated layout logic (frames, insets, and separator hiding) when a timeline section contains no items.
- **Cleanup**: Simplify the `ForEach` loop within the task list to conditionally render sections only when they contain one or more items.
…screens.

This update replaces the static headers in the Settings and App Version screens with a dynamic, scroll-responsive navigation system. It introduces smooth transitions between expanded hero titles and compact top bars, aligning these screens with the application's established timeline animation patterns.

- **Navigation & UI Consistency**:
    - Replace `SettingsPageHeader` with `TimelineTopBar` and `TimelineExpandedTitleRow` to support title collapse animations.
    - Implement `TimelineScrollOffsetObserver` in `SettingsScreen` and `AppVersionScreen` to track scroll progress.
    - Add `onVerticalScrollSnap` logic to handle snapping transitions based on `TodoTimelineMetrics.titleCollapseDistance`.
    - Configure `safeAreaInset` to host the persistent top bar and hide the default system navigation bar.

- **Refactoring**:
    - Remove the redundant `SettingsPageHeader` struct and `SettingsBackButtonStyle`.
    - Centralize title collapse progress calculation logic within the screen views using a private `titleCollapseProgress` property.
    - Standardize back button behavior using the custom `.navigationBackButtonBehavior()` modifier.
ohmzi added 18 commits May 20, 2026 11:19
This update replaces static prefix strings with formatted string resources in the Android Compose client. This change ensures better support for localization and follows Android's recommended practices for dynamic string construction.

- **String Resources**:
    - Replace `todos_due_overdue_prefix` and `todos_due_prefix` with formatted versions: `todos_due_overdue_text` ("Overdue, %1$s") and `todos_due_text` ("Due %1$s").
- **UI & Logic**:
    - Update `TodoListScreen.kt` to use `stringResource` with arguments when displaying due dates and overdue statuses in task subtitles and detail views.
    - Simplify string concatenation logic by leveraging resource-based formatting.
…ents.

This update standardizes text input behavior in the task creation sheet, simplifies the "Completed" screen by removing the undo functionality, and polishes UI elements like timestamps and labels.

- **Task Creation Enhancements**:
    - **iOS**: Update `CreateTaskSheet` to strip newlines from title and notes. Add a "Done" submit label and ensure the keyboard dismisses on submission.
    - **Android**: Update `CreateTaskBottomSheet` to force single-line input for both title and notes (stripping newlines). Implement `ImeAction.Done` to clear focus and dismiss the keyboard.

- **Completed Screen Refactoring**:
    - **Android**: Remove the "uncomplete" (undo) logic, including the multi-phase restoration animation and the `uncomplete` method in `CompletedViewModel`.
    - **UI Polish**: Replace the interactive checkmark with a static icon in the completed list. Add a clock icon next to the completion timestamp for better visual hierarchy.
    - **iOS**: Update the timeline row to include a system clock icon and adjust the opacity of the completion time text.

- **Resource & String Updates**:
    - Refactor `settings_role_prefix` to `settings_role_label` using string placeholders for better localization support.
    - Remove unused completion-related strings in `strings.xml`.
    - Fix a UI alignment issue in the Android Settings screen role label.
…e iOS SwiftUI client.

This update synchronizes the settings screen's visual transitions with the app's timeline-based UI patterns. It introduces precise title reveal thresholds, vertical scroll snapping, and dynamic layout adjustments based on scroll progress.

- **Scroll & Transition Logic**:
    - Implement `TimelineScrollOffsetObserver` to track vertical scroll position and update `settingsScrollOffset`.
    - Apply `onVerticalScrollSnap` using `TodoTimelineMetrics.titleCollapseDistance` and disable vertical scroll bounce for a more controlled navigation experience.
    - Define `topTitleRevealStart` (0.48) and `topTitleRevealEnd` (0.76) constants to fine-tune the timing of the header title visibility.

- **Header UI Enhancements**:
    - Update `SettingsHeader` to support granular title reveal parameters, including start/end thresholds and a reveal distance of 6.
    - Add a dynamic `profileCardTopClearance` property that calculates bottom padding for the header based on `titleCollapseProgress`.
    - Refactor the header layout to move scroll observation and snapping modifiers from the header subview to the primary `ScrollView` container.
This update ensures that the software keyboard is explicitly hidden and focus is cleared when dismissing the bottom sheet, completing a task, or triggering the "Done" IME action.

- **Focus & Keyboard Handling**:
    - Introduce `dismissKeyboard` helper using `LocalSoftwareKeyboardController` and `LocalFocusManager` to ensure the keyboard is retracted and focus is cleared simultaneously.
    - Apply `dismissKeyboard` to the "Close" and "Confirm" actions within the bottom sheet.
    - Update `TaskInputFields` to explicitly hide the keyboard and trigger the default `ImeAction.Done` behavior when the user finishes editing.
… a `List` for the iOS SwiftUI client.

This update migrates the layout architecture to use a `List` component, providing better integration with system list behaviors while maintaining the custom collapsing top bar effect and visual styling.

- **UI Refactoring**:
    - Replace `ScrollView` and `VStack` with a `List` utilizing `.plain` style and hidden background.
    - Implement `settingsListRow` helper to standardize row insets, backgrounds, and spacing across all settings sections.
    - Move `TimelineScrollOffsetObserver` and scroll snapping logic into the hero title row to maintain dynamic header animations.
    - Adjust navigation bar configuration, ensuring the `TimelineTopBar` correctly overlays the list with the proper safe area insets.

- **Styling & Layout**:
    - Remove hardcoded title reveal constants (`topTitleRevealStart`, `topTitleRevealEnd`) in favor of standard `TimelineTopBar` defaults.
    - Replace manual `Spacer` and padding with list-based spacing and a clear footer row.
    - Apply `navigationTitleTypography` and `navigationBackButtonBehavior` modifiers for consistent header appearance.
    - Ensure vertical scroll bounce is disabled to match the previous interaction model.
…ftUI client to improve scrolling behavior and layout consistency.

This update migrates the release information view from a `ScrollView` to a `List` implementation, matching the structure of the main settings screen. It also introduces dynamic top insets to handle "hero title" collapse animations gracefully.

- **Layout & Scroll Performance**:
    - Convert the "App Version" screen from `ScrollView` + `VStack` to a `List` with custom row styling.
    - Implement `utilityFirstContentTopInset` to calculate dynamic spacing for the first content row based on the title's collapse progress.
    - Add a transparent footer spacer in both `SettingsScreen` and the release view to ensure content is not obscured by UI elements and supports proper scroll snapping.
    - Apply `.disableVerticalScrollBounce()` and hide standard list backgrounds to maintain a clean, custom design.

- **Component Refactoring**:
    - Update `settingsListRow` in `SettingsScreen` to support a configurable `topInset`.
    - Implement `releaseListRow` in the version view to standardize row insets and separators.
    - Refactor `releaseHeroTitleRow` to integrate with the list-based scrolling logic, including vertical scroll snapping.

- **Bug Fixes & UX**:
    - Fix layout issues where version info content could overlap or lack proper padding when transitioning between loading, error, and data states.
    - Ensure the "App Version" screen correctly initializes version info via `.task` and respects the custom navigation bar behavior.
…ftUI client to improve scrolling behavior and layout consistency.

This update migrates the release information view from a `ScrollView` to a `List` implementation, matching the structure of the main settings screen. It also introduces dynamic top insets to handle "hero title" collapse animations gracefully.

- **Layout & Scroll Performance**:
    - Convert the "App Version" screen from `ScrollView` + `VStack` to a `List` with custom row styling.
    - Implement `utilityFirstContentTopInset` to calculate dynamic spacing for the first content row based on the title's collapse progress.
    - Add a transparent footer spacer in both `SettingsScreen` and the release view to ensure content is not obscured by UI elements and supports proper scroll snapping.
    - Apply `.disableVerticalScrollBounce()` and hide standard list backgrounds to maintain a clean, custom design.

- **Component Refactoring**:
    - Update `settingsListRow` in `SettingsScreen` to support a configurable `topInset`.
    - Implement `releaseListRow` in the version view to standardize row insets and separators.
    - Refactor `releaseHeroTitleRow` to integrate with the list-based scrolling logic, including vertical scroll snapping.

- **Bug Fixes & UX**:
    - Fix layout issues where version info content could overlap or lack proper padding when transitioning between loading, error, and data states.
    - Ensure the "App Version" screen correctly initializes version info via `.task` and respects the custom navigation bar behavior.
… navigation items.

This update enhances the visual consistency of the `TimelineTopBarActionButton` by introducing dynamic color logic for outlined states and applying the circular chrome style to primary actions in the Calendar and Todo List screens.

- **Calendar & Todo List Integration**:
    - Enable `usesCircularChrome` for the "jump to today" (calendar icon) action in `CalendarScreen`.
    - Enable `usesCircularChrome` for the AI summary (sparkles icon) action in `TodoListScreen`.

- **UI Component Refinement**:
    - **Dynamic Styling**: Refactor `TimelineTopBarActionButton` to use computed properties for `foregroundColor`, `outlinedFillColor`, and `outlinedBorderColor`.
    - **Color Logic**: Update the `.outlined` chrome style to derive its background fill (12% opacity) and border (48% opacity) from the action's `tint` color when available.
    - **Icon Scaling**: Adjust icon font size based on the chrome type, increasing the size to 28 for non-filled styles while maintaining the standard size for filled buttons.
    - **Consistency**: Centralize foreground color selection to ensure `tint` is correctly applied across filled, outlined, and plain button variants.
…OS and Android.

This change modifies the top bar behavior to allow the search field to occupy the entire width of the screen when active, providing a more focused search experience and preventing layout overflow.

- **Search Bar Refinement**:
    - Update `expandedSearchWidth` calculations in both SwiftUI and Compose implementations to utilize the full available width instead of reserving space for action buttons.
    - Implement conditional rendering to hide the "Create List" and "Settings/More" buttons when the search bar is expanded.
- **Cross-Platform Synchronization**:
    - **iOS**: Updated `HomeScreen.swift` to use `totalWidth` for expanded search and wrap secondary buttons in a visibility check.
    - **Android**: Updated `HomeScreen.kt` to use `maxWidth` for expanded search and wrap action icons in a `searchExpanded` conditional block.
…OS and Android.

This change modifies the top bar behavior to allow the search field to occupy the entire width of the screen when active, providing a more focused search experience and preventing layout overflow.

- **Search Bar Refinement**:
    - Update `expandedSearchWidth` calculations in both SwiftUI and Compose implementations to utilize the full available width instead of reserving space for action buttons.
    - Implement conditional rendering to hide the "Create List" and "Settings/More" buttons when the search bar is expanded.
- **Cross-Platform Synchronization**:
    - **iOS**: Updated `HomeScreen.swift` to use `totalWidth` for expanded search and wrap secondary buttons in a visibility check.
    - **Android**: Updated `HomeScreen.kt` to use `maxWidth` for expanded search and wrap action icons in a `searchExpanded` conditional block.
This change increases the delay before the search field gains focus when expanded, ensuring smoother transitions and allowing expansion animations to complete before the keyboard appears.

- **iOS (SwiftUI)**:
    - Increase focus delay from 0.05s to 0.30s in `HomeScreen.swift`.
    - Explicitly reset focus state before the delay and verify `searchExpanded` remains true before applying focus.
- **Android (Compose)**:
    - Add a 300ms `delay` to the `LaunchedEffect` in `HomeScreen.kt` before requesting focus and showing the software keyboard.
This update transitions the search UI from a conditional layout to a layered animation approach, providing a smoother visual transition between the collapsed icon and expanded text field.

- **iOS (SwiftUI)**:
    - Replace the `Group` layout with a `ZStack` containing both collapsed and expanded states.
    - Implement a dedicated button for the collapsed state with a spring animation to trigger expansion.
    - Update the expanded state to use a static magnifying glass icon and a clear/cancel button.
    - Add `searchExpanded` state checks to `allowsHitTesting` and `disabled` modifiers to prevent interaction with hidden elements.

- **Android (Compose)**:
    - Introduce `searchContentAlpha` to animate the visibility transition between the search icon and the full search input.
    - Refactor the search bar container to use a `Box` for layering the collapsed icon and expanded `Row` content.
    - Apply `graphicsLayer` alpha transformations to elements based on the search expansion state.
    - Replace the toggling `PressableIconButton` with a static `Icon` in the expanded state and a dedicated `Close` button for dismissal.
    - Ensure the `BasicTextField` is disabled when the search bar is not expanded.
…eate List sheet in the iOS SwiftUI client.

This update improves the responsiveness and safety of the bottom sheet by constraining its height to the screen dimensions and simplifying how the app toggles between compact and expanded (typing) states.

- **Height & Constraint Management**:
    - Introduce `maximumHeightFraction` (80%) to ensure the sheet does not exceed screen bounds on smaller devices.
    - Update `compactSheetHeight` to be the minimum of the initial constant and the calculated maximum height.
    - Adjust `onPreferenceChange` logic to clamp the content height within the defined maximum.

- **Detent & Interaction Logic**:
    - Refactor detent selection to use a computed `activeDetents` set, switching between `typingDetent` and `compactDetent` based on the `nameFieldFocused` state.
    - Replace manual `@State` tracking of `sheetDetent` with a reactive approach using the `.presentationDetents(activeDetents)` modifier.
    - Enable `.presentationContentInteraction(.resizes)` for smoother transitions between sheet states.

- **Cleanup & Animation**:
    - Replace the manual `onChange` animation block with a declarative `.animation(.snappy, value: nameFieldFocused)` modifier.
    - Remove the `onAppear` delay that automatically focused the name field.
…tUI client.

This change reduces the `maximumHeightFraction` for the list creation bottom sheet from 0.8 to 0.7 to improve UI scaling and presentation on the home screen.
…e iOS SwiftUI client.

This update introduces a preference-key-based measurement system to automatically resize the `CreateTaskSheet` based on its content, replacing the static 80% screen height detent with a more responsive layout.

- **Dynamic Sheet Sizing**:
    - Implement `CreateTaskSheetHeaderHeightKey` and `CreateTaskSheetFormHeightKey` to measure component heights using `GeometryReader` and `PreferenceKey`.
    - Define `CreateTaskSheetMetrics` to manage the initial height (560pt) and the maximum allowable height (86% of screen height).
    - Update `presentationDetents` to use the measured height, capped by the device screen bounds.
- **UI & Layout**:
    - Refactor the sheet container to use a `ScrollView` that only enables scrolling when the content exceeds the maximum allowed sheet height.
    - Add `.onPreferenceChange` listeners to update state and trigger re-layouts when header or form content changes.
    - Adjust internal padding and spacing (reduced bottom padding from 20pt to 14pt) to optimize the vertical layout.
…he iOS SwiftUI client.

This update adjusts the vertical spacing and safe area behavior for the list creation sheet to ensure a more consistent visual appearance across different device sizes.

- **Layout Adjustments**:
    - Replace the flexible `Spacer` with a fixed bottom padding constant (`bottomContentPadding`) in the `CreateListSheet` layout.
    - Reduce the bottom padding of the sheet content from 20pt to 8pt.
- **Styling & Presentation**:
    - Update the sheet's background to ignore the bottom safe area container edges, ensuring the background color extends to the bottom of the screen.
    - Centralize sheet metrics by adding `bottomContentPadding` to `CreateListSheetMetrics`.
…he iOS SwiftUI client.

This update adjusts the vertical spacing and safe area behavior for the list creation sheet to ensure a more consistent visual appearance across different device sizes.

- **Layout Adjustments**:
    - Replace the flexible `Spacer` with a fixed bottom padding constant (`bottomContentPadding`) in the `CreateListSheet` layout.
    - Reduce the bottom padding of the sheet content from 20pt to 8pt.
- **Styling & Presentation**:
    - Update the sheet's background to ignore the bottom safe area container edges, ensuring the background color extends to the bottom of the screen.
    - Centralize sheet metrics by adding `bottomContentPadding` to `CreateListSheetMetrics`.
This change updates the visual style of the completed task indicator by replacing the standard system green with a custom brand-aligned shade.

- **UI & Styling**:
    - Define a new `completedCheckmarkColor` using a specific RGB value (111, 191, 134).
    - Update the `checkmark.circle.fill` icon in `CompletedScreen` to use the new color instead of `Color.green`.
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@Composable
private fun CreateListBottomSheet(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`CreateListBottomSheet` has a cyclomatic complexity of 17 with "High" risk


Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A function with high cyclomatic
complexity can be hard to understand and maintain. A higher cyclomatic
complexity indicates that the function has more decision points and is more complex.

ohmzi added 2 commits May 20, 2026 18:36
…ent.

This update introduces a shared view modifier to ensure consistent bottom sheet behavior across the application, specifically utilizing the new `presentationSizing` API available in iOS 18.

- **Theme & Modifiers**:
    - Add `tdayBottomSheetSizing()` to `View` extension in `TdayTheme.swift`.
    - Configure the modifier to apply `.presentationSizing(.page)` on iOS 18.0 and later, providing a more native-feeling sheet appearance.
- **UI Integration**:
    - Apply `.tdayBottomSheetSizing()` to `CreateTaskSheet` to standardize its presentation height and behavior.
    - Apply `.tdayBottomSheetSizing()` to the list creation sheet within `HomeScreen`.
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@Composable
private fun CreateListBottomSheet(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`CreateListBottomSheet` has a cyclomatic complexity of 17 with "High" risk


Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A function with high cyclomatic
complexity can be hard to understand and maintain. A higher cyclomatic
complexity indicates that the function has more decision points and is more complex.

…"Create List" bottom sheets on Android and iOS.

This update refines the bottom sheet behavior across both platforms, ensuring better visibility when the software keyboard is active and smoother transitions during layout changes.

- **Android (Compose)**:
    - **CreateTaskBottomSheet**: Implement dynamic height adjustment based on keyboard visibility, transitioning between 70% and 85% of screen height. Added `AnimatedVisibility` with slide and fade transitions for the sheet entrance/exit.
    - **CreateListBottomSheet**: Replace static height fractions with an animated `keyboardExtraHeight` (10% of screen height) that pushes content up when the name field is focused.
    - Standardized motion durations using a new `CREATE_LIST_SHEET_MOTION_MS` constant (320ms) with `FastOutSlowInEasing`.

- **iOS (SwiftUI)**:
    - **CreateListSheet**: Refactor height calculation to use `PreferenceKey` for measuring header and content separately.
    - Wrap the list creation form in a `ScrollView` that selectively enables scrolling only when the content exceeds the maximum allowed sheet height (85% of screen).
    - Update `presentationDetents` to use a measured height that accounts for the combined height of the header and scrollable content.
    - Remove `.presentationContentInteraction(.resizes)` to rely on manual scroll control.

- **UI/UX Refinements**:
    - Added small bottom spacers to ensure content isn't clipped by sheet rounded corners or navigation bars.
    - Improved keyboard interaction logic to prevent "jumping" layouts on iOS by observing focus state and content height changes simultaneously.
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@Composable
private fun CreateListBottomSheet(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`CreateListBottomSheet` has a cyclomatic complexity of 16 with "High" risk


Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A function with high cyclomatic
complexity can be hard to understand and maintain. A higher cyclomatic
complexity indicates that the function has more decision points and is more complex.

…"Create List" bottom sheets on Android and iOS.

This update refines the bottom sheet behavior across both platforms, ensuring better visibility when the software keyboard is active and smoother transitions during layout changes.

- **Android (Compose)**:
    - **CreateTaskBottomSheet**: Implement dynamic height adjustment based on keyboard visibility, transitioning between 70% and 85% of screen height. Added `AnimatedVisibility` with slide and fade transitions for the sheet entrance/exit.
    - **CreateListBottomSheet**: Replace static height fractions with an animated `keyboardExtraHeight` (10% of screen height) that pushes content up when the name field is focused.
    - Standardized motion durations using a new `CREATE_LIST_SHEET_MOTION_MS` constant (320ms) with `FastOutSlowInEasing`.

- **iOS (SwiftUI)**:
    - **CreateListSheet**: Refactor height calculation to use `PreferenceKey` for measuring header and content separately.
    - Wrap the list creation form in a `ScrollView` that selectively enables scrolling only when the content exceeds the maximum allowed sheet height (85% of screen).
    - Update `presentationDetents` to use a measured height that accounts for the combined height of the header and scrollable content.
    - Remove `.presentationContentInteraction(.resizes)` to rely on manual scroll control.

- **UI/UX Refinements**:
    - Added small bottom spacers to ensure content isn't clipped by sheet rounded corners or navigation bars.
    - Improved keyboard interaction logic to prevent "jumping" layouts on iOS by observing focus state and content height changes simultaneously.
@OptIn(ExperimentalMaterial3Api::class)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@Composable
private fun CreateListBottomSheet(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`CreateListBottomSheet` has a cyclomatic complexity of 17 with "High" risk


Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A function with high cyclomatic
complexity can be hard to understand and maintain. A higher cyclomatic
complexity indicates that the function has more decision points and is more complex.

…st creation flow.

This update refactors the list creation UI from a standard Material 3 `ModalBottomSheet` to a custom `Dialog` implementation. This change provides finer control over sheet animations, height adjustments based on keyboard visibility, and ensures consistent behavior across different screen sizes.

- **Custom Sheet Implementation**:
    - Replace `ModalBottomSheet` with a `Dialog` using `decorFitsSystemWindows = false` to enable custom full-screen positioning and scrim handling.
    - Implement `AnimatedVisibility` with `slideInVertically` and `fadeIn` transitions to replicate bottom sheet motion.
    - Add logic to animate the sheet height between normal (70%) and keyboard-visible (80%) states to optimize the typing experience.
    - Define constants for animation duration (`320ms`) and height fractions.

- **Interaction & Focus**:
    - Update `CreateListBottomSheet` to explicitly handle keyboard dismissal and focus clearing when dismissing the dialog or confirming input.
    - Use `WindowInsets.ime` to detect keyboard visibility for dynamic height transitions.
    - Wrap the dialog content in a `Box` with a custom scrim and clickable background to handle dismissals outside the sheet area.

- **Clean-up**:
    - Remove unused `ExperimentalMaterial3Api` and `ModalBottomSheet` related imports and state variables.
    - Refactor the sheet content into a `Surface` within the dialog for proper elevation and shape rendering.

@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun CreateListBottomSheet(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`CreateListBottomSheet` has a cyclomatic complexity of 16 with "High" risk


Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A function with high cyclomatic
complexity can be hard to understand and maintain. A higher cyclomatic
complexity indicates that the function has more decision points and is more complex.

@ohmzi ohmzi merged commit 250e094 into master May 20, 2026
4 of 5 checks passed
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