Skip to content

frontend: components: video-manager: VideoStreamCreationDialog: Fix form state reset#3855

Closed
joaoantoniocardoso wants to merge 1 commit intobluerobotics:masterfrom
joaoantoniocardoso:fix-stream-creation-dialog-reset
Closed

frontend: components: video-manager: VideoStreamCreationDialog: Fix form state reset#3855
joaoantoniocardoso wants to merge 1 commit intobluerobotics:masterfrom
joaoantoniocardoso:fix-stream-creation-dialog-reset

Conversation

@joaoantoniocardoso
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso commented Mar 25, 2026

Summary

  • Fix stale form state when reopening the stream creation/editing dialog by re-syncing all fields from the stream prop via a watcher on the dialog visibility

Test plan

  • Open a stream creation dialog, make changes, close without saving, reopen — form should reflect the current stream state, not stale edits

Summary by Sourcery

Bug Fixes:

  • Ensure the stream creation/edit dialog re-syncs all form fields from the current stream data each time the dialog is shown, preventing stale form values after closing without saving.

…orm state reset

Fix stale form state on dialog reopen by re-syncing all fields from the stream
prop via a watcher.
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 25, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a watcher on the dialog visibility flag to reset the video stream creation form from the current stream data whenever the dialog is opened, preventing stale form state when reopening the dialog.

Sequence diagram for form reset on dialog reopen

sequenceDiagram
  actor User
  participant VideoStreamCreationDialog
  participant Form

  User->>VideoStreamCreationDialog: clickOpenDialog()
  VideoStreamCreationDialog->>VideoStreamCreationDialog: set show = true
  VideoStreamCreationDialog->>VideoStreamCreationDialog: watcher show(newVal)
  alt newVal is true
    VideoStreamCreationDialog->>VideoStreamCreationDialog: resetFormFromStream()
    VideoStreamCreationDialog->>Form: populate fields from stream
  end

  User->>VideoStreamCreationDialog: closeDialogWithoutSaving()
  VideoStreamCreationDialog->>VideoStreamCreationDialog: set show = false

  User->>VideoStreamCreationDialog: clickOpenDialog()
  VideoStreamCreationDialog->>VideoStreamCreationDialog: set show = true
  VideoStreamCreationDialog->>VideoStreamCreationDialog: watcher show(newVal)
  alt newVal is true
    VideoStreamCreationDialog->>VideoStreamCreationDialog: resetFormFromStream()
    VideoStreamCreationDialog->>Form: overwrite stale edits with current stream
  end
Loading

Class diagram for VideoStreamCreationDialog watcher addition

classDiagram
  class VideoStreamCreationDialog {
    +boolean show
    +VForm form
    +resetFormFromStream() void
    +watch_show(newVal boolean) void
  }

  class VForm {
  }

  VideoStreamCreationDialog ..> VForm : uses
Loading

File-Level Changes

Change Details Files
Ensure the video stream creation/edit dialog form state is reset from the current stream data whenever the dialog is opened.
  • Introduced a Vue watcher on the dialog visibility prop/state show.
  • When show becomes true, invoke resetFormFromStream() to re-sync all form fields from the stream prop.
  • Relies on existing resetFormFromStream logic instead of duplicating field-reset behavior.
core/frontend/src/components/video-manager/VideoStreamCreationDialog.vue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@joaoantoniocardoso
Copy link
Member Author

Closing: the watch block already exists on master (merged via an earlier PR).

@joaoantoniocardoso joaoantoniocardoso deleted the fix-stream-creation-dialog-reset branch March 25, 2026 16:26
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