Skip to content

fix: restore parent prompts after subhabit resolution (ORB-86) - #692

Merged
thomasluizon merged 8 commits into
mainfrom
fix/orb-86-parent-prompt-skips
Aug 7, 2026
Merged

thomasluizon merged 8 commits into
mainfrom
fix/orb-86-parent-prompt-skips

Conversation

@thomasluizon

@thomasluizon thomasluizon commented Aug 7, 2026 •

Copy link
Copy Markdown
Owner

DEGRADED: same-vendor review

Summary

  • count server-known flexible skips as resolved without treating them as logged
  • reset parent prompt suppression after a selected-date change
  • route web force logging through the same parent prompt check as mobile

Verification

  • shared Vitest: 127 files, 1605 tests passed
  • web Vitest: 309 files, 2552 tests passed
  • mobile Vitest: 247 files, 1612 tests passed
  • lint passed in shared, web, and mobile
  • type check passed in shared, web, and mobile

External interface evidence

The UI reads flexibleTarget and flexibleCompleted from the habit-schedule response. The complete top-level item key set and types emitted by the API is:

{
  id: string (UUID),
  title: string,
  description: string | null,
  frequencyUnit: string | null,
  frequencyQuantity: integer | null,
  isBadHabit: boolean,
  isCompleted: boolean,
  isGeneral: boolean,
  isFlexible: boolean,
  days: string[],
  position: integer | null,
  createdAtUtc: "<ISO-8601 timestamp>",
  dueDate: "<ISO-8601 date>",
  dueTime: "<ISO-8601 time>" | null,
  dueEndTime: "<ISO-8601 time>" | null,
  endDate: "<ISO-8601 date>" | null,
  scheduledDates: "<ISO-8601 date>"[],
  isOverdue: boolean,
  reminderEnabled: boolean,
  reminderTimes: integer[],
  scheduledReminders: ScheduledReminderTime[],
  slipAlertEnabled: boolean,
  checklistItems: ChecklistItem[],
  tags: HabitTagItem[],
  linkedGoals: LinkedGoalDto[],
  children: HabitScheduleChildItem[],
  hasSubHabits: boolean,
  flexibleTarget: integer | null,
  flexibleCompleted: integer | null,
  isLoggedInRange: boolean,
  instances: HabitInstanceItem[],
  searchMatches: SearchMatchField[] | null,
  emoji: string | null
}

Re-derive the shape at orbit-api/src/Orbit.Application/Habits/Queries/GetHabitScheduleQuery.cs:20 (HabitScheduleItem) and the values at orbit-api/src/Orbit.Application/Habits/Queries/HabitScheduleFilters.cs:235 (CalculateFlexibleProgress). The mapper returns both counters as null unless isFlexible is true and referenceDate exists. Otherwise it emits flexibleTarget = max(0, frequencyQuantity - skipped) and flexibleCompleted = completed; GetSkippedInWindow counts HabitLog.Value == 0, while GetCompletedInWindow counts HabitLog.Value > 0 in the same schedule window (HabitScheduleService.cs:346). The schedule handler supplies ReferenceDate: dateFrom for ranged requests (GetHabitScheduleQuery.cs:248). Thus a flexible item with non-null 0/0 counters and isLoggedInRange: false is a server-encoded all-skipped window, not an invented fixture field.

Ticket

ORB-86

Visual check

Visual check owed before moving the ticket to In Review.

@vercel

vercel Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
orbit-ui-mobile-web Ignored Ignored Aug 7, 2026 2:07pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba1530ab00

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/shared/src/utils/habit-list-progress.ts
@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8180c47f2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/shared/src/utils/habit-list-progress.ts
Comment thread apps/web/components/habits/habit-list.tsx Outdated
@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 135cb74f95

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/components/habits/habit-list.tsx Outdated
@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33ec8ff2b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/shared/src/utils/habit-list-progress.ts
@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: e84878a65b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@thomasluizon

Copy link
Copy Markdown
Owner Author

DEGRADED: same-vendor review

Same-vendor bias direction is known, but its magnitude in this workflow is unmeasured.

Reviewed head: e84878a65bf461d473b60a6f4a3329905fc463b3

APPROVED BY PR-REVIEW: zero blocking findings

Findings

F1 [Medium, Non-blocking] Require flexible semantics in the server-known skip predicate

  • Dimension: 1. Correctness; 7. Contract alignment and backward compatibility
  • Location: packages/shared/src/utils/habit-list-progress.ts:114
  • Diff anchor: const isServerKnownSkip = followed by the counter comparison, without child.isFlexible
  • Claim: the predicate relies on the external null-versus-zero counter contract instead of encoding that only flexible habits are skippable. A pending non-flexible child whose counters are ever serialized as 0/0 would be counted as skipped, which can complete the aggregate early and open the parent prompt in SKIP mode.
  • Fix direction: require child.isFlexible in the predicate and retain real response-shape evidence for the nested child counters.
  • Reference: Orbit Review Rubric, dimensions 1 and 7; repository external-interface rule.
  • Follow-up: ORB-249 already tracks this exact finding. No duplicate was created.

Follow-ups

  • ORB-249 (existing)

N/A dimensions

    1. Security: no authentication, authorization, sensitive storage, validation, logging, endpoint, or user-input surface changed.
    1. i18n: no user-facing string or locale key changed.
    1. Design: component edits are state/effect logic only; no rendered structure, styling, layout, or accessibility surface changed.
    1. Backend hard rules: this is an orbit-ui-mobile frontend/shared diff.
    1. FEATURES.md gating: this is a bugfix with no new screen, route, tool, plan gate, platform availability, or locale-specific behavior.

Delivery note

The D7 web/mobile screenshots remain explicitly owed by ORB-86 and the PR body before the ticket moves to In Review. This is not a diff finding because it cannot be anchored to a changed line.

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@thomasluizon
thomasluizon merged commit 868cd81 into main Aug 7, 2026
27 checks passed
@thomasluizon
thomasluizon deleted the fix/orb-86-parent-prompt-skips branch August 7, 2026 20:39
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