Health: a new app to track health metrics and conditions (WIP)

Thanks.

Yes I can handle PRs and release. I’ll merge your fixes.

FYI, i’m not using SDK, i’m just using qmlscene on the phone (C2) itself, since the cpp is just a shell anyway.

if you don’t agree with any of the above, please let me know before i put time in.

Most seems fine for me.

For the settings, you’re aiming to store the data somewhere ? I didn’t get your aim for last used profile and date.

For the modules option, as it require functional redesign, we can keep it for later, so we also have a working V1 quickly up.

ok, i’m already working on that, basically, when a profile is used, you update a datetime field lastUsed, then you can find the last used profile by ordering on lastUsed

also, i’ve noticed the deleting is like a seperate page for it, while the SailfishOS way is to use context menu and then a timer to cancel

i’ve also seen some things where it accidentally works as long as there’s no gap in ids and such…

also, for next version, it’d be great to have like a main option pull menu “Add measurement” which could be anything (and even for other profiles) so it can then also be a cover action, so you don’t have to go through various pages to get to where you want to be; the quicker people can add something, the more they will use it.

also, i’ve seen date, i’d like to make it datetime too, would be useful for multiple measurements/day, like for nutrition or calorie intakes, and maybe we can track outtake too (like type 1, type 2, type 3).

1 Like

Thanks.

The students started mainly from scratch, but with inspiration from our previous application (weight tracker : GitHub - adelnoureddine/harbour-weight-tracker ).

1 Like

I sent a new PR with some more fixes, i think i’ll have to redo some of the metrics now, in order for me to get my calories in

I’ve used some AI tools to have a big redesign of the app and improvements (UI, database, etc.), and test it quickly in the emulator.

It’s in the latest commit on github, you can check that and continue from there.

Are you ok with such a radical change? there seems to be not much code left of the students… It’s become a different app, kind of… a bit annoying with the changes i’ve planned and worked on, which i now have to rework, i kind of wish you’d have instructed it to keep changes minimal, as well.

Edit: after some looking around, due the AI losing context, a lot of things that worked with the student codes has stopped working. including profiles. also, i’m unclear of the “quick buttons”? is that not duplicated functionality of the above?

You can continue on the students’ version and your modifications, and I’ll make a branch for the AI ones. It was just a suggestion to quicken things, but I’m happy with any updates you’re proposing.

1 Like

I’m gonna continue down the path, but I do have to fix a few things, but it does have some cleaner things going for it.

But there is some kind of breakdown in context though, one part is not using metrics and that was still the case before the update though.

At work, i’m using AI, but if you’re using AI, it seems that it’s much better to have it work on requirements before doing the coding, cause when you update the requirements, you keep your context in the requirements, so the AI doesn’t lose it.

Anyway, i’m not adverse to using AI, but if you’re changing existing code, you need to leash the AI and keep changes small, so it’s reviewable and correctable before applying it, imho.

I’m gonna put the utils stuff in the DataManager and merge this so, there isn’t any weird duplication going on. and fixing profiles again, I have 1 commit atm, but i’m fixing some more parts before i push and PR

2 Likes

Yep, this is 100% correct. Maybe 110%.

2 Likes

I created an alternative-ui branch for the AI stuff. You can continue with your modifications on the develop branch.

It took me some time, but i have a bunch of fixes Fixing profiles, metrics, weight card, height card, bmi card by alien999999999 · Pull Request #6 · adelnoureddine/harbour-health · GitHub

Merged. I still need to test it properly, though.

yeah, water and the rest still need fixing

ok, water and calories are converted to the metrics system and work now; i also set these grouped on days starting from 04:00:00 so that nightly snacks still go with the previous day.

In the pull request, i also described my next aims

Thanks @AL13N. I merged your PR.

I ran this new update in the emulator, it looks quite good now :slight_smile:

A few tweaks to polish it and fix a few issues, but overall it’s getting in good shape.

For the new metrics, I’d go with a system where users can create a new metric and follow it up (the DB is good for that without changing anything) –> this avoid manually adding sugar, cholesterol, etc. (we can have a few categories in by default).

that is not a bad idea too.

I was also gonna have like a selectable modules, that way the grid cards can be a model behind it; eg: for me, i have no need of height, water and menstruation, so i could disable that.

i did a small PR for grouped display in metric details for grouped metrics (calories and water are grouped per day starting at 04:00 )

I pushed a few fixes from Claude, so be sure to take it from there:

Bug Fixes Applied

  qml/js/DataManager.js
  - debugDB: data.append() → data.push() — Array has no .append() method, this would throw at runtime
  - getLatestLogText: CONCAT(l.value, m.unit) → (l.value || m.unit) — SQLite has no CONCAT() function; ||
  is the correct concatenation operator
  - getVaccineLogsToModel: removed stray return logs; — logs is never declared in this function (only in
  getVaccineLogs), causing a ReferenceError

  qml/pages/VaccineDetails.qml
  - profiles[0].id → profileId — profiles was never declared in this file; the page already has a
  profileId property

  qml/pages/chooseProfile.qml
  - activeProfile = model → DataManager.useProfile(model.id) — activeProfile doesn't exist on
  ApplicationWindow; calling useProfile updates lastUsed so MainPage.updateData() correctly picks it up on
   return via lastUsedProfileId()

  qml/pages/AddAndEditIllness.qml
  - Renamed property string status → conditionStatus — the custom property shadowed the built-in
  Page.status, making onStatusChanged always compare a string "Active" against PageStatus.Active, so edit
  mode never loaded existing condition data

  qml/pages/History.qml
  - "Clear History" now uses page.profileId instead of always deleting history for profiles[0]

  qml/pages/ConsultIllness.qml
  - Added property int profileId: -1; replaced profiles[0].id with profileId; now passes profileId forward
   to AddAndEditMedication, AddAndEditIllness, and ConsultMedication

  qml/pages/MainHealthCondition.qml
  - Passes profileId when navigating to ConsultIllness (both tap and context-menu edit paths)

  qml/pages/AddAndEditMedication.qml / ConsultMedication.qml
  - Default profileId: 1 → profileId: -1 — hardcoded 1 would silently save/query data under the wrong
  profile

  qml/pages/HistoryOfAllCycle.qml
  - Passes profileId: page.profileId to HistoryOfOneCycle — previously omitted, leaving it at -1 and
  showing no daily logs

  qml/pages/HistoryOfOneCycle.qml
  - Filters logs to the selected cycle's startDate/endDate range instead of loading all logs for the
  profile
1 Like