Skip to content

Commit 6141304

Browse files
Keril3claude
andcommitted
History chart, calendar, text size, low vision mode and developer tools
- History: after an import, a chart of a day, a week, a month, three months, all of it or a period from the calendar, with arrows through time, stats, GMI and a full-screen view with dates under the finger. The imported file is kept until "Close". - A calendar of our own replaces the Material date range picker that broke with the pixel font: ready-made periods, From/To, dots for days with data, a grid of months. - The chart breaks its line at gaps and marks days, weeks or months on long periods; long periods are averaged down to a few hundred points. - Settings: text size (applied in dialogs too), a low vision mode with the system font, larger text, contrast colors and a plain background; separate switches for the number in the status bar and the trend arrow, which is also drawn next to the number there. - Developer tools: the state of minute mode, the background job, battery limits, the standby bucket, Doze, Health Connect and Samsung Health, and an event log of every sync with its trigger and timings, the minute service, Doze and the screen; with usage access, Samsung Health's own openings and background services. Copy, share, clear. - The LibreView window keeps the site's text size: a large phone font made the site's fixed cards overflow. Pinch to zoom instead. - The value on the home screen is centered next to Tenshi-chan; the trend arrow mapping is pinned by a test against LibreLinkUp's TrendArrow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 451ebdf commit 6141304

59 files changed

Lines changed: 2592 additions & 213 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
Newest version first. A version's section becomes the release notes on GitHub.
44

5+
## 1.6.0 — 2026-10-11
6+
7+
- History chart: after importing a LibreView export, look through it as a chart, a day, a week, a month, three
8+
months, all of it or any period from the calendar, with arrows to step through time, the statistics and the
9+
estimated HbA1c of the period. A tap opens it full screen with dates under the finger. The imported file now
10+
stays in the app until "Close", so it is still there after a restart.
11+
- A new calendar for periods: ready-made periods, "From" and "To", a month with a dot on every day with data
12+
(colored by time in range), and a grid of months to get years back in three taps.
13+
- Text size in Settings, and a low vision mode: the phone's own font, larger text, more contrast, a plain
14+
background.
15+
- The number in the status bar and the trend arrow each have a switch. With the arrow on, the status bar shows it
16+
next to the number too.
17+
- Developer tools (Settings → About SugarBridge): the state of everything that can delay glucose (minute mode,
18+
background job, battery limits, Android's standby bucket, Doze, Health Connect, Samsung Health) and an event
19+
log of every sync with its trigger, timings and the age of the newest value, the minute service, Doze and the
20+
screen. With usage access it also shows when Samsung Health was opened or ran a background service. The log
21+
can be copied or shared.
22+
- The glucose value sits in the middle between Tenshi-chan and the window edge.
23+
- Checked: the trend arrow is LibreLink's own (LibreLinkUp's TrendArrow 1–5: ↓ ↘ → ↗ ↑), now pinned by a test.
24+
- Fixed: with a large phone font the LibreView site broke its layout: words spilled out of its cards and the
25+
header was cut. The site now keeps its own text size; pinch to zoom instead.
26+
527
## 1.5.2 — 2026-10-11
628

729
- Tenshi-chan’s ahoge now rises through her halo: the near side of the ring passes in front of it. The app

‎README.md‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ from the LibreLinkUp cloud and writes them to Health Connect, where Samsung Heal
2222

2323
- **Glucose in Samsung Health**: in the background every 15 minutes (or less often), without a notification.
2424
- **Minute mode**: every new reading goes to Samsung Health, and the glucose value with its trend arrow is
25-
shown as a number in the status bar. The notification can be made quiet or hidden completely.
26-
- **Full history from LibreView**: download the export right in the app, then choose the period and the days
27-
you want in Samsung Health. Nothing is written twice, and anything unwanted can be deleted.
25+
shown as a number in the status bar. The number and the arrow can each be turned off; the notification can be
26+
made quiet or hidden completely.
27+
- **Full history from LibreView**: download the export right in the app, look through it on a chart (a day, a
28+
week, a month, all of it or any period from a calendar), then choose the days you want in Samsung Health.
29+
Nothing is written twice, and anything unwanted can be deleted. The file stays in the app until you close it.
2830
- **Estimated HbA1c (GMI)** for 14 and 90 days, from all the history SugarBridge has written to Health Connect.
2931
- **Its own chart and statistics** for 12 hours, mmol/L or mg/dL, your own target range. Tap the chart to open it
3032
full screen and move a finger along it to read every value and its time.
3133
- **Light and dark theme** in the style of [keril.art](https://keril.art/): a blue sky with a field of dots,
3234
Windows XP style windows and a pixel font. The phone's theme by default, or light or dark in Settings.
35+
- **Readable for everyone**: four text sizes and a low vision mode with the phone's own font, larger text,
36+
more contrast and a plain background.
37+
- **Developer tools** (Settings → About SugarBridge): an event log of every sync and of what Android did
38+
around it, and the state of everything that can hold glucose back, to find where a delay comes from.
3339
- **12 languages**: English, Русский, Українська, Deutsch, Français, Español, Português, Italiano, Türkçe,
3440
简体中文, 日本語, 한국어. Chosen on the first start, changeable in Settings or in Android's per-app language settings.
3541
- **The password is protected by the Android Keystore** and stays on the phone.
@@ -103,7 +109,9 @@ LibreLinkUp remembers only the last 12 hours. Everything else is kept in LibreVi
103109
2. Sign in with your **LibreLink** account, the one in the sensor app, not LibreLinkUp.
104110
3. "Glucose History" → "Download glucose data" → "I'm not a robot" → "Download".
105111
SugarBridge picks up the file by itself.
106-
4. Choose the period and the days → "Write to Health Connect". Days that are already there are marked "✓ in HC".
112+
4. Look through it in "History chart": a day, a week, a month, all of it, or a period picked in the calendar;
113+
the arrows step back and forth, a tap opens the chart full screen.
114+
5. Choose the period and the days → "Write to Health Connect". Days that are already there are marked "✓ in HC".
107115

108116
A CSV downloaded in a browser can be opened with SugarBridge or chosen with "Choose a downloaded CSV".
109117
Exports in any LibreView language work: the columns are recognized by their headers.
@@ -121,7 +129,9 @@ SugarBridge's own share is measured by device tests: in minute mode every new va
121129
a minute of LibreLinkUp having it, also with the screen off in deep Doze. The background sync is different: on an
122130
idle phone Android holds it back for hours unless the battery restrictions are removed, so do that (the home
123131
screen asks). The last link is Samsung Health: it reads Health Connect on its own schedule, which Samsung doesn't
124-
document; opening Samsung Health makes it pick up new data.
132+
document, and other apps can neither hurry it nor see when it reads; opening Samsung Health makes it pick up new
133+
data. To see it on your phone, turn on Settings → About SugarBridge → Developer tools: the log shows when each
134+
value reached Health Connect, and Health Connect's own "Recent access" shows when Samsung Health read it.
125135

126136
**Why does minute mode have a notification?** Android lets only a service with a notification run more often
127137
than every 15 minutes. It can be made quiet (Settings → "Glucose in the notification") or turned off completely
@@ -176,6 +186,7 @@ app/src/main/java/com/sugarbridge/app/
176186
├── libre/ the LibreLinkUp client, response parsing, the account under the Keystore
177187
├── libreview/ history import: CSV parsing, the site window, per-day summary
178188
├── health/ Health Connect: writing, reading our own records, deleting
189+
├── debug/ the event log and the status for the developer tools
179190
├── sync/ sync, the background job, the minute service, autostart, errors as codes
180191
├── settings/ settings, the theme and the app language
181192
├── update/ updates from GitHub Releases
@@ -202,14 +213,14 @@ GitHub Actions builds and signs the APK in Releases when a `v*` tag arrives in t
202213
```
203214
3. **Every release:** add the version's section to [CHANGELOG.md](CHANGELOG.md), then
204215
```sh
205-
git tag v1.5.2
206-
git push origin v1.5.2
216+
git tag v1.6.0
217+
git push origin v1.6.0
207218
```
208219
A few minutes later `SugarBridge.apk` appears in Releases with the notes from the CHANGELOG.
209220

210221
A signed APK can be built locally too: put `sugarbridge.keystore`, `sugarbridge.keystorePassword`,
211222
`sugarbridge.keyAlias` and `sugarbridge.keyPassword` into `~/.gradle/gradle.properties` (outside the repository)
212-
and run `./gradlew assembleRelease -Psugarbridge.version=1.5.2`.
223+
and run `./gradlew assembleRelease -Psugarbridge.version=1.6.0`.
213224

214225
## Thanks
215226

‎README.ru.md‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@
2222

2323
- **Сахар в Samsung Health** — в фоне раз в 15 минут (можно реже) без уведомления в шторке.
2424
- **Минутный режим** — каждый новый замер попадает в Samsung Health, а сахар со стрелкой виден
25-
числом в строке состояния. Уведомление можно сделать тихим или скрыть совсем.
26-
- **Вся история из LibreView** — скачайте выгрузку прямо в приложении, выберите период и дни, которые
27-
нужны в Samsung Health. Повторы не задваиваются, ненужное можно удалить.
25+
числом в строке состояния. Число и стрелку можно выключить по отдельности, уведомление — сделать тихим
26+
или скрыть совсем.
27+
- **Вся история из LibreView** — скачайте выгрузку прямо в приложении, посмотрите её на графике (день, неделя,
28+
месяц, вся или любой период из календаря) и выберите дни, которые нужны в Samsung Health. Повторы не
29+
задваиваются, ненужное можно удалить. Файл остаётся в приложении, пока вы его не закроете.
2830
- **Расчётный HbA1c (GMI)** за 14 и 90 дней — по всей истории, которую SugarBridge записал в Health Connect.
2931
- **Свой график и статистика** за 12 часов, ммоль/л или мг/дл, свой целевой диапазон. Нажмите на график —
3032
он откроется на весь экран, а пальцем по нему видно каждое значение и его время.
3133
- **Светлая и тёмная тема** в стиле [keril.art](https://keril.art/): голубое небо в точку, окна в духе
3234
Windows XP и пиксельный шрифт. По умолчанию — как на телефоне, в настройках можно выбрать светлую или тёмную.
35+
- **Удобно читать** — четыре размера текста и режим для слабовидящих: обычный шрифт телефона, крупнее,
36+
контрастнее, однотонный фон.
37+
- **Инструменты для разработчиков** (Настройки → О SugarBridge): журнал всех синхронизаций и того, что делал
38+
Android вокруг них, и состояние всего, что может задержать сахар, — чтобы найти, откуда берётся задержка.
3339
- **12 языков**: English, Русский, Українська, Deutsch, Français, Español, Português, Italiano, Türkçe,
3440
简体中文, 日本語, 한국어. Язык выбирается при первом запуске, поменять его можно в настройках приложения
3541
или в системных настройках языка приложений.
@@ -106,7 +112,9 @@ LibreLinkUp помнит только последние 12 часов. Всё
106112
2. Войдите аккаунтом **LibreLink** — тем, что в приложении с датчиком, а не LibreLinkUp.
107113
3. «История глюкозы» → «Загрузить данные о глюкозе» → «Я не робот» → «Загрузить».
108114
SugarBridge сам заберёт файл.
109-
4. Выберите период и дни → «Записать в Health Connect». Дни, которые уже есть, отмечены «✓ в HC».
115+
4. Посмотрите её в «Графике истории»: день, неделя, месяц, вся или период из календаря; стрелки листают
116+
назад и вперёд, нажатие открывает график на весь экран.
117+
5. Выберите период и дни → «Записать в Health Connect». Дни, которые уже есть, отмечены «✓ в HC».
110118

111119
CSV, скачанный в браузере, можно открыть через SugarBridge или выбрать кнопкой «Выбрать скачанный CSV».
112120
Подходят выгрузки на любом языке LibreView: колонки узнаются по заголовкам.
@@ -124,8 +132,11 @@ SugarBridge. Долю самого SugarBridge измеряют тесты на
124132
попадает в Health Connect не позже чем через минуту после того, как оно появилось в LibreLinkUp, — в том числе
125133
при выключенном экране в глубоком сне (Doze). С фоновой синхронизацией иначе: пока телефон лежит без дела, Android
126134
откладывает её на часы, если не снять ограничения батареи, — снимите (главный экран попросит). Последнее звено —
127-
Samsung Health: он читает Health Connect по своему расписанию, которое Samsung не публикует; если открыть
128-
Samsung Health, он подтянет новые данные.
135+
Samsung Health: он читает Health Connect по своему расписанию, которое Samsung не публикует, а другие
136+
приложения не могут ни поторопить его, ни увидеть, когда он читает; если открыть Samsung Health, он подтянет
137+
новые данные. Проверить это на своём телефоне: включите Настройки → О SugarBridge → «Для разработчиков» — журнал
138+
покажет, когда каждое значение попало в Health Connect, а «Недавний доступ» в самом Health Connect — когда его
139+
прочитал Samsung Health.
129140

130141
**Почему в минутном режиме есть уведомление?** Чаще раза в 15 минут Android разрешает работать в фоне
131142
только сервису с уведомлением. Его можно сделать тихим (Настройки → «Сахар в уведомлении») или
@@ -182,6 +193,7 @@ app/src/main/java/com/sugarbridge/app/
182193
├── libre/ клиент LibreLinkUp, разбор ответов, аккаунт под Keystore
183194
├── libreview/ импорт истории: разбор CSV, окно сайта, сводка по дням
184195
├── health/ Health Connect: запись, чтение своих записей, удаление
196+
├── debug/ журнал событий и состояние для инструментов разработчика
185197
├── sync/ синхронизация, фоновая задача, минутный сервис, автозапуск, ошибки в виде кодов
186198
├── settings/ настройки, тема и язык приложения
187199
├── update/ обновления из GitHub Releases
@@ -208,14 +220,14 @@ APK в Releases собирает и подписывает GitHub Actions, ко
208220
```
209221
3. **Каждый выпуск:** допишите раздел версии в [CHANGELOG.md](CHANGELOG.md) (на английском), затем
210222
```sh
211-
git tag v1.5.2
212-
git push origin v1.5.2
223+
git tag v1.6.0
224+
git push origin v1.6.0
213225
```
214226
Через несколько минут в Releases появится `SugarBridge.apk` с описанием из CHANGELOG.
215227

216228
Подписанный APK можно собрать и у себя: пропишите в `~/.gradle/gradle.properties` (вне репозитория)
217229
`sugarbridge.keystore`, `sugarbridge.keystorePassword`, `sugarbridge.keyAlias`, `sugarbridge.keyPassword`
218-
и запустите `./gradlew assembleRelease -Psugarbridge.version=1.5.2`.
230+
и запустите `./gradlew assembleRelease -Psugarbridge.version=1.6.0`.
219231

220232
## Благодарности
221233

‎app/build.gradle.kts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ plugins {
33
alias(libs.plugins.kotlin.compose)
44
}
55

6-
// The version: a release takes it from the git tag (./gradlew -Psugarbridge.version=1.5.2), otherwise this one.
6+
// The version: a release takes it from the git tag (./gradlew -Psugarbridge.version=1.6.0), otherwise this one.
77
// versionCode grows with it: 1.2.3 → 10203.
8-
val appVersion = providers.gradleProperty("sugarbridge.version").getOrElse("1.5.2")
8+
val appVersion = providers.gradleProperty("sugarbridge.version").getOrElse("1.6.0")
99
val appVersionCode = (appVersion.substringBefore('-').split('.').map { it.toIntOrNull() ?: 0 } + listOf(0, 0, 0))
1010
.take(3)
1111
.let { (major, minor, patch) -> major * 10_000 + minor * 100 + patch }

‎app/src/androidTest/java/com/sugarbridge/app/libreview/LibreViewDownloadTest.kt‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,28 @@ class LibreViewDownloadTest {
9696
}
9797
}
9898

