Skip to main content

Release Notes — OKR Management UX Improvements

Date: February 11, 2026
Affected Modules: OKR Management (Focus View), OKR Cycle Detail
Affected Files: OkrManagePage.tsx, OkrManagePageV3.tsx, OkrCycleDetailDrawer.tsx


Bug Fixes

1. Approval Button Loading Issue

Problem: When clicking any unit's approval button (Submit, Approve, Revise, Withdraw) on the OKR Management page, all units' same-type buttons showed loading simultaneously.

Root Cause: approvalMutation.isPending was a single boolean passed to all UnitTree nodes identically, with no way to distinguish which unit's button was clicked.

Fix:

  • OkrManagePage.tsx: approvalLoading prop changed from boolean to string | null (clicked unit ID). Each UnitTree node shows spinner only when approvalLoading === node.id.
  • OkrManagePageV3.tsx: pendingApprovalStatus variable tracks which status transition is pending, isolating loading to the clicked button.

2. "Role is not defined" Runtime Error

Problem: Role is not defined error in the console when opening OkrCycleDetailDrawer on the /okr/cycles page.

Root Cause: import { Role } from '../../types/rbac.types' caused the enum's runtime value to be erased under isolatedModules: true + Vite HMR.

Fix: Changed to import type { Role } and replaced enum values with a string literal array (['SUPER_ADMIN', 'ADMIN', ...] as Role[]).


Improvements

3. OKR Stats Cards — Correct Calculation

Problem: Stats cards (Total Objectives, Total KRs, Initiatives, etc.) showed incorrect numbers by aggregating all descendant units.

Fix: Removed backend /new-okr/stats call. Stats are now computed on the frontend via useMemo:

MetricScope
Total ObjectivesSelected unit + all sub-units
Approved / Pending / DraftSelected unit + all sub-units
Total KRSelected unit + all sub-units
InitiativesSelected unit + all sub-units
Sub-unitsSelected unit + all sub-units
Weighted AchievementOnly the selected unit's direct objectives
Weighted HealthOnly the selected unit's direct objectives

New Features

4. OKR Owner & Contributor System

Description: Added granular ownership (owner) and contributor assignment at Objective, Key Result, and Initiative levels.

Ownership Rules:

OKR RecordOwnerContributor
ObjectiveAutomatic: Unit leader (read-only)Multi-select (on create + edit)
Key ResultSingle search & selectMulti-select (on create + edit)
InitiativeSingle search & selectMulti-select (on create + edit)

Confidentiality & Visibility:

  • A record's owner or contributor can see confidential records regardless of unit membership.
  • Ancestor unit leaders can always see all descendant records.
  • SUPER_ADMIN and GROUP_ADMIN can see all records.

Backend Changes:

  • new-okr.service.ts: 6 CRUD methods with ownerMembershipId and contributorIds support
  • new-okr.controller.ts: Objective contributor CRUD endpoints
  • confidentiality.service.ts: 3 new owner/contributor visibility methods
  • Hierarchy response includes ownerMembership and contributors data

Frontend Changes:

  • OkrManagePageV3.tsx and OkrManagePage.tsx: All 6 form drawers (3 create + 3 edit) with owner/contributor UI on both pages
  • Edit/view drawers converted to 2-tab structure ("Details" + "Contributors")
  • "Edit" button added to view mode (hidden for locked units)
  • Create forms redesigned to match edit form layout (grid md:grid-cols-2, section dividers)
  • Dynamic owner/contributor selection via member search API

Affected Files:

  • cos-be/src/new-okr/new-okr.service.ts
  • cos-be/src/new-okr/new-okr.controller.ts
  • cos-be/src/common/services/confidentiality.service.ts
  • cos-be/src/rbac/registries/okr.registry.ts
  • cos-fe/src/pages/Okr/OkrManagePageV3.tsx
  • cos-fe/src/pages/Okr/OkrManagePage.tsx

Installation / Upgrade

This release includes both frontend and backend changes. Prisma schema was updated in prior releases; no additional migration needed.

  1. cd cos-be && npm run build to rebuild the backend.
  2. cd cos-fe && npm run build to rebuild the frontend.
  3. Deploy.