Skip to content

Route both action tabs through relationship-actions endpoint#370

Merged
jhodapp merged 3 commits intomainfrom
fix/coachee-actions-assignee-filter
Apr 4, 2026
Merged

Route both action tabs through relationship-actions endpoint#370
jhodapp merged 3 commits intomainfrom
fix/coachee-actions-assignee-filter

Conversation

@jhodapp
Copy link
Copy Markdown
Member

@jhodapp jhodapp commented Apr 4, 2026

Description

Fixes the bug where "My Actions" and "Coachee Actions" tabs showed identical results on the Actions page. Both tabs now use the same batch relationship-actions endpoint, differentiated by assignee=coach vs assignee=coachee.

Changes

  • Unified URL query string builder in relationship-actions.ts — the assignee param was previously dropped on single-relationship URLs
  • Parameterized assignmentFilterToRelationshipActionsParams with assigneeScope so it serves both coach and coachee views
  • Removed the user-actions path from use-actions-fetch.ts — both tabs now route through useBatchRelationshipActions
  • Role-aware scoping: coach users get assignee=coach, coachee-only users get assignee=coachee on "My Actions"
  • Cleaned up dead code: removed assignmentFilterToUserActionsParams, unused imports

Screenshots / Videos Showing UI Changes (if applicable)

None

Testing Strategy

  • npx tsc --noEmit — passes
  • npx vitest run — 22 tests pass across use-actions-fetch, relationship-actions, and use-all-actions-with-context test files
  • Manual: verify "My Actions" sends assignee=coach and "Coachee Actions" sends assignee=coachee in network tab
  • Full fix requires backend PR to respect the assignee param on the single-relationship endpoint

Concerns

  • The backend's single-relationship endpoint (/coaching_relationships/{rel_id}/actions) currently ignores the assignee query param — backend team has confirmed the root cause and is implementing the fix
  • useUserActionsList is intentionally kept in user-actions.ts since it's used by 3 other callers (panel-actions, assigned-actions, coaching-tabs-container)

…h role-based assignee filtering

Both "My Actions" and "Coachee Actions" now use the same batch
relationship-actions endpoint, differentiated by assignee=coach vs
assignee=coachee. This fixes the bug where both tabs showed identical
results because My Actions used a different endpoint that wasn't
filtering by assignee correctly.

- Unified URL query string builder to always include the assignee param
  (previously dropped on single-relationship endpoint)
- Parameterized assignmentFilterToRelationshipActionsParams with
  assigneeScope so it works for both coach and coachee views
- Coachee-only users get assignee=coachee on My Actions (no tab toggle)
- Removed dead user-actions path code from use-actions-fetch
@jhodapp jhodapp self-assigned this Apr 4, 2026
@jhodapp jhodapp changed the title fix: route both action tabs through relationship-actions endpoint Route both action tabs through relationship-actions endpoint Apr 4, 2026
@jhodapp jhodapp added the bug fix Fixes a specific Issue label Apr 4, 2026
@jhodapp jhodapp added this to the 1.0.0-beta3 milestone Apr 4, 2026
@jhodapp jhodapp requested a review from calebbourg April 4, 2026 00:51
@jhodapp jhodapp marked this pull request as ready for review April 4, 2026 00:52
The actions kanban page now fetches from the batch
/coaching_relationships/actions endpoint instead of /users/{id}/actions.
Updated mock routes and response format to match the new
BatchCoacheeActionsResponse shape.
@jhodapp jhodapp merged commit 668bdb2 into main Apr 4, 2026
6 checks passed
@jhodapp jhodapp deleted the fix/coachee-actions-assignee-filter branch April 4, 2026 02:10
@github-project-automation github-project-automation bot moved this from Review to ✅ Done in Refactor Coaching Platform Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixes a specific Issue

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant