Skip to content

UI cleanup (part 3)#1211

Merged
annavik merged 9 commits intomainfrom
chore/ui-cleanup
Apr 7, 2026
Merged

UI cleanup (part 3)#1211
annavik merged 9 commits intomainfrom
chore/ui-cleanup

Conversation

@annavik
Copy link
Copy Markdown
Member

@annavik annavik commented Apr 7, 2026

Summary of changes

  • Add info messages to capture set and export forms
  • Improve rendering of single capture sessions
  • Make sure session details info will not overflow
  • Return latest jobs instead of oldest jobs (for table views)
  • Reset upload state on dialog close (clear errors and success state)
  • Make full image box clickable when uploading captures
  • Re-render entity picker on value change (to make sure we present correct default values)
  • Tweak tooltips related to jobs

Screenshots

Screenshot 2026-04-07 at 13 03 00 Screenshot 2026-04-07 at 13 03 08 Screenshot 2026-04-07 at 13 03 17 Screenshot 2026-04-07 at 13 13 27 Screenshot 2026-04-07 at 13 02 16 Screenshot 2026-04-07 at 13 02 04

Summary by CodeRabbit

  • New Features

    • Added FormMessage for informational/tip text and surfaced guidance in capture-set and export forms
  • Bug Fixes

    • Current job selection now favors the most recently updated job
    • Timestamp slider hides labels when start and end are identical
  • Style

    • Improved image upload spacing, file input sizing, pipeline name truncation, and playback overflow handling
    • Updated job-status tooltip wording and removed redundant status tooltip in filters
  • Refactor

    • Upload flow now resets state when dialogs open

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit 266f1b5
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/69d4ee731f2f660008424447
😎 Deploy Preview https://deploy-preview-1211--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 74 (🔴 down 6 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for antenna-ssec ready!

Name Link
🔨 Latest commit 266f1b5
🔍 Latest deploy log https://app.netlify.com/projects/antenna-ssec/deploys/69d4ee736c7e920007596410
😎 Deploy Preview https://deploy-preview-1211--antenna-ssec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: afb64e85-c098-4529-99ba-8dedfa85d675

📥 Commits

Reviewing files that changed from the base of the PR and between b5c0691 and 266f1b5.

📒 Files selected for processing (3)
  • ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx
  • ui/src/pages/session-details/playback/session-captures-slider/session-captures-slider.tsx
  • ui/src/utils/language.ts
✅ Files skipped from review due to trivial changes (1)
  • ui/src/pages/session-details/playback/session-captures-slider/session-captures-slider.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx

📝 Walkthrough

Walkthrough

Adds a FormMessage component and SCSS classes, reverses several model job-selection sort comparators, injects form guidance messages, resets upload hook state when dialogs open, tweaks select/value handling and various layout/spacing/styles, and updates translation keys and tooltips. (50 words)

Changes

Cohort / File(s) Summary
Form layout & styles
ui/src/components/form/layout/layout.module.scss, ui/src/components/form/layout/layout.tsx
Added .formMessage and .intro SCSS classes and exported FormMessage; FormError now renders intro and message as separate spans; .formError typography changed to paragraph-small.
Model currentJob comparators
ui/src/data-services/models/capture-details.ts, ui/src/data-services/models/capture-set.ts, ui/src/data-services/models/deployment.ts
Reversed comparator sign (time2 - time1) used to sort jobs; selection now chooses the opposite element order.
Forms: added guidance messages
ui/src/pages/project/entities/details-form/capture-set-details-form.tsx, ui/src/pages/project/entities/details-form/export-details-form.tsx
Imported and rendered FormMessage in forms to present intro/tip messages via new translation keys.
Upload captures reset flow
ui/src/data-services/hooks/captures/useUploadCaptures.ts, ui/src/pages/captures/upload-images-dialog/upload-images-dialog.tsx
Hook now exposes reset() that clears local results; dialog calls reset on open-state changes to clear hook state.
File/image upload spacing & add-button
ui/src/design-system/components/file-input/file-input.module.scss, ui/src/design-system/components/image-upload/image-upload.tsx, ui/src/components/header/user-info-dialog/user-info-image-upload/user-info-image-upload.tsx, ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx
Added mb-2 spacing to image containers; file-input container set to 100% width/height; replaced a UI-kit Button with a native <button> whose inner wrapper uses buttonVariants(...) for styling.
EntityPicker value/keying
ui/src/design-system/components/select/entity-picker.tsx
Renamed incoming value to _value, derived validated local value (fallback ''), passed value to Select.Root, and added key={value} to force remount when value changes.
Table tooltips & filter removal
ui/src/pages/deployments/deployment-columns.tsx, ui/src/pages/jobs/jobs-columns.tsx, ui/src/pages/project/capture-sets/capture-set-columns.tsx, ui/src/utils/useFilters.ts
Replaced TOOLTIP_STATUS usages with TOOLTIP_LATEST_JOB_STATUS (with type interpolation) where applied; removed a tooltip from the status filter and removed tooltip from jobs column.
Playback layout, slider, and safety
ui/src/pages/session-details/playback/capture-details/capture-details.module.scss, ui/src/pages/session-details/playback/capture-details/capture-details.tsx, ui/src/pages/session-details/playback/session-captures-slider/session-captures-slider.tsx, ui/src/pages/session-details/playback/utils.tsx, ui/src/pages/session-details/playback/playback.module.scss
Changed .jobControls to flex-wrap, hid overflow in .infoWrapper, made PipelinesPicker value truncate, conditionally pass slider labels when start≠end, and guarded dateToValue against zero-length intervals.
Session details cleanup
ui/src/pages/session-details/session-details.tsx
Removed FetchInfo usage and isFetching destructuring; reformatted useSessionDetails call.
Language/i18n
ui/src/utils/language.ts
Added MESSAGE_CAPTURE_SET_FORM_INTRO, MESSAGE_CAPTURE_SET_TIP, MESSAGE_EXPORT_TIP, TOOLTIP_LATEST_JOB_STATUS, TIP; removed TOOLTIP_STATUS; updated English strings.
Misc styling tweaks
assorted small components and styles (see diff)
Minor CSS/spacing adjustments (overflow-x hidden, spacing, removal of grid-specific rules).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

next up!

Suggested reviewers

  • mihow

Poem

I hopped through styles, strings, and code,
Placed gentle tips along the road,
Jobs sorted fresh, uploads reset on cue,
Trims and spacing snug and new,
A rabbit's patch of tidy view. 🐇✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides a bullet-point summary of changes and includes screenshots, but lacks detailed explanations of the implementation approach, testing instructions, potential side effects, and deployment notes required by the template. Add a 'Detailed Description' section explaining the implementation, 'How to Test' section with testing instructions, and 'Deployment Notes' if applicable. Complete or verify the checklist items.
Title check ❓ Inconclusive The title 'UI cleanup (part 3)' is vague and generic, using non-descriptive terms that don't convey the specific changes made in the changeset. Consider a more specific title that highlights a primary change, e.g., 'Add form messages and improve job rendering' or 'Fix job ordering and form messaging'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ui-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (2)
ui/src/design-system/components/select/entity-picker.tsx (1)

19-26: The key={value} pattern causes excessive remounts on every selection.

The current implementation forces a remount of the Select component whenever value changes—including when the user picks a new valid entity, not just when entities finish loading or validity status flips. This leads to unnecessary React reconciliation and could disrupt user interaction (e.g., dropdown closes mid-interaction, focus lost).

If the goal is to force a re-render when the resolved value's validity changes (e.g., transitioning from '' to a valid ID after entities load), consider keying on the validity state rather than the value itself:

♻️ Suggested fix: key on validity transition, not every value
-  const value = entities.some((e) => e.id === _value) ? _value : ''
+  const isValueValid = entities.some((e) => e.id === _value)
+  const value = isValueValid ? _value : ''

   return (
     <Select.Root
-      key={value}
+      key={`${isLoading}-${isValueValid}`}
       disabled={isLoading || entities.length === 0}
       onValueChange={onValueChange}
       value={value}
     >

This keys on whether entities are still loading and whether the current value is valid, triggering remounts only when: (a) loading completes, or (b) the value transitions from valid to invalid or vice versa—rather than on every user selection.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/src/design-system/components/select/entity-picker.tsx` around lines 19 -
26, The Select.Root is being keyed by the selected value (value) which causes a
full remount on every selection; change the key to reflect only the
validity/loading transition instead (e.g., derive a boolean like isValid =
entities.some(e => e.id === _value) and use a key based on isLoading and
isValid) so the component only remounts when loading finishes or validity flips;
update the key usage where Select.Root is rendered and ensure you reference the
existing symbols (_value, entities, isLoading, value, Select.Root) when
implementing the new key.
ui/src/pages/captures/upload-images-dialog/upload-images-dialog.tsx (1)

64-70: Consider adding resetHook to the dependency array or wrapping it with useCallback.

The useEffect uses resetHook but doesn't include it in the dependency array. While this works for the intended use case (resetting on isOpen change), it may trigger ESLint's react-hooks/exhaustive-deps warning.

Since resetHook is recreated on each render in useUploadCaptures, adding it to deps could cause extra effect runs. If you want to suppress the lint warning while keeping current behavior, consider either:

  1. Wrapping the reset function in useCallback within useUploadCaptures
  2. Adding an ESLint disable comment if the current behavior is intentional
Option: Stabilize reset with useCallback in useUploadCaptures.ts
// In useUploadCaptures.ts
+import { useCallback, useState } from 'react'
-import { useState } from 'react'

// ...

+const resetFn = useCallback(() => {
+  setResults([])
+  reset()
+}, [reset])

return {
  // ...
- reset: () => {
-   setResults([])
-   reset()
- },
+ reset: resetFn,
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/src/pages/captures/upload-images-dialog/upload-images-dialog.tsx` around
lines 64 - 70, The effect in upload-images-dialog.tsx calls resetHook but omits
it from the dependency array, which triggers exhaustives-deps warnings; fix this
by stabilizing resetHook in the provider hook (wrap the reset function in
useCallback inside useUploadCaptures) so its identity is stable and then add
resetHook to the useEffect deps in upload-images-dialog.tsx (or, if the current
behavior is intentionally tied only to isOpen, add an inline ESLint disable
comment on that useEffect). Reference resetHook, useEffect in
upload-images-dialog.tsx and the reset function inside useUploadCaptures when
making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/src/components/form/layout/layout.module.scss`:
- Around line 60-63: The SCSS has an argumentless mixin called with parentheses
and a missing blank line before a declaration: replace the call "@include
paragraph-small();" with the argumentless form "@include paragraph-small" in the
.formMessage block (and the other occurrence), and add a blank line before the
"padding: 8px 16px;" declaration so there is an empty line before that property.

In
`@ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx`:
- Around line 72-85: The button rendered in SelectImagesSection (the <button>
that uses onClick, buttonVariants and contains <PlusIcon>) needs an explicit
type attribute to avoid defaulting to submit; update that element to include
type="button" so it won't trigger parent form submissions when clicked.

In
`@ui/src/pages/session-details/playback/session-captures-slider/session-captures-slider.tsx`:
- Line 25: The showLabels computation dereferences session.endDate before the
early-return null guard, causing a crash when endDate is missing; move the const
showLabels = session.startDate.getTime() !== session.endDate.getTime() so it
runs after the existing endDate guard (or change it to a safe check using
session.endDate?.getTime()), updating the symbol showLabels in
session-captures-slider.tsx and keeping the early return logic intact.
- Around line 27-31: The effect in useEffect that computes
setValue(dateToValue({ date: activeCapture.date, startDate, endDate })) only
lists activeCapture as a dependency, causing stale values when session bounds
change; modify the dependency array for that effect to include startDate and
endDate (and any stable helpers like dateToValue or setValue if they are not
stable) so the effect re-runs whenever activeCapture, startDate, or endDate
change.

In `@ui/src/utils/language.ts`:
- Around line 619-621: Update the tooltip strings to correct grammar and tighten
wording: change the standalone tooltip (the first string) to use "Examples of
such tasks include processing captures, syncing captures, and generating
exports." and update STRING.TOOLTIP_LATEST_JOB_STATUS to a tighter sentence such
as "A job is a background task that takes time to complete; this shows the
status of the latest job related to each {{type}}. Hover the status label for
details." Locate and update the two relevant constants (the standalone tooltip
string and STRING.TOOLTIP_LATEST_JOB_STATUS) to these improved phrasings.

---

Nitpick comments:
In `@ui/src/design-system/components/select/entity-picker.tsx`:
- Around line 19-26: The Select.Root is being keyed by the selected value
(value) which causes a full remount on every selection; change the key to
reflect only the validity/loading transition instead (e.g., derive a boolean
like isValid = entities.some(e => e.id === _value) and use a key based on
isLoading and isValid) so the component only remounts when loading finishes or
validity flips; update the key usage where Select.Root is rendered and ensure
you reference the existing symbols (_value, entities, isLoading, value,
Select.Root) when implementing the new key.

In `@ui/src/pages/captures/upload-images-dialog/upload-images-dialog.tsx`:
- Around line 64-70: The effect in upload-images-dialog.tsx calls resetHook but
omits it from the dependency array, which triggers exhaustives-deps warnings;
fix this by stabilizing resetHook in the provider hook (wrap the reset function
in useCallback inside useUploadCaptures) so its identity is stable and then add
resetHook to the useEffect deps in upload-images-dialog.tsx (or, if the current
behavior is intentionally tied only to isOpen, add an inline ESLint disable
comment on that useEffect). Reference resetHook, useEffect in
upload-images-dialog.tsx and the reset function inside useUploadCaptures when
making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db545678-b323-472c-9a06-f7a4f6341cb6

📥 Commits

Reviewing files that changed from the base of the PR and between 67d8b4c and 667b9b7.

📒 Files selected for processing (25)
  • ui/src/components/form/layout/layout.module.scss
  • ui/src/components/form/layout/layout.tsx
  • ui/src/components/header/user-info-dialog/user-info-image-upload/user-info-image-upload.tsx
  • ui/src/data-services/hooks/captures/useUploadCaptures.ts
  • ui/src/data-services/models/capture-details.ts
  • ui/src/data-services/models/capture-set.ts
  • ui/src/data-services/models/deployment.ts
  • ui/src/design-system/components/file-input/file-input.module.scss
  • ui/src/design-system/components/image-upload/image-upload.tsx
  • ui/src/design-system/components/select/entity-picker.tsx
  • ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx
  • ui/src/pages/captures/upload-images-dialog/upload-images-dialog.tsx
  • ui/src/pages/deployments/deployment-columns.tsx
  • ui/src/pages/jobs/jobs-columns.tsx
  • ui/src/pages/project/capture-sets/capture-set-columns.tsx
  • ui/src/pages/project/entities/details-form/capture-set-details-form.tsx
  • ui/src/pages/project/entities/details-form/export-details-form.tsx
  • ui/src/pages/session-details/playback/capture-details/capture-details.module.scss
  • ui/src/pages/session-details/playback/capture-details/capture-details.tsx
  • ui/src/pages/session-details/playback/playback.module.scss
  • ui/src/pages/session-details/playback/session-captures-slider/session-captures-slider.tsx
  • ui/src/pages/session-details/playback/utils.tsx
  • ui/src/pages/session-details/session-details.tsx
  • ui/src/utils/language.ts
  • ui/src/utils/useFilters.ts
💤 Files with no reviewable changes (2)
  • ui/src/utils/useFilters.ts
  • ui/src/pages/jobs/jobs-columns.tsx

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/src/utils/language.ts`:
- Line 506: Update the UI tip string in ui/src/utils/language.ts (the
capture-set help text) to improve grammar and readability: replace 'To define a
capture set for all captures, use method "Full" without filters set.' with a
tighter variant such as 'To define a capture set for all captures, use the
"Full" method with no filters.' so it reads naturally in the UI; ensure you
update the same string literal used by the capture-set help function/constant in
that file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 008e533e-edab-4f1d-ba4f-1a0f84cf2694

📥 Commits

Reviewing files that changed from the base of the PR and between 667b9b7 and b5c0691.

📒 Files selected for processing (3)
  • ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx
  • ui/src/pages/session-details/playback/session-captures-slider/session-captures-slider.tsx
  • ui/src/utils/language.ts
✅ Files skipped from review due to trivial changes (1)
  • ui/src/pages/session-details/playback/session-captures-slider/session-captures-slider.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx

@annavik annavik force-pushed the chore/ui-cleanup branch from b5c0691 to 266f1b5 Compare April 7, 2026 11:45
@annavik annavik merged commit a341dbf into main Apr 7, 2026
7 checks passed
@annavik annavik deleted the chore/ui-cleanup branch April 7, 2026 12:51
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.

1 participant