Skip to content

Support commitments across projects, subprojects, contexts and tags#5

Merged
Fingolfin7 merged 1 commit intomasterfrom
codex/extend-commitments-system-to-subprojects-and-tags
Feb 23, 2026
Merged

Support commitments across projects, subprojects, contexts and tags#5
Fingolfin7 merged 1 commit intomasterfrom
codex/extend-commitments-system-to-subprojects-and-tags

Conversation

@Fingolfin7
Copy link
Copy Markdown
Owner

Motivation

  • Allow users to attach commitments not only to projects but also to subprojects, contexts or tags so progress/streak/banking can be tracked across aggregation types.
  • Keep existing per-project flows intact while enabling cross-aggregation reporting and reconciliation.

Description

  • Added an aggregation_type field and optional one-to-one target fields (project, subproject, context, tag) to the Commitment model and added model-level clean() validation to require exactly one target and ensure the target belongs to the same user. (core/models.py)
  • Introduced get_commitment_sessions_queryset() and updated get_commitment_progress(), calculate_commitment_streak() and reconcile_commitment() to aggregate sessions according to the selected aggregation_type (project membership, subproject relation, project context, or project tags). (core/utils.py)
  • Extended the CommitmentForm to present aggregation_type plus per-user ModelChoiceFields for project/subproject/context/tag, normalize the chosen target during clean(), and initialize project-scoped creates when project_pk is provided. (core/forms.py)
  • Updated create/update/delete views and URLs to support a generic create flow and to preserve project-scoped redirects when appropriate, and updated templates/dashboard to display target_name with the aggregation type. (core/views.py, core/urls.py, core/templates/core/*.html)
  • Added a migration 0034_commitment_aggregation_type_commitment_context_and_more.py to alter the commitment schema. (core/migrations/0034_*.py)

Testing

  • Ran migration generation with python manage.py makemigrations core which produced the migration for the schema changes successfully. (succeeded)
  • Ran the focused commitment test suite python manage.py test core.tests.CommitmentViewTests core.tests.UpdateProjectViewCommitmentTests core.tests.ProjectsListViewCommitmentTests core.tests.CommitmentStreakTests and validated the tests passed. (succeeded)
  • Attempted a Playwright UI screenshot to validate templates, but the headless Chromium process crashed in this environment, so no screenshot artifact was produced (environment limitation, not functional regression). (failed artifact capture)

Codex Task

@Fingolfin7 Fingolfin7 merged commit a5daf7a into master Feb 23, 2026
3 checks passed
@Fingolfin7 Fingolfin7 deleted the codex/extend-commitments-system-to-subprojects-and-tags branch February 23, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant