Skip to content

Fix notification delta truncation and normalize Nightscout URL#41

Merged
psjostrom merged 2 commits intomainfrom
worktree-docs
Mar 22, 2026
Merged

Fix notification delta truncation and normalize Nightscout URL#41
psjostrom merged 2 commits intomainfrom
worktree-docs

Conversation

@psjostrom
Copy link
Owner

Summary

  • Fix collapsed notification delta text (-0,2 · IOB 1.2U) being truncated — parent layout was wrap_content instead of match_parent
  • Normalize Nightscout URL on save: adds https:// if no scheme, strips trailing slash, trims whitespace — matching SugarField's normalizeUrl behavior

Test plan

  • Verify collapsed notification shows full delta + IOB text without ellipsis
  • Enter Nightscout URL without scheme (e.g. springa.vercel.app) → confirm it saves as https://springa.vercel.app
  • Enter URL with trailing slash → confirm slash is stripped
  • Enter URL with http:// → confirm scheme is preserved

🤖 Generated with Claude Code

@psjostrom
Copy link
Owner Author

Code review

Found 1 issue:

  1. Documentation regressions from PR Add documentation site #40. This branch contains an older copy of the docs that was merged as PR Add documentation site #40, but without the review fixes applied during that PR's review. Merging PR Fix notification delta truncation and normalize Nightscout URL #41 will revert those fixes:

    • mkdocs.yml line 56: pymdownx.superfences is listed as a plain extension, removing the Mermaid custom fence config and dropping pymdownx.arithmatex + MathJax JS entirely. On main these were added during PR Add documentation site #40 review.
    • docs/reference/prediction-algorithm.md line 33: says "seconds before now" — on main this was corrected to "minutes before now" (the code uses minutes).
    • docs/data-sources/companion.md line 21: says "18–900 mg/dL" — on main this was corrected to "51–500 mg/dL" during PR Add documentation site #40 review.

    strimma/mkdocs.yml

    Lines 55 to 57 in 6a30d18

    - pymdownx.details
    - pymdownx.superfences
    - pymdownx.tabbed:

    where `t` is seconds before now (negative, so recent readings get higher weights) and `DECAY = 0.35`.

    Strimma automatically detects whether the notification shows glucose in mmol/L or mg/dL and converts as needed. Values are validated to be in the physiological range (1.0–50.0 mmol/L / 18–900 mg/dL) — anything outside this is ignored.

    Recommendation: Rebase this branch onto current main (which has PR Add documentation site #40's fixes), or cherry-pick only commit 6a30d18 (the notification + URL fix) onto a fresh branch.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

psjostrom and others added 2 commits March 22, 2026 15:02
- Change collapsed notification text overlay to match_parent width so
  delta, IOB, and crossing text use the full notification width instead
  of wrapping to the BG value width.
- Normalize Nightscout URL on save: add https:// if no scheme, strip
  trailing slash, trim whitespace — matching SugarField behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLAUDE.md previously stated all endpoints use .json suffix, but the
actual Nightscout convention (and our implementation) only uses .json
on GET endpoints. POST endpoints use the bare path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@psjostrom psjostrom merged commit dd34145 into main Mar 22, 2026
1 check passed
@psjostrom psjostrom deleted the worktree-docs branch March 22, 2026 14: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