Skip to content

Conversation

@ngominhtrungit
Copy link
Contributor

@ngominhtrungit ngominhtrungit commented Aug 29, 2025

Description

During debugging, I noticed that the HomeWidgetGlanceWidgetReceiver and HomeWidgetGlanceState.kt classes do not have a namespace for them.
=> It can lead to naming conflicts if multiple files in the default package define classes with the same name

Checklist

  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation and added code (documentation) comments where necessary.
  • I have updated/added relevant examples in example or documentation.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Link issue: #357 (comment)

@docs-page
Copy link

docs-page bot commented Aug 29, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/abausg/home_widget~365

Documentation is deployed and generated using docs.page.

@ngominhtrungit ngominhtrungit changed the title fix(android): add missing package name to HomeWidget Glance files fix: Add missing package name to HomeWidget Glance files Aug 29, 2025
@ABausG ABausG linked an issue Oct 12, 2025 that may be closed by this pull request
1 task
@ABausG
Copy link
Owner

ABausG commented Oct 12, 2025

Thank you for this! Given that this is a breaking change I will merge this soon and also add some more Information into the docs in the Place where I want to have migration guides (which is not yet ready) Thanks for this though!!

@ngominhtrungit
Copy link
Contributor Author

Thank you for this! Given that this is a breaking change I will merge this soon and also add some more Information into the docs in the Place where I want to have migration guides (which is not yet ready) Thanks for this though!!

Thanks for feedback, I'm glad to be of help.

@ABausG ABausG changed the title fix: Add missing package name to HomeWidget Glance files fix!: Add missing package name to HomeWidget Glance files Jan 4, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

Walkthrough

The PR reorganizes Android package structure by adding explicit package declarations to Kotlin files and updating imports to use fully qualified package names (es.antonborri.home_widget) instead of local imports. Documentation is updated to reflect the new import convention, and the spell-check dictionary is expanded with two new words.

Changes

