Skip to content

Feature/alarm widget font size#19

Merged
wassupluke merged 2 commits into
mainfrom
feature/alarm-widget-font-size
Apr 2, 2026
Merged

Feature/alarm widget font size#19
wassupluke merged 2 commits into
mainfrom
feature/alarm-widget-font-size

Conversation

@wassupluke
Copy link
Copy Markdown
Owner

@wassupluke wassupluke commented Apr 2, 2026

fix regression introduced in ee0aaef and fe0c35c where all widgets shared the same root, and would update to show text for the most recent widget type placed. e.g., place the weather widget, then place the alarm widget and the weather widget would switch to also showing the upcoming alarm.

Summary by Sourcery

Isolate each widget's Glance layout to prevent cross-widget content bleed and update project documentation to reflect the multi-widget architecture and constraints.

Bug Fixes:

  • Ensure weather and alarm widgets each own their Glance layout root and tap handling to avoid showing the wrong widget content.

Enhancements:

  • Simplify widget layout structure by removing the shared WidgetRoot composable and inlining the tapable root scaffold into each widget.
  • Refresh CLAUDE.md with up-to-date project overview, architecture details, DataStore keys, dependency versions, and testing conventions.
  • Clarify widget implementation guidance in docs/adding-a-widget.md, including layout scaffolding and shared DataStore keys.

Sharing WidgetRoot across GlanceAppWidget subclasses caused Glance to
assign the same layout resource ID to both widgets, making the temp
widget display alarm content after the alarm widget was placed.

Each widget now owns its full Box > Box scaffold so their composable
trees are unique. WidgetRoot.kt deleted. Docs updated with the constraint.
Updates package from com.wassupluke.simpleweather to com.wassupluke.widgets,
adds AlarmWidget/AlarmWidgetReceiver to the package structure, refreshes all
dependency versions, and documents the Glance layout isolation constraint.
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 2, 2026

Reviewer's Guide

Refactors Glance widget layout scaffolding so Weather and Alarm widgets each own their full clickable root instead of sharing a common WidgetRoot composable, fixing cross-widget content bleed, and updates documentation (CLAUDE.md and adding-a-widget.md) to describe the architecture, constraints, and new Glance isolation pattern.

Class diagram for isolated Glance widget roots (WeatherWidget and AlarmWidget)

classDiagram
    class GlanceAppWidget

    class WeatherWidget {
        +provideGlance(context)
        -suspend Content()
    }

    class AlarmWidget {
        +provideGlance(context)
        -suspend Content()
    }

    class WeatherWidgetContent {
        +WeatherWidgetContent(displayTemp, textColorProvider, tapAction, fontSize)
    }

    class AlarmWidgetContent {
        +AlarmWidgetContent(alarmText, textColorProvider, tapAction, fontSize)
    }

    class WidgetRoot {
        -WidgetRoot(tapAction, content)
    }

    GlanceAppWidget <|-- WeatherWidget
    GlanceAppWidget <|-- AlarmWidget

    WeatherWidget --> WeatherWidgetContent : uses
    AlarmWidget --> AlarmWidgetContent : uses

    WidgetRoot .. WeatherWidget : previously_used_by
    WidgetRoot .. AlarmWidget : previously_used_by
Loading

File-Level Changes

Change Details Files
Isolate each Glance widget’s root layout and tap handling instead of using a shared WidgetRoot helper to prevent layout/resource sharing issues between Alarm and Weather widgets.
  • Inline the root Box + clickable scaffold into AlarmWidgetContent, wrapping the existing Row, icon, and text inside a full-size Box with a nested clickable Box
  • Inline the root Box + clickable scaffold into WeatherWidgetContent, wrapping the existing temperature Text inside a full-size Box with a nested clickable Box
  • Remove the shared WidgetRoot composable that used to be consumed by multiple GlanceAppWidget subclasses
app/src/main/java/com/wassupluke/widgets/widget/AlarmWidget.kt
app/src/main/java/com/wassupluke/widgets/widget/WeatherWidget.kt
app/src/main/java/com/wassupluke/widgets/widget/WidgetRoot.kt
Document the project architecture, widget behavior, and Glance layout isolation requirements, and update ancillary project docs to match the current implementation.
  • Rewrite CLAUDE.md to reflect the current widgets-focused architecture, updated dependencies, and key design decisions including Glance layout isolation and AlarmWidgetReceiver behavior
  • Update build/test instructions, package structure, and DataStore key documentation in CLAUDE.md to match the current package name and APIs
  • Augment adding-a-widget.md with guidance and example code showing that each widget must own its full Box+clickable scaffold and share common DataStore keys for styling
CLAUDE.md
docs/adding-a-widget.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@wassupluke wassupluke merged commit 4c2aaa8 into main Apr 2, 2026
3 checks passed
@wassupluke wassupluke deleted the feature/alarm-widget-font-size branch April 2, 2026 19:23
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