Inbox "Document Count" Sorting Fix, Plus Internal Infrastructure and Planning Updates (Dev → QA)
Executive summary
This QA batch promotes one user-facing correction — sorting the inbox by Document Count now orders rows by the same active document count that is displayed — alongside two internal-only changes: a Docker configuration cleanup for the authentication service and design documentation for a future dashboard. The only behavior a user will notice is the corrected inbox sort.
Why this was needed
When users sorted the inbox grid by Document Count, the order looked scrambled: the displayed count counts only active, current document versions, but the underlying sort counted all document rows, including superseded and inactive versions. A mail with many old document versions would therefore sort to the top while showing a small count, so the sorted column appeared inconsistent and untrustworthy. The infrastructure and documentation changes address internal maintainability rather than a user-facing problem.
Client / user impact
- Sorting the inbox by Document Count now produces a consistent, correct order that matches the numbers shown in each row.
- The same active-and-current document counting now aligns the sort, the displayed value, and the document-count range filter, so all three agree.
- No other user-facing behavior changes in this batch; the remaining items are internal (deployment configuration and planning documents).
Technical scope
Promotes three commits from Dev to QA:
- Inbox sort fix (
app/services/mail/mail_query_service.py): theORDER BYsubquery for Document Count now filtersDocuments.is_active AND Documents.is_current, matching the displayeddocument_count/number_of_filesvalue and the existing range filter. - IAM port configuration refactor (
docker-compose.all-in-one.yml,.env.example,.env.iam): the authentication (IAM) service listener port is now driven by a singleIAM_PORTvariable (default 8001) interpolated into the service expose/healthcheck, the gateway upstream, and per-serviceIAM_INTERNAL_URL/IAM_JWKS_URLoverrides. Internal deployment plumbing only — no API or runtime behavior change. - Planning documentation (
docs/plans/): two markdown files (PRD and technical spec) describing a proposed future per-user dynamic dashboard. Documentation only — no feature was built or shipped.
Risk & mitigation
Low. The inbox change is a tightly scoped query-filter adjustment that brings the sort in line with logic already used elsewhere for the displayed count, so divergence is unlikely. The Docker change is config-only and was verified to resolve to the default port 8001 unless explicitly overridden; the main risk is an environment that previously relied on the now-removed IAM_PORT in .env.iam, mitigated by the default value and inline notes. The documentation files carry no runtime risk.
QA validation focus
- In the inbox grid, sort by Document Count ascending and descending and confirm rows are ordered by the count shown in each row, with no scrambled ordering.
- Verify mails that have superseded/inactive document versions sort by their visible active count, not by total document rows.
- Confirm the Document Count range filter still returns the expected mails and agrees with the sorted values.
- Smoke-test the QA deployment to confirm services start and the IAM/authentication service is reachable on its default port with no regression in login or other flows.