Cohort / File(s) Summary
Configuration & Dictionary
.github/cspell.yaml
Added "sirikit" and "widgetconfigurationintent" to spell-check vocabulary
Documentation – Setup & Migration
docs/setup/android.mdx, docs/android-xml/setup.mdx, docs/android-xml/render-flutter-widget.mdx
Updated Kotlin import examples to use fully qualified package paths (es.antonborri.home_widget.*); added new CounterWidgetProvider example class extending HomeWidgetProvider with onUpdate override
Migration Guide
docs/migrations/0.9.0.mdx
Added Android-specific migration note documenting requirement for fully qualified imports from es.antonborri.home_widget package
Library Source Files
packages/home_widget/android/src/main/kotlin/es/antonborri/home_widget/HomeWidgetGlanceState.kt, HomeWidgetGlanceWidgetReceiver.kt
Added explicit package declarations; removed/reorganized imports to align with fully qualified package namespace
Example App Files
packages/home_widget/example/android/app/src/main/kotlin/es/antonborri/home_widget_example/glance/HomeWidgetGlanceAppWidget.kt, HomeWidgetReceiver.kt
Reordered and updated import statements to use fully qualified package paths for external HomeWidget classes

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding missing package names to HomeWidget Glance files, with the breaking change indicator (!) appropriately included.
Description check ✅ Passed The description adequately explains the problem (missing namespaces causing naming conflicts), identifies the breaking change, updates the checklist appropriately, and references related issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8d3c1dd) to head (a81b10b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #365   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          115       115           
=========================================
  Hits           115       115           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Owner

@ABausG ABausG left a comment

Choose a reason for hiding this comment

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

Thanks so much for this change. I added some docs on how to migrate to this

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/migrations/0.9.0.mdx (1)

17-41: Excellent migration documentation for the breaking change.

The migration guide clearly explains:

  • Why the change is necessary (explicit namespace declarations)
  • What needs to be updated (import statements)
  • How to update (before/after examples)
  • Which classes are affected (comprehensive list)

The before/after code examples with diff markers make it easy for users to understand the required changes.

Optional: Consider adding migration tooling hints

You could optionally enhance the migration guide by mentioning:

  1. The minimum Android Gradle Plugin version that supports namespace declarations (if applicable)
  2. A regex pattern for users to find and update imports in their codebase:
    Find: import (HomeWidget\w+)
    Replace: import es.antonborri.home_widget.$1
    

These are nice-to-have additions but not essential since the migration path is already clear.

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d3c1dd and a81b10b.

📒 Files selected for processing (9)
  • .github/cspell.yaml
  • docs/android-xml/render-flutter-widget.mdx
  • docs/android-xml/setup.mdx
  • docs/migrations/0.9.0.mdx
  • docs/setup/android.mdx
  • packages/home_widget/android/src/main/kotlin/es/antonborri/home_widget/HomeWidgetGlanceState.kt
  • packages/home_widget/android/src/main/kotlin/es/antonborri/home_widget/HomeWidgetGlanceWidgetReceiver.kt
  • packages/home_widget/example/android/app/src/main/kotlin/es/antonborri/home_widget_example/glance/HomeWidgetGlanceAppWidget.kt
  • packages/home_widget/example/android/app/src/main/kotlin/es/antonborri/home_widget_example/glance/HomeWidgetReceiver.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build iOS Examples (home_widget_example)
  • GitHub Check: Build iOS Examples (lockscreen_widgets)
  • GitHub Check: Build iOS Examples (configurable_widget)
  • GitHub Check: Build Android Examples (home_widget_example)
  • GitHub Check: Android Integration Tests
  • GitHub Check: Quality Checks
  • GitHub Check: iOS Integration Tests
  • GitHub Check: iOS Integration Tests
🔇 Additional comments (8)
packages/home_widget/android/src/main/kotlin/es/antonborri/home_widget/HomeWidgetGlanceWidgetReceiver.kt (1)

1-2: LGTM! Package declaration correctly added.

The explicit package declaration prevents naming conflicts and aligns with the directory structure. This is a necessary change to move away from the default package.

packages/home_widget/android/src/main/kotlin/es/antonborri/home_widget/HomeWidgetGlanceState.kt (1)

1-2: LGTM! Package declaration correctly added and import cleanup is appropriate.

The explicit package declaration is correct. The removal of the HomeWidgetPlugin import (mentioned in the summary) is appropriate since both classes now reside in the same package, allowing direct reference without an explicit import.

.github/cspell.yaml (1)

73-73: LGTM! Valid widget-related terms added to dictionary.

Both "sirikit" and "widgetconfigurationintent" are legitimate technical terms related to widget functionality and are appropriately added to the spell-check dictionary.

Also applies to: 76-76

docs/setup/android.mdx (1)

61-62: LGTM! Documentation correctly updated to reflect the namespace migration.

The import statements are properly updated to use fully qualified package names, which aligns with the breaking changes introduced in this PR. The documentation will guide users to use the correct import patterns.

Also applies to: 106-106

packages/home_widget/example/android/app/src/main/kotlin/es/antonborri/home_widget_example/glance/HomeWidgetReceiver.kt (1)

3-3: LGTM! Example correctly updated to use fully qualified imports for the breaking change.

The import statement correctly demonstrates the required migration pattern for v0.9.0, where HomeWidget classes must now be imported with their full package qualifier (es.antonborri.home_widget.*). Verification confirms all imports across the codebase have been successfully migrated, with no remaining old-style imports identified.

packages/home_widget/example/android/app/src/main/kotlin/es/antonborri/home_widget_example/glance/HomeWidgetGlanceAppWidget.kt (1)

30-31: LGTM! Import updates align with the migration pattern.

The imports now use fully qualified package names (es.antonborri.home_widget.*), which is consistent with the breaking change documented in the migration guide. The example code properly demonstrates the new import pattern for users upgrading to 0.9.0.

docs/android-xml/render-flutter-widget.mdx (1)

32-33: Documentation example updated correctly.

The import statement now uses the fully qualified package name, demonstrating the proper migration pattern for users. This aligns with the breaking changes introduced in 0.9.0.

docs/android-xml/setup.mdx (1)

58-59: Documentation correctly shows the fully qualified import.

The setup guide now demonstrates the proper import pattern using the full package name, ensuring new users follow the correct approach from the start. This is consistent with the 0.9.0 migration requirements.

@ABausG ABausG merged commit caf6a1f into ABausG:main Jan 4, 2026
15 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.

Package names are missing on Android

2 participants