Extract ADRs to dedicated tab on card details - #881
Merged
Conversation
Architecture Decision Records linked to a card were buried in an accordion
inside the Resources tab, sharing space with files, links and diagrams.
Promote them to their own tab next to Resources, mirroring the Risks tab:
reference, title, status, linked cards and last-modified date, with row
click through to the decision.
- New AdrsTab backed by the existing GET /adr/by-card/{id}, carrying the
Link ADR / Create ADR / unlink actions moved out of ResourcesTab.
- Visible when the card has linked decisions, or when the user may manage
ADR links so the first decision stays one click away.
- link_card / unlink_card now publish adr.linked / adr.unlinked against the
affected card, so ADR links show in card History and drive the tab's
new-activity dot.
- GET /adr/by-card/{id} returns 400 on a malformed card id instead of 500.
- Fix two ADREditor strings that were looked up in the wrong namespace and
rendered as raw keys.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vVfKVF6MUsAjYjAK5MPmR
Long decision titles ran underneath the trailing "Link ADR" button and
short references wrapped to two lines ("ADR-" / "009"). MUI reserves
exactly 48px of right padding for a ListItem secondaryAction and
positions it absolutely, but the button is ~100px wide, so the text slid
under it; the reference then wrapped because it was a shrinkable flex
child with no flexShrink.
Rebuild the row on the pattern already used by DeliverableSection's
AdrRow: a clickable flex row where every element stays in normal flow,
so the overlap is impossible by construction rather than by padding
arithmetic.
- Whole-row click links the decision; the per-row button is gone.
- Monospace reference chip with flexShrink:0 — can never wrap, and gives
the references a consistent column.
- Title takes flex:1/minWidth:0 with noWrap; status chip on the right.
- Dialog widened to md so full titles fit instead of ellipsising.
- Rows sorted by reference, matching the tab's own table (GET /adr
returns updated_at desc).
- Search box gained a clear button; the list scrolls inside a bounded
container instead of stretching the dialog.
- A spinner replaces the empty state while the fetch is in flight, so
"nothing available to link" no longer flashes on open, and a search
matching nothing now says so instead.
Verified in a browser against demo data: every reference renders on one
line and every row keeps an 8px gap between title and status chip, at
both 1440px and 700px and in the RTL locale.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vVfKVF6MUsAjYjAK5MPmR
Whole-row click made the picker one stray click away from attaching a decision. Hold the clicked ADR and confirm first. The prompt names both sides of the link — "ADR-002 — «Introduce Centralized API Gateway» will be linked to «Azure IoT Hub»" — so the user can see what they are about to attach, and Cancel leaves the picker open to choose a different one. Verified against a running backend: opening the confirm writes nothing, Cancel writes nothing and keeps the picker open, Escape dismisses only the confirm, and confirming links exactly one decision and closes both dialogs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vVfKVF6MUsAjYjAK5MPmR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves Architecture Decision Records (ADRs) from the Resources tab into a dedicated ADRs tab on card details. This gives ADRs first-class visibility alongside other card resources and simplifies the Resources tab by removing ADR-specific UI logic.
Type
Changes
AdrsTabcomponent (frontend/src/features/cards/sections/AdrsTab.tsx): Displays all ADRs linked to a card in a table with reference, title, status, linked cards, and last-modified date. Includes quick actions to link existing ADRs, create new pre-linked ADRs, and unlink (whencanManageAdrLinksis true).ResourcesTab: Removed all ADR-related state, dialogs, and rendering logic. RemovedcardName,cardType, andcanManageAdrLinksprops (no longer needed).CardDetailContent: Added ADRs tab to the tab bar with conditional visibility (shows if user can view ADRs and either has ADRs linked or can manage ADR links). Properly indexes subsequent tabs (Risks, Compliance, History) to account for the new tab._publish_adr_card_event()helper inbackend/app/api/v1/adr.pyto fan ADR link/unlink events to the affected card's history timeline, enabling the ADRs tab activity indicator.useCardTabActivity.tsto mapadr.linkedandadr.unlinkedevents to theadrstab.resources.*toadrs.*namespace across all 8 locales. Updated delivery docs to reflect the new tab location.AdrsTabcovering load, render, navigation, permissions, link/unlink, and empty states. UpdatedResourcesTabtests to remove ADR-related assertions.Test Plan
Unit tests pass:
AdrsTab.test.tsxcovers loading, rendering, navigation, permission checks, linking/unlinking, and empty states.ResourcesTab.test.tsxupdated to remove ADR assertions.Manual verification:
canManageAdrLinks=true, click "Link ADR" → dialog opens, search filters available ADRs, clicking "Link" associates the ADR and reloads the tab.CreateAdrDialogopens with the card pre-linked.canManageAdrLinks, link/create/unlink buttons are hidden.All CI checks pass (backend lint, backend tests, frontend lint, frontend build, frontend tests)
Manually tested the affected feature
Added/updated tests for new or changed behavior
Checklist
CLAUDE.mdcan("adr.view"))async deffor all new route handlershttps://claude.ai/code/session_017vVfKVF6MUsAjYjAK5MPmR