99+
/** A large phone font must not enlarge the site's text: LibreView's cards have a fixed width. */
100+
@Test
101+
fun largePhoneFontKeepsSiteTextSize() {
102+
val shell = instrumentation.uiAutomation
103+
shell.executeShellCommand("settings put system font_scale 1.3").close()
104+
try {
105+
Thread.sleep(1000)
106+
val html = """<html><body style="font-size:16px">LibreView</body></html>"""
107+
val intent = Intent(context, LibreViewActivity::class.java).putExtra(LibreViewActivity.EXTRA_TEST_HTML, html)
108+
ActivityScenario.launch<LibreViewActivity>(intent).use { scenario ->
109+
Thread.sleep(1500)
110+
val size = LinkedBlockingQueue<String>()
111+
scenario.onActivity { activity ->
112+
findWebView(activity.window.decorView)!!.evaluateJavascript("getComputedStyle(document.body).fontSize") { size.add(it.trim('"')) }
113+
}
114+
assertEquals("16px", size.poll(10, TimeUnit.SECONDS))
115+
}
116+
} finally {
117+
shell.executeShellCommand("settings put system font_scale 1.0").close()
118+
}
119+
}
120+
99121
private fun findWebView(view: View): WebView? = when (view) {
100122
is WebView -> view
101123
is ViewGroup -> (0 until view.childCount).firstNotNullOfOrNull { findWebView(view.getChildAt(it)) }

0 commit comments

Comments
 (0)