Skip to content

Store video widget size in redux#828

Merged
Turnlings merged 5 commits into
mainfrom
827-store-video-widget-size-in-redux
Nov 6, 2025
Merged

Store video widget size in redux#828
Turnlings merged 5 commits into
mainfrom
827-store-video-widget-size-in-redux

Conversation

@Turnlings

Copy link
Copy Markdown
Contributor

Use the scale parameter to make video widget size persist between page switches.

Copilot AI review requested due to automatic review settings November 5, 2025 21:27
@Turnlings Turnlings linked an issue Nov 5, 2025 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the video scale state management by moving it from local component state to Redux, enabling the video scale to be persisted and shared across the application.

  • Added videoScale to the Redux state with a default value of 1
  • Created Redux action and selector for managing video scale
  • Updated VideoWidget component to use Redux state instead of local state

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
gcs/src/redux/slices/droneConnectionSlice.js Added videoScale state, action, and selector to the Redux slice
gcs/src/components/dashboard/videoWidget.jsx Replaced local scale state with Redux-based state management

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gcs/src/components/dashboard/videoWidget.jsx
@Turnlings Turnlings requested a review from a team November 5, 2025 21:33
@Turnlings Turnlings changed the title 827 store video widget size in redux Store video widget size in redux Nov 5, 2025
@Turnlings Turnlings requested a review from Copilot November 5, 2025 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

gcs/src/components/dashboard/videoWidget.jsx:86

  • The updateScale function manually sets videoDimensions on lines 83-86, but this logic duplicates the dimension calculation already handled by the useEffect at lines 48-53. Since the useEffect depends on scale and will run automatically when dispatch(setVideoScale(clampedScale)) updates the Redux state, the manual setVideoDimensions call is redundant and could cause race conditions or inconsistent state. Remove lines 78-86 and rely on the useEffect to update dimensions.
    // Recalculate dimensions based on new scale
    const baseWidth = 350
    const newWidth = baseWidth * clampedScale
    const newHeight = Math.round(newWidth / baseAspectRatio)

    setVideoDimensions({
      width: newWidth,
      height: newHeight,
    })

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gcs/src/components/dashboard/videoWidget.jsx Outdated
@Turnlings Turnlings removed the request for review from a team November 5, 2025 23:43
@Turnlings Turnlings requested a review from Copilot November 5, 2025 23:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gcs/src/components/dashboard/videoWidget.jsx
Comment thread gcs/src/components/dashboard/videoWidget.jsx Outdated
Comment thread gcs/src/components/dashboard/videoWidget.jsx Outdated
@Turnlings Turnlings requested a review from Copilot November 6, 2025 00:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Turnlings Turnlings requested a review from a team November 6, 2025 00:10

@1Blademaster 1Blademaster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense logically to me, haven't tested locally yet but approving anyways

@Turnlings Turnlings merged commit 9d6dc9e into main Nov 6, 2025
12 checks passed
@Turnlings Turnlings deleted the 827-store-video-widget-size-in-redux branch November 6, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store video widget size in redux

3 participants