Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions frontend/taskdeck-web/src/components/review/ReviewProposalCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,17 @@ function reviewStatusLabel(status: Proposal['status']): string {
return statusLabels[normalized] ?? normalized
}

const readOnlyDiffBanner = computed(() => {
const prefix = `${reviewStatusLabel(props.proposal.status)} · read-only —`
if (props.selectedDiff) {
return `${prefix} showing the stored preview from the original submission.`
}
if (storedOperationsFallback.value) {
return `${prefix} showing the proposal's recorded operations.`
}
return `${prefix} no stored preview is available.`
})

function riskLevelClass(riskLevel: Proposal['riskLevel']): string {
const normalized = normalizeProposalRiskLevel(riskLevel)
if (normalized === 'Low') return 'td-risk--low'
Expand Down Expand Up @@ -308,8 +319,7 @@ async function copyTechnicalDetails() {
<!-- Read-only / terminal: stored preview under an explicit banner (#1397) -->
<template v-if="selectedDiffMode === 'stored'">
<span class="td-review-card__diff-banner" role="status" data-testid="review-diff-banner">
{{ reviewStatusLabel(proposal.status) }} · read-only — showing the stored preview from
the original submission.
{{ readOnlyDiffBanner }}
</span>
<!-- diffPreview is creation-time content revisions never update, so a
revised proposal's stored preview — or the recorded-operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ describe('ReviewProposalCard diff presentation (#1397)', () => {
selectedDiff: null,
})

expect(wrapper.find('[data-testid="review-diff-banner"]').exists()).toBe(true)
const banner = wrapper.find('[data-testid="review-diff-banner"]')
expect(banner.exists()).toBe(true)
expect(banner.text()).toContain('no stored preview is available')
expect(banner.text()).not.toContain('stored preview from the original submission')
const storedEmpty = wrapper.find('[data-testid="review-diff-stored-empty"]')
expect(storedEmpty.exists()).toBe(true)
expect(storedEmpty.text()).toContain('No stored preview')
Expand Down Expand Up @@ -224,6 +227,9 @@ describe('ReviewProposalCard diff presentation (#1397)', () => {
expect(wrapper.find('[data-testid="review-diff-stored-ops-note"]').exists()).toBe(true)
const ops = wrapper.find('[data-testid="review-diff-stored-operations"]')
expect(ops.exists()).toBe(true)
const banner = wrapper.find('[data-testid="review-diff-banner"]')
expect(banner.text()).toContain('recorded operations')
expect(banner.text()).not.toContain('stored preview from the original submission')
// Sequence-ordered: CreateCard (seq 0) before MoveCard (seq 1).
expect(ops.text()).toMatch(/1\. CreateCard Card[\s\S]*2\. MoveCard Card/)
expect(ops.text()).not.toContain('card-9')
Expand Down
Loading