Skip to content

Conversation

@cavin-macwan
Copy link
Contributor

@cavin-macwan cavin-macwan commented Jul 26, 2025

Summary by CodeRabbit

  • New Features

    • Added a new tutorial explaining how to conditionally display the alarm UI based on app or device state.
  • Documentation

    • Updated installation and usage guides to reference version 1.1.0 and include the SYSTEM_ALERT_WINDOW permission.
    • Improved code examples to use coroutines for permission handling and alarm scheduling.
    • Added a direct link to full documentation and removed the "Alpha" status note.
    • Clarified and reformatted permissions table and example usage.
  • Bug Fixes

    • Corrected a feature title typo on the homepage.
  • Chores

    • Updated version numbers and references throughout documentation, templates, and build scripts to 1.1.0.
    • Suppressed Gradle unstable API warnings in build configuration.
    • Removed explicit configuration to show alarm UI when app is active from initialization.

@cavin-macwan cavin-macwan self-assigned this Jul 26, 2025
@cavin-macwan cavin-macwan added the documentation Improvements or additions to documentation label Jul 26, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update synchronizes the project version to 1.1.0 across documentation, workflow, and build files. It revises permission handling and scheduling examples to use coroutines, updates permission documentation (adding SYSTEM_ALERT_WINDOW), removes an explicit configuration property from the application initialization, and introduces a new tutorial on conditional alarm UI display.

Changes

File(s) Change Summary
.github/ISSUE_TEMPLATE/bug_report.md Updated example version from 1.0.0 to 1.1.0.
.github/workflows/release.yaml, triggerx/build.gradle.kts, docs/docs/tutorial-basics/1-installation.md Updated version references from 1.0.0/0.0.5 to 1.1.0.
README.md, docs/docs/tutorial-basics/1-installation.md Added SYSTEM_ALERT_WINDOW permission; updated documentation links and formatting.
README.md, docs/docs/tutorial-basics/4-permission-handling.mdx, docs/docs/tutorial-basics/5-scheduling-alarm.md, docs/docs/tutorial-extras/showing-dynamic-ui.md Refactored examples to use coroutine scopes for permission checks and scheduling.
app/src/main/java/com/meticha/triggerxexample/TriggerXApplication.kt Removed explicit setting of showAlarmActivityWhenAppIsActive in TriggerX initialization.
docs/docs/tutorial-extras/showing-alarm-ui-conditionally.md Added new tutorial on configuring conditional alarm UI display.
docs/src/components/HomepageFeatures/index.tsx Minor title wording adjustment in feature list.
settings.gradle.kts Suppressed unstable API usage warnings at file level.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeScreen (Composable)
    participant CoroutineScope
    participant PermissionState
    participant AlarmScheduler

    User->>HomeScreen (Composable): Clicks action button
    HomeScreen (Composable)->>CoroutineScope: Launch coroutine
    CoroutineScope->>PermissionState: Check all required permissions
    alt Permissions granted
        CoroutineScope->>AlarmScheduler: Schedule alarm (or perform action)
        AlarmScheduler-->>CoroutineScope: Result (success/failure)
        CoroutineScope-->>HomeScreen (Composable): Show toast (success/failure)
    else Permissions not granted
        CoroutineScope->>PermissionState: Request permissions
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • meticha-admin

Poem

In version hops from one to one-dot-one,
Permissions and coroutines—oh, what fun!
With SYSTEM_ALERT_WINDOW, alarms now shine,
Docs refreshed and code aligns just fine.
A bunny’s leap, a gentle cheer,
TriggerX grows stronger every year! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae42a25 and 27c0de0.

📒 Files selected for processing (1)
  • docs/src/components/HomepageFeatures/index.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/alarm-ui-flags

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 1

🧹 Nitpick comments (12)
docs/src/components/HomepageFeatures/index.tsx (1)

32-32: Fix typo in feature title

Typo reverses word order («…You That Don’t…») and reads awkwardly.

-    title: 'Handles Permissions So You That Don’t Have To',
+    title: 'Handles Permissions So That You Don’t Have To',
.github/ISSUE_TEMPLATE/bug_report.md (1)

26-30: Align list indentation to satisfy markdown-lint

markdownlint flags the leading space before each list item. Removing it keeps style consistent and silences the linter.

- - Device: [e.g. Pixel 6]
- - OS: [e.g. Android 13]
- - TriggerX Library Version [e.g. 1.1.0]
- - TriggerX Example App Version (if applicable) [e.g. 1.1]
+- Device: [e.g. Pixel 6]
+- OS: [e.g. Android 13]
+- TriggerX Library Version [e.g. 1.1.0]
+- TriggerX Example App Version (if applicable) [e.g. 1.1]
docs/docs/tutorial-basics/1-installation.md (2)

16-18: Version string diverges from “latest-version” placeholder used elsewhere

Installation docs hard-code 1.1.0, whereas README now advertises the "latest-version" placeholder. Mixing approaches invites copy-paste errors and version skew.

Consider switching to one consistent pattern (either hard-code the current release everywhere or use the placeholder everywhere).


47-49: Add a note about runtime overlay permission flow

SYSTEM_ALERT_WINDOW is a special permission that users must grant via the system settings panel opened with ACTION_MANAGE_OVERLAY_PERMISSION; it is not requested through the normal permission dialog. A short hint here (or a link to the dedicated permission-handling section) would prevent confusion.

docs/docs/tutorial-basics/4-permission-handling.mdx (1)

18-19: Minor naming/style polish

