Skip to content

Collapse empty weeks in date picker#6

Open
Copilot wants to merge 2 commits intomainfrom
copilot/add-collapse-empty-week-rows
Open

Collapse empty weeks in date picker#6
Copilot wants to merge 2 commits intomainfrom
copilot/add-collapse-empty-week-rows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

The date picker renders every week as a row regardless of whether any day in that week has a recorded video. Consecutive empty weeks (no videos) should be collapsed into a single non-interactive "…" row, except for the week containing today.

Changes

DiaryDatePicker.kt

  • Introduces a WeekRow sealed interface (Normal / Collapsed) to represent the two row types
  • After computing weekDays, builds a rows: List<WeekRow> by:
    • Keeping WeekRow.Normal for any week that contains today or has ≥1 video
    • Collapsing runs of consecutive empty, non-current weeks into a single WeekRow.Collapsed
  • LazyColumn now renders WeekRow.Collapsed as a centered "…" with no click handler and an accessibility contentDescription
  • firstVisibleWeekIndex updated to search rows instead of the raw weekDays
val rows = buildList<WeekRow> {
    var previousWasCollapsed = false
    weekDays.forEach { week ->
        val isCurrentWeek = week.any { it is Weekday.Value && it.day.date == today }
        val isEmpty = week.none { it is Weekday.Value && it.day.video != null }
        if (!isCurrentWeek && isEmpty) {
            if (!previousWasCollapsed) {
                add(WeekRow.Collapsed)
                previousWasCollapsed = true
            }
        } else {
            add(WeekRow.Normal(week))
            previousWasCollapsed = false
        }
    }
}

strings.xml

  • date_picker_collapsed_weeks ("…") — visible label
  • date_picker_collapsed_weeks_description ("Empty weeks collapsed") — screen-reader description

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/gradle-daemon-main-8.9.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/agents/gradle-instrumentation-agent-8.9.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.9 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Agent-Logs-Url: https://github.com/LukeNeedham/VideoDiary/sessions/64eb943b-0222-4c31-a17d-06e1cd3c28ec

Co-authored-by: LukeNeedham <49884591+LukeNeedham@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to collapse empty week rows in date picker Collapse empty weeks in date picker Apr 3, 2026
Copilot AI requested a review from LukeNeedham April 3, 2026 22:46
@LukeNeedham LukeNeedham marked this pull request as ready for review April 3, 2026 23:07
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2026

✅ Debug APK build complete!

Download the APK from the workflow run artifacts.

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.

2 participants