diff --git a/src/pages/activity-feeds/PreviewPanel.tsx b/src/pages/activity-feeds/PreviewPanel.tsx
index f42322c..79e1d49 100644
--- a/src/pages/activity-feeds/PreviewPanel.tsx
+++ b/src/pages/activity-feeds/PreviewPanel.tsx
@@ -29,8 +29,15 @@ export const PreviewPanel: React.FC = () => {
: "https://auditor-master-images.seekright.com/SeekRight/";
const IMAGES_TEST_AUDIT_PREFIX = "https://dashboard-images.seekright.com/SeekRight/";
+ // Linear rectification has no master image; show the open defect's most
+ // recent detection frame (recent_image from the anomaly table) as the
+ // left-side reference instead.
+ const showingRecentImage = !!(isRectActive && anomaly.Algorithm === 'linear' && anomaly.recent_image);
+
let masterImageSrc = '';
- if (anomaly.Frame_Master) {
+ if (showingRecentImage) {
+ masterImageSrc = IMAGES_TEST_AUDIT_PREFIX + anomaly.recent_image;
+ } else if (anomaly.Frame_Master) {
masterImageSrc = IMAGES_AWS_PREFIX + anomaly.Frame_Master;
} else if (!anomaly.Frame_Master && !anomaly.Frame_Test) {
masterImageSrc = '/assets/images/master_and_shift_image_not_available.png';
@@ -58,7 +65,7 @@ export const PreviewPanel: React.FC = () => {
}}
/>
- MASTER IMAGE
+ {showingRecentImage ? 'RECENT IMAGE' : 'MASTER IMAGE'}
diff --git a/src/pages/audit-session/AuditSession.tsx b/src/pages/audit-session/AuditSession.tsx
index 0ad2b3c..921e357 100644
--- a/src/pages/audit-session/AuditSession.tsx
+++ b/src/pages/audit-session/AuditSession.tsx
@@ -3,6 +3,7 @@ import { Box, Typography, Button, Chip, Switch, Dialog, DialogTitle, DialogConte
import { useNavigate, useLocation } from 'react-router-dom';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import { ZoomableImage } from './ZoomableImage';
+import { TEST_IMAGE_PREFIX } from '../../constants/media';
import SearchIcon from '@mui/icons-material/Search';
import { activityFeedsService } from '../../api/activityFeedsService';
import { axiosClient } from '../../api/axiosClient';
@@ -508,8 +509,15 @@ export const AuditSession: React.FC = () => {
let latStr = 'N/A';
let longStr = 'E/A';
+ // Linear rectification records have no master image; on the left, show the
+ // matching open defect's most recent detection frame (recent_image from the
+ // anomaly table, provided by the history query) as a "last seen" reference.
+ const showingRecentImage = !!(isRectActive && currentAnomaly?.Algorithm === 'linear' && currentAnomaly?.recent_image);
+
if (currentAnomaly) {
- if (currentAnomaly.Frame_Master) {
+ if (showingRecentImage) {
+ masterImageSrc = TEST_IMAGE_PREFIX + currentAnomaly.recent_image;
+ } else if (currentAnomaly.Frame_Master) {
masterImageSrc = IMAGES_AWS_PREFIX + currentAnomaly.Frame_Master;
} else if (!currentAnomaly.Frame_Master && !currentAnomaly.Frame_Test) {
masterImageSrc = '/assets/images/master_and_shift_image_not_available.png';
@@ -1627,7 +1635,7 @@ export const AuditSession: React.FC = () => {
{/* Previous Image Pane */}
- MASTER IMAGE
+ {showingRecentImage ? 'RECENT IMAGE' : 'MASTER IMAGE'}
{masterImageSrc ? (
@@ -1784,15 +1792,18 @@ export const AuditSession: React.FC = () => {
{/* Anomaly/Safe Toggle */}
- ANOMALY?
+ {isRectActive ? 'RECTIFIED?' : 'ANOMALY?'}
A / S
+ {/* In rectification mode the verdict is "Rectified / Not Rectified":
+ A (isAnomaly=true) = Rectified (green), S (isAnomaly=false) =
+ Not Rectified (red). In audits mode it's Anomaly / Safe. */}
@@ -2118,11 +2129,11 @@ export const AuditSession: React.FC = () => {
<>
- Anomaly
+ {isRectActive ? 'Rectified' : 'Anomaly'}
- Safe
+ {isRectActive ? 'Not Rectified' : 'Safe'}
@@ -2363,20 +2374,20 @@ export const AuditSession: React.FC = () => {