Skip to content

Report list photos, image lightbox, announcement label (#118) - #22

Merged
byteful merged 8 commits into
mainfrom
feat/admin-report-images
Sep 22, 2026
Merged

byteful merged 8 commits into
mainfrom
feat/admin-report-images

Conversation

@theobong

@theobong theobong commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Resolves civfix/issue-tracker#118

What changed

In the operator dashboard, report rows in the Reports list now lead with the report's own photo (falling back to the category pin when there is no photo), and every report image — the preview photo, the "Photos" gallery, and photo attachments in the report chat — can be clicked to expand in a full-screen viewer with keyboard support. The dashboard also now names the new "Announcement" kind of host message in the broadcast log. It additionally moves onto the newer shared contract the other two PRs ship, which changes nothing an operator can see. Admin only.

Before you start

Verify

Report photos and the image viewer — [Admin]

  1. Open the dashboard and click "Open reports" on the "Reports" tile (or use the "Reports" section directly).
  2. Find the report you submitted with a photo. — Expect: its row's leading square is the photo itself, framed in the report's category color with a thin colored bar along the bottom; the row without a photo still shows the category pin.
  3. Hover the photo square. — Expect: a tooltip naming the category (the category signal is not lost on photo rows).
  4. Click the photo report to open it. Under "Location", hover the photo tagged "Reporter photo". — Expect: the cursor becomes a zoom-in cursor with the tooltip "Expand this photo".
  5. Click it. — Expect: a full-screen viewer opens on a dimmed backdrop with the photo centered; with 2+ images a counter like "1 / 3" and "Previous photo" / "Next photo" arrow buttons appear.
  6. Press the right arrow key, then the left arrow key. — Expect: the photos page through and wrap around at the ends.
  7. Press Tab repeatedly. — Expect: focus cycles only through the viewer's controls, never the page behind.
  8. Press Escape. — Expect: only the viewer closes — you are still on the Reports page, and focus returns to the photo you clicked.
  9. Scroll to "Photos" and click a gallery thumbnail. — Expect: the viewer opens on that image; paging from here also reaches the preview photo.
  10. Scroll to "Chat" and click the photo attachment on a message. — Expect: the viewer opens showing that message's photo(s) only.
  11. Leave the report open for 16+ minutes (or block the image host in DevTools), then open a photo. — Expect: the viewer shows "This photo link expired" with a "Refresh photo" button; clicking it fetches a fresh link and the photo appears without closing the viewer.

Announcements in the broadcast log — [Admin]

  1. Open the "Host messaging" section and find the host who sent the announcement (use "Search host name or handle…" if the list is long).
  2. Click that host's row and look at "Broadcast log". — Expect: the announcement appears as its own row labelled "Announcement", with the "Sent" pill, the event name, the channels, and the recipient/sent counts — no blank label and no missing row.
  3. Look at the host message that host also sent. — Expect: it still reads "Host broadcast" on its own row.
  4. Click "Load more broadcasts" if it is offered. — Expect: older rows append, each with its own kind label.

Regression

Escape behavior on admin pages — [Admin]

  1. On the Reports page with nothing open, press Escape. — Expect: you land back on the Dashboard (unchanged behavior).
  2. Open a photo viewer, press Escape twice. — Expect: first press closes only the viewer; second press goes to the Dashboard.
  3. Click into the "Send a follow-up" text box and press Escape. — Expect: nothing navigates.

Confirm and prompt dialogs across the dashboard — [Admin]

  1. On a report, click "Remove report". — Expect: the confirm dialog opens with focus inside it; Tab stays inside the dialog; "Cancel" returns focus to the button you clicked.
  2. In Moderation, run "Remove content" and continue into its follow-up prompt. — Expect: the prompt's text box is focused immediately, typing works without clicking, Cmd/Ctrl+Enter submits, Enter alone adds a newline.
  3. Spot-check one prompt each in Users and Organizations. — Expect: same focus behavior, no dialog traps you or drops focus to the page.

Reports list paging, filters and search — [Admin]

  1. Click "Load more" at the bottom of the list. — Expect: more rows append, each with the correct photo or pin.
  2. Switch between the "All", "Submitted", "In progress", "Completed" and "Flagged" chips. — Expect: rows re-render correctly, no stale image carried between filters.
  3. Search with "Search title, place, reporter…" for gibberish. — Expect: "Nothing matches" / "Try a different filter or search."

Report detail actions next to the images — [Admin]

  1. With a report open, use "Quick status" to move it to "In progress" and back. — Expect: status changes as before; the photo tile is unaffected.
  2. With the viewer open, click "Refresh photo" after changing the report's status in a second tab. — Expect: the viewer stays open on the same photo.

Video and non-image media — [Admin]

  1. Open a report that has a video attachment. — Expect: the video thumb still opens the raw media in a new tab ("Open full media in a new tab") — no viewer.

Host messaging page around the log — [Admin]

  1. Switch the "All" / "Active" / "Suspended" chips and click through several hosts. — Expect: the "Broadcasts", "Recipients", "Sent" and "Failed" tiles and every log row render as before; no row shows a blank kind.
  2. On a host, run "Suspend messaging" and then "Restore messaging" with a reason. — Expect: the pill flips between "Messaging suspended" and "Messaging active" as before.
  3. Open a host with nothing in the window. — Expect: "No broadcasts logged" / "Nothing has been sent from this host in the selected window."

Jurisdiction rows and Moderation media — [Admin]

  1. Open Jurisdictions and Moderation. — Expect: jurisdiction rows show their pins exactly as before; Moderation's media thumbs render but are not clickable (unchanged).

Older backend tolerance — [Admin]

  1. If checking before the backend PR deploys: open the Reports list and a host's broadcast log. — Expect: every report row shows the category pin as before, the log lists the existing kinds, no errors and no empty list.

Not covered

  • Screen-reader announcement quality of the viewer (dialog semantics are in place; a VoiceOver/NVDA pass was not run).
  • The expired-photo path against real object storage timing was verified by logic and tests, not a 16-minute live wait.
  • The announcement row's counts depend on the real email and push fan-out, which cannot be exercised in this session (no mailer, no device) — the row's label and layout are what this plan checks.

@theobong theobong changed the title Report list photos and image lightbox (#118) Report list photos, image lightbox, announcement label (#118) Sep 17, 2026
@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

Not safe to merge until the outstanding repository requirements are satisfied.

Fix All in Claude CodeFindings

  1. P2 Use design tokens ▶
  2. P2 Remove new code comments ▶
  3. P2 Justify the PR size ▶
Fix with agent prompt
### Issue 1
apps/admin/src/styles/admin.css:2948-3003
The lightbox introduces raw dimensions and literal colors, including `32px`, `#fff`, and several `rgba(...)` values, rather than the existing CSS variables. This violates the frontend styling directive. Replace these values with the appropriate spacing, sizing, color, radius, and typography tokens; this repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
apps/admin/src/components/shared/lightbox.tsx:undefined-128
The new lightbox adds an inline lint-suppression comment, and the new report chat image rendering adds the same kind of comment. This violates the directive that new code contain no comments. Use an implementation or project configuration that does not require new inline comments; this repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 3
apps/admin/src/components/shared/lightbox.tsx:undefined-1
This change exceeds the repository's 400-line pull-request limit, but its description does not include the required `Size:` justification. Add the explicit justification or split the modal accessibility, report-photo viewer, and announcement-label work into smaller changes; this repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (2) · Last reviewed commit: "adopt @civfix/shared 0.55.0"

Comment on lines +2948 to +3003
.lightbox-overlay { background: rgba(26, 23, 20, 0.78); padding: 32px; }
.lightbox {
position: relative;
width: fit-content; max-width: min(1100px, 100%);
min-width: min(320px, 100%); min-height: min(240px, 100%);
display: flex; align-items: center; justify-content: center;
animation: modal-pop 200ms cubic-bezier(0.25, 0.8, 0.3, 1);
}
.lightbox-face {
display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: 8px;
width: min(320px, 100%);
padding: 24px;
text-align: center;
color: #fff;
font-size: 12.5px;
background: rgba(26, 23, 20, 0.55);
border-radius: 12px;
}
.lightbox-face-title { font-weight: 700; font-size: 14px; }
.lightbox-face-sub { color: rgba(255, 255, 255, 0.72); line-height: 1.5; }
.lightbox-face-btn {
margin-top: 4px;
padding: 7px 14px; border-radius: 10px;
font-size: 12px; font-weight: 700;
color: #fff; background: rgba(26, 23, 20, 0.72);
transition: background-color 120ms ease;
}
.lightbox-face-btn:hover { background: rgba(26, 23, 20, 0.9); }
.lightbox-img {
max-width: 100%; max-height: calc(100vh - 64px);
width: auto; height: auto; display: block;
border-radius: 12px;
background: var(--paper-2);
box-shadow: 0 24px 64px rgba(26, 23, 20, 0.45);
}
.lightbox-img.pending { display: none; }
.lightbox-bar {
position: absolute; top: 10px; right: 10px; z-index: 1;
display: flex; align-items: center; gap: 8px;
}
.lightbox-count {
font-size: 10.5px; font-weight: 700; color: #fff;
background: rgba(26, 23, 20, 0.72);
padding: 4px 8px; border-radius: 8px;
}
.lightbox-btn {
width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
display: flex; align-items: center; justify-content: center;
color: #fff; background: rgba(26, 23, 20, 0.72);
transition: background-color 120ms ease;
}
.lightbox-btn:hover { background: rgba(26, 23, 20, 0.9); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Use design tokens

The lightbox introduces raw dimensions and literal colors, including 32px, #fff, and several rgba(...) values, rather than the existing CSS variables. This violates the frontend styling directive. Replace these values with the appropriate spacing, sizing, color, radius, and typography tokens; this repository requirement must be satisfied before merging.

Rule Used: # civfix review rules civfix is a live civic-tech platform that will hold government contracts. Review every PR for correctness, security and performance. Flag real defects with evidence; skip style nits that lint already covers. ## Repos - **... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/admin/src/styles/admin.css
Line: 2948-3003

Comment:
**Use design tokens**

The lightbox introduces raw dimensions and literal colors, including `32px`, `#fff`, and several `rgba(...)` values, rather than the existing CSS variables. This violates the frontend styling directive. Replace these values with the appropriate spacing, sizing, color, radius, and typography tokens; this repository requirement must be satisfied before merging.

**Rule Used:** # civfix review rules  civfix is a live civic-tech platform that will hold government contracts. Review every PR for **correctness, security and performance**. Flag real defects with evidence; skip style nits that lint already covers.  ## Repos  - **... ([source](https://app.greptile.com/civfix/-/custom-context?memory=39a53925-3d93-4c82-980e-27b67393717d))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

</button>
</div>
{status !== "failed" && (
// eslint-disable-next-line @next/next/no-img-element

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Remove new code comments

The new lightbox adds an inline lint-suppression comment, and the new report chat image rendering adds the same kind of comment. This violates the directive that new code contain no comments. Use an implementation or project configuration that does not require new inline comments; this repository requirement must be satisfied before merging.

Rule Used: # civfix review rules civfix is a live civic-tech platform that will hold government contracts. Review every PR for correctness, security and performance. Flag real defects with evidence; skip style nits that lint already covers. ## Repos - **... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/admin/src/components/shared/lightbox.tsx
Line: 128

Comment:
**Remove new code comments**

The new lightbox adds an inline lint-suppression comment, and the new report chat image rendering adds the same kind of comment. This violates the directive that new code contain no comments. Use an implementation or project configuration that does not require new inline comments; this repository requirement must be satisfied before merging.

**Rule Used:** # civfix review rules  civfix is a live civic-tech platform that will hold government contracts. Review every PR for **correctness, security and performance**. Flag real defects with evidence; skip style nits that lint already covers.  ## Repos  - **... ([source](https://app.greptile.com/civfix/-/custom-context?memory=39a53925-3d93-4c82-980e-27b67393717d))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@@ -0,0 +1,177 @@
"use client"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Justify the PR size

This change exceeds the repository's 400-line pull-request limit, but its description does not include the required Size: justification. Add the explicit justification or split the modal accessibility, report-photo viewer, and announcement-label work into smaller changes; this repository requirement must be satisfied before merging.

Rule Used: # civfix review rules civfix is a live civic-tech platform that will hold government contracts. Review every PR for correctness, security and performance. Flag real defects with evidence; skip style nits that lint already covers. ## Repos - **... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/admin/src/components/shared/lightbox.tsx
Line: 1

Comment:
**Justify the PR size**

This change exceeds the repository's 400-line pull-request limit, but its description does not include the required `Size:` justification. Add the explicit justification or split the modal accessibility, report-photo viewer, and announcement-label work into smaller changes; this repository requirement must be satisfied before merging.

**Rule Used:** # civfix review rules  civfix is a live civic-tech platform that will hold government contracts. Review every PR for **correctness, security and performance**. Flag real defects with evidence; skip style nits that lint already covers.  ## Repos  - **... ([source](https://app.greptile.com/civfix/-/custom-context?memory=39a53925-3d93-4c82-980e-27b67393717d))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@byteful
byteful merged commit f806dea into main Sep 22, 2026
2 checks passed
@byteful
byteful deleted the feat/admin-report-images branch September 22, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants