Skip to content

feat(applications): PATCH history entries and Stage History editor (#11)#17

Merged
leobrqz merged 3 commits intomainfrom
feat/patch-application-history
Mar 22, 2026
Merged

feat(applications): PATCH history entries and Stage History editor (#11)#17
leobrqz merged 3 commits intomainfrom
feat/patch-application-history

Conversation

@leobrqz
Copy link
Copy Markdown
Owner

@leobrqz leobrqz commented Mar 22, 2026

Summary

Adds PATCH support for application history entries (API + validation + current_stage handling), a Stage History edit flow in the UI, Vitest coverage for key applications surfaces with jsdom setup and Radix-friendly polyfills, small a11y tweaks and env example cleanup aligned with the current stack and setup.

Changes

Application history (backend + frontend)

  • API: PATCH for application history updates; ApplicationHistoryUpdate schema; update_history_entry with validation and current stage recalculation after edits.
  • Refactor: _get_latest_history_entry extracted and reused from delete (and related history logic).
  • Frontend: updateHistoryEntry in applications.service.ts; OpenAPI-generated types updated (api.generated.ts, exports).
  • UI: StageHistoryDialog — secondary dialog to edit stage, date, notes; save/cancel, toasts, refetch / onStageChanged behavior.

Related UI / typing fixes

  • ApplicationDetailDialog — variable usage fixes.
  • ApplicationTableColumnDef typing adjustments.
  • Calendar — locale / timeFormat propagation where needed.
  • Settings — timezone label display tweak.
  • AppointmentListDialog — pass locale and timeFormat into AppointmentCard for consistent formatting.
  • api-client — minor typing fix.

Tests and tooling

  • Vitest in frontend/apps/web: vitest.config.ts (jsdom, aliases), vitest.setup.ts (@testing-library/jest-dom/vitest, ResizeObserver stub, pointer-capture / scrollIntoView shims for Radix Select).
  • Tests: __tests__/ApplicationTable.test.tsx, StageHistoryDialog.test.tsx, applications-page.test.tsx (mocked services/hooks; assertions on calls, refetch, validation paths).
  • package.json: web test script + devDependencies; frontend root script to run web tests.
  • pnpm-lock.yaml updated for new deps.

Accessibility

  • Stage history row action: aria-label on the trigger button.
  • Shared Dialog (packages/ui): forward aria-describedby for better descriptions with screen readers.

Config samples

  • backend/.env.example: local vs Docker blocks with {placeholder} tokens (pick one block in real .env).
  • frontend/apps/web/.env.example: documented (e.g. NEXT_PUBLIC_API_URL) as applicable.

Notes

leobrqz added 3 commits March 21, 2026 23:13
Add PATCH endpoint and UI to edit application history entries. Backend: introduce ApplicationHistoryUpdate schema, implement update_history_entry with validation and current_stage recalculation, factor out _get_latest_history_entry and reuse it in delete_history_entry. Frontend: add updateHistoryEntry API and types, extend StageHistoryDialog with an edit dialog (fields: stage, date, notes) and wire up save/cancel flows, plus related UI/type fixes across components (ApplicationDetailDialog variable usage, ApplicationTable ColumnDef typing, calendar/appointment locale/timeFormat propagation, timezone label display, and a minor api-client typing fix).
Add unit tests for applications UI (ApplicationTable, StageHistoryDialog, ApplicationsPage) using Vitest and Testing Library with mocks for services and hooks. Introduce vitest.config.ts and vitest.setup.ts (jsdom environment, jest-dom, ResizeObserver stub and pointer-capture shims). Add test scripts and testing devDependencies to the web package.json and a workspace test script in frontend/package.json. Also add accessibility improvements: aria-label on the Stage history button and pass-through of aria-describedby in the shared Dialog component.
@leobrqz leobrqz self-assigned this Mar 22, 2026
@leobrqz leobrqz added the feature New feature label Mar 22, 2026
@leobrqz leobrqz linked an issue Mar 22, 2026 that may be closed by this pull request
@leobrqz leobrqz changed the title feat(applications): PATCH history entries and Stage History editor (#11) feat(applications): PATCH history entries and Stage History editor Mar 22, 2026
@leobrqz leobrqz merged commit 2c26d94 into main Mar 22, 2026
5 checks passed
@leobrqz leobrqz deleted the feat/patch-application-history branch March 22, 2026 19:29
@leobrqz leobrqz changed the title feat(applications): PATCH history entries and Stage History editor feat(applications): PATCH history entries and Stage History editor (#11) Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(history): PATCH application history entries with stage invariants

1 participant