rememberCoroutineScope() is captured in coroutineScope, but other docs (e.g. README) use the variable name coroutines. Pick one for consistency. Also prefer launch { (space before {}) to match Kotlin style guides.

docs/docs/tutorial-extras/showing-alarm-ui-conditionally.md (1)

42-45: Inconsistent flag naming

shouldShowAlarmActivityWhenDeviceIsActive introduces a should prefix whereas the previous flag omits it. Double-check the API for naming symmetry (show vs shouldShow) and update the snippet for coherence.

README.md (3)

68-72: Placeholder vs fixed version inconsistency

README switched to "latest-version" while installation docs pin 1.1.0. Align both locations to prevent mismatch.


98-99: Overlay permission disclaimer missing

Same remark as in installation docs: mention that SYSTEM_ALERT_WINDOW needs the user to enable it in system settings.


155-168: Variable name differs from other docs

Here the coroutine scope is stored in coroutines, elsewhere in coroutineScope. Harmonise to avoid mental friction.

docs/docs/tutorial-basics/5-scheduling-alarm.md (1)

18-19: Consistent variable naming

Again, uses coroutineScope (singular). Align across docs for uniformity.

docs/docs/tutorial-extras/showing-dynamic-ui.md (2)

104-117: Avoid hard-coded alarmId to prevent collisions

Using a constant 1 will overwrite previous alarms or DB rows. Persist the row-id returned by the insert (or generate a UUID) and feed that into scheduleAlarm.

-db.taskDao().insert(Task(1, "Meeting", "Discuss the roadmap"))
+val taskId = db.taskDao().insert(Task(title = "Meeting",
+                                      description = "Discuss the roadmap"))
 ...
-alarmId = 1
+alarmId = taskId.toInt()

118-120: Call requestPermission() outside the coroutine

requestPermission() isn’t suspending; launching another coroutine adds unnecessary overhead and makes call-site intent less obvious.

 onClick = {
-    scope.launch {
-        if (permissionState.allRequiredGranted()) {
-            // …
-        } else {
-            permissionState.requestPermission()
-        }
-    }
+    if (permissionState.allRequiredGranted()) {
+        scope.launch {
+            // DB insert + alarm scheduling
+        }
+    } else {
+        permissionState.requestPermission()
+    }
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00e5ad3 and ae42a25.

⛔ Files ignored due to path filters (2)
  • docs/docs/tutorial-extras/img/docsVersionDropdown.png is excluded by !**/*.png
  • docs/docs/tutorial-extras/img/localeDropdown.png is excluded by !**/*.png
📒 Files selected for processing (12)
  • .github/ISSUE_TEMPLATE/bug_report.md (1 hunks)
  • .github/workflows/release.yaml (1 hunks)
  • README.md (9 hunks)
  • app/src/main/java/com/meticha/triggerxexample/TriggerXApplication.kt (0 hunks)
  • docs/docs/tutorial-basics/1-installation.md (3 hunks)
  • docs/docs/tutorial-basics/4-permission-handling.mdx (2 hunks)
  • docs/docs/tutorial-basics/5-scheduling-alarm.md (2 hunks)
  • docs/docs/tutorial-extras/showing-alarm-ui-conditionally.md (1 hunks)
  • docs/docs/tutorial-extras/showing-dynamic-ui.md (1 hunks)
  • docs/src/components/HomepageFeatures/index.tsx (1 hunks)
  • settings.gradle.kts (1 hunks)
  • triggerx/build.gradle.kts (1 hunks)
💤 Files with no reviewable changes (1)
  • app/src/main/java/com/meticha/triggerxexample/TriggerXApplication.kt
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
.github/ISSUE_TEMPLATE/bug_report.md

29-29: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

🔇 Additional comments (8)
settings.gradle.kts (1)

1-1: Suppression looks good

Suppressing UnstableApiUsage at file level is reasonable for Gradle feature previews; no issues spotted.

.github/workflows/release.yaml (1)

9-11: Version bump propagated correctly

VERSION_NAME is updated to 1.1.0 and flows through the later steps; workflow logic remains intact.

triggerx/build.gradle.kts (1)

103-110: Maven coordinates & POM version updated consistently

Both the publication coordinates and pom.version now point to 1.1.0—looks consistent with the workflow/env changes.

docs/docs/tutorial-basics/4-permission-handling.mdx (1)

31-37: Good asynchronous flow

Wrapping the permission logic in coroutineScope.launch { … } is the right call for non-blocking UI interactions. 👍

docs/docs/tutorial-extras/showing-alarm-ui-conditionally.md (1)

24-27: Verify that showAlarmActivityWhenAppIsActive still exists

Earlier commits mention this flag being removed from the public API. If the property was indeed dropped, the sample will not compile.

-            showAlarmActivityWhenAppIsActive = false
+            // showAlarmActivityWhenAppIsActive = false   // <- confirm property name or update docs
README.md (2)

25-26: Nice addition – direct docs link

Linking to the full documentation improves discoverability. 👍


167-174: Async scheduling snippet looks correct

Launch block correctly checks permissions, schedules, and surfaces result via toast. Solid example.

docs/docs/tutorial-basics/5-scheduling-alarm.md (1)

31-60: Good end-to-end example

Demonstrates permission gating, scheduling, and user feedback all inside a coroutine – clear and correct.

@meticha-admin meticha-admin merged commit de876a6 into main Jul 26, 2025
1 check was pending
@meticha-admin meticha-admin deleted the docs/alarm-ui-flags branch July 26, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants