Skip to content

Custom notifications suspend duration UI#23286

Open
smaugfm wants to merge 8 commits into
blakeblackshear:devfrom
smaugfm:dev
Open

Custom notifications suspend duration UI#23286
smaugfm wants to merge 8 commits into
blakeblackshear:devfrom
smaugfm:dev

Conversation

@smaugfm

@smaugfm smaugfm commented May 22, 2026

Copy link
Copy Markdown

Proposed change

Adds a cemera notifications suspension dialog to enter custom suspension time.
Addresses a comment from my rejected PR.

This one is much simpler, only UI changes.
CustomSuspensionDialog itself turned out quiet big because of the validations & defensive programming .

1 2 3 4

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code
  • Documentation Update

For new features

I did search for the existing requests and haven't found anything similar to this. I haven't started a discussion as I would've implemented this feature for my needs anyway, and I might as well suggest a PR.

AI disclosure

  • No AI tools were used in this PR.
  • AI tools were used in this PR. Details below:

AI tool(s) used : Claude Code

How AI was used: code generation, code review, and debugging.

Extent of AI involvement: generated the entire implementation.

Human oversight: Review/manual fixes/iterations of changes over generated code, tested UI manually.

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I can explain every line of code in this PR if asked.
  • UI changes including text have used i18n keys and have been added to the en locale.
  • The code has been formatted using Ruff (ruff format frigate)

@NickM-27 NickM-27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall I think this looks fine, but the radix comment and logic is overcomplicated and I don't think it is needed.

@hawkeye217

Copy link
Copy Markdown
Collaborator

Thanks for the PR, there are a number of issues that would need to be addressed before we would consider merging.

  1. I would suggest dropping the Duration tab entirely. Most apps with "snooze for N" pickers just present clock time, and Frigate already has presets for common durations.
  2. For the "Until" view, you should be using TimezoneAwareCalendar and useFormattedTimestamp rather than rebuilding an entirely separate implementation. Just follow the codebase's existing conventions in CustomTimeSelector.
  3. You should compute totalMinutes at the click, not via useMemo.
  4. The dialog should be triggered from either a sibling button (or the context menu item) so that the Select doesn't need to have a "fake" custom value.
  5. Your AI added far too many comments in the code, as @NickM-27 mentioned, these are unnecessary.
  6. In the i18n changes, use 3 periods (...) rather than a unicode character.

@smaugfm smaugfm requested a review from NickM-27 May 23, 2026 19:20
@smaugfm

smaugfm commented May 23, 2026

Copy link
Copy Markdown
Author

@NickM-27 & @hawkeye217
Thanks for the feedback. Addressed your concerns, please take a look.

Took the liberty of using Dropdown with a style matching Select instead of creating a "sibling" button (not sure what you meant by that, tried creating a button just alongside the Select - looked bad IMO).

Comment on lines +819 to +824
<DropdownMenuTrigger
className={cn(selectTriggerClassName, "w-auto gap-2")}
>
{t("notification.suspendTime.suspend")}
<LuChevronDown className="h-4 w-4 opacity-50" />
</DropdownMenuTrigger>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<DropdownMenuTrigger
className={cn(selectTriggerClassName, "w-auto gap-2")}
>
{t("notification.suspendTime.suspend")}
<LuChevronDown className="h-4 w-4 opacity-50" />
</DropdownMenuTrigger>
<DropdownMenuTrigger asChild>
<Button size="sm" variant="outline" className="flex gap-2">
{t("notification.suspendTime.suspend")}
<LuChevronDown className="h-4 w-4 opacity-50" />
</Button>
</DropdownMenuTrigger>

A dropdown is fine, but just use a <Button> like the rest of the codebase does. No need to modify the select.tsx component for this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { selectTriggerClassName } from "@/components/ui/select";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import { selectTriggerClassName } from "@/components/ui/select";

This line can be deleted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All the changes in this file can be reverted if you use a <Button> as I suggested.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

return (
<div className={cn("w-full", className)}>
<ContextMenu key={camera} onOpenChange={handleOpenChange}>
<ContextMenu key={camera} modal={false} onOpenChange={handleOpenChange}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<ContextMenu key={camera} modal={false} onOpenChange={handleOpenChange}>
<ContextMenu key={camera} onOpenChange={handleOpenChange}>

Your AI shouldn't have added this here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

"initializeCommand": ".devcontainer/initialize.sh",
"postCreateCommand": ".devcontainer/post_create.sh",
"overrideCommand": false,
"remoteUser": "vscode",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this should be removed, especially not in this PR

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, accidentally committed changes for IntelliJ IDEA to work with the dev container. Removed

Comment thread .devcontainer/post_create.sh Outdated
sudo chown -R "$(id -u):$(id -g)" /media/frigate
SUDO=""
if [[ $EUID -ne 0 ]]; then
SUDO="sudo"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above, unrelated change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, accidentally committed changes for IntelliJ IDEA to work with the dev container. Removed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like this still needs to be removed from the commit

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.

3 participants