Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ebe4dbe
moved stylesheet into style.js
thale-chico Mar 31, 2026
b91b048
updated project to newer version
thale-chico Mar 31, 2026
4611446
added new alarm class, C-like typedefs, AlarmSet->ALARM class
thale-chico Apr 2, 2026
cf11cc9
updated to use ALARM class instead of interface, using custom DATE in…
thale-chico Apr 2, 2026
4f6edb8
update class w/ count for next interval, ...
thale-chico Apr 2, 2026
bae113b
merged Database (main) -> Modularity branch
thale-chico Apr 12, 2026
2ac678b
moved 'check_time' function from App to Time
thale-chico Apr 12, 2026
cbd11c9
implemented de/serialization for async database, wip
thale-chico Apr 12, 2026
176fd42
implemented sound, persistance now failing
thale-chico Apr 21, 2026
188cac5
Fixing UI. Work in progress
smennings Apr 27, 2026
84a4f5a
Turning interval picker into a dropdown within modal. also possibly s…
smennings Apr 29, 2026
84d19f4
merged newUI branch
thale-chico Apr 30, 2026
2fb5fe4
adjusted style, added icons to buttons (single/repeat)
thale-chico Apr 30, 2026
2801c63
updated comments
thale-chico Apr 30, 2026
14fc17b
multiple modals/alarms, editing/saving works
thale-chico Apr 30, 2026
641414e
updated issues with DateTimePicker with Single/Repeating Alarms
thale-chico May 5, 2026
6d45a6a
removed Date, Time, Alarm files as they are unused
thale-chico May 5, 2026
d6e5d84
fix: updated logic to prevent 0 min intervals for repeat alarms
thale-chico May 7, 2026
1e2ac00
removed redundent import
thale-chico May 7, 2026
81969c2
removed redundent file
thale-chico May 7, 2026
34f541e
fixed DateTimePicker issue, times should persist
thale-chico May 7, 2026
6004375
added blue buttons/switchs
thale-chico May 8, 2026
b99ea21
feat: add initial testing infrastructure with Jest and GitHub action
kbuffardi May 8, 2026
6c0dc42
Add remaining testing files, including updated packages
kbuffardi May 8, 2026
fa6a9ec
Merge branch 'testing' of github.com:ChicoState/alarmflow into tests
smennings May 10, 2026
37b953a
Added test for alarm deletion
smennings May 10, 2026
4de0ebb
backup before testing
thale-chico May 10, 2026
304d789
backup before testing
thale-chico May 10, 2026
208ffd1
alarm scheduler works w/ single alarms, moved/removed EditModal
thale-chico May 10, 2026
e9c61e3
saved backup
thale-chico May 10, 2026
0d1e62c
removed EditModule code
thale-chico May 10, 2026
8f059aa
updated UI w/ alarm scheduling + new pallete
thale-chico May 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: |
package-lock.json
AlarmApp/package-lock.json

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle

- name: Set up Android SDK
uses: android-actions/setup-android@v3

- name: Install Android SDK packages
run: sdkmanager "platforms;android-36" "build-tools;36.0.0" "ndk;27.1.12297006"

- name: Install root dependencies
run: npm ci

- name: Install app dependencies
run: npm ci
working-directory: AlarmApp

- name: Run tests with coverage
run: npm test -- --coverage --coverageReporters=text --coverageReporters=lcov --coverageReporters=cobertura --watchAll=false
working-directory: AlarmApp

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: jest-coverage
path: AlarmApp/coverage
if-no-files-found: error

- name: Build Android debug APK
run: ./gradlew assembleDebug
working-directory: AlarmApp/android
52 changes: 52 additions & 0 deletions AlarmApp/AlarmScheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,14 @@ export async function scheduleAlarmSet(
let current = new Date(startDate);
const now = Date.now();

// REPEAT ALARM
let scheduledCount = 0;
let index = 0;
while (current <= endDate) {
// Only schedule future alarms (skip times that already passed)
console.log("current <= endDate");
if (current.getTime() > now) {
console.log('triggering...');
const trigger: TimestampTrigger = {
type: TriggerType.TIMESTAMP,
timestamp: current.getTime(),
Expand Down Expand Up @@ -345,6 +348,55 @@ export async function scheduleAlarmSet(
current = new Date(current.getTime() + intervalMs);
}

// SINGLE ALARM
if (startDate == endDate) {
const trigger: TimestampTrigger = {
type: TriggerType.TIMESTAMP,
timestamp: current.getTime(),
alarmManager: {
allowWhileIdle: true, // fires during Doze mode
},
};
const timeLabel = current.toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
});
const id = await notifee.createTriggerNotification({
title: 'Alarm Flow',
body: `Alarm #${0 + index} — ${timeLabel}`,
android: {
channelId: CHANNEL_ID,
importance: AndroidImportance.HIGH,
category: AndroidCategory.ALARM,
visibility: AndroidVisibility.PUBLIC,

// RING, don't ping ----------------------------------------
sound: 'default',
loopSound: true,
// Vibrate in a long pattern so it feels like an alarm
vibrationPattern: [300, 500, 300, 500, 300, 500, 300, 500],

// Persist on screen until dismissed
ongoing: true,
autoCancel: false,

// Pop over the lockscreen / wake the device
fullScreenAction: { id: 'default' },
pressAction: { id: 'default' },

// Explicit dismiss button — the user-facing way to silence it
actions: [
{
title: 'Dismiss',
pressAction: { id: DISMISS_ACTION_ID },
},
],
},
}, trigger, );

scheduledCount = 1;
}

return { count: scheduledCount, notificationIds };
}

Expand Down
Loading
Loading