Skip to content

feat: add 'No Webcam' layout preset to hide webcam in final recording#549

Open
Ayusman-Singhal wants to merge 1 commit intosiddharthvaddem:mainfrom
Ayusman-Singhal:feat/no-webcam-layout-preset
Open

feat: add 'No Webcam' layout preset to hide webcam in final recording#549
Ayusman-Singhal wants to merge 1 commit intosiddharthvaddem:mainfrom
Ayusman-Singhal:feat/no-webcam-layout-preset

Conversation

@Ayusman-Singhal
Copy link
Copy Markdown

@Ayusman-Singhal Ayusman-Singhal commented May 7, 2026

Description

Adds a new "No Webcam" layout preset option to the webcam layout dropdown in the video editor. When selected, the webcam feed is completely hidden from both the preview and the exported video the screen recording fills the canvas normally as if no webcam was recorded.

Motivation

Currently, if a user records their screen with a webcam enabled, there is no way to hide the webcam overlay in the final output. The only layout options are "Picture in Picture", "Vertical Stack", and "Dual Frame" all of which display the webcam. Users who change their mind about including the webcam after recording have no option to remove it. This adds that missing option.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

None

Screenshots / Video

Screenshot:

image image

Testing

  1. Open a recording that has webcam enabled
  2. In the editor sidebar, expand the Layout accordion
  3. Open the Preset dropdown "No Webcam" should appear as an option
  4. Select "No Webcam" the webcam should disappear from the preview
  5. Export the video the final output should have no webcam overlay
  6. Save and reload the project the "No Webcam" preset should persist correctly

Files changed:

File Change
src/lib/compositeLayout.ts Added "no-webcam" to type union, preset map, and computeCompositeLayout
src/components/video-editor/projectPersistence.ts Added "no-webcam" normalization case
src/components/video-editor/SettingsPanel.tsx Added option to dropdown filter and label
src/i18n/locales/en/settings.json Added "noWebcam" translation (en only)

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Note: Only the English locale translation has been added. Other locales may need "noWebcam" translations from native speakers.

Summary by CodeRabbit

  • New Features
    • Added a "no-webcam" layout preset option in the video editor settings, allowing users to display content without the webcam overlay.

Adds a new 'No Webcam' option to the webcam layout preset dropdown in the editor. When selected, the webcam feed is completely hidden from both the preview and the exported video, allowing users who recorded with a webcam to exclude it from the final output.

- Add 'no-webcam' to WebcamLayoutPreset type union and preset map

- Handle 'no-webcam' in computeCompositeLayout (returns webcamRect: null)

- Add 'no-webcam' case in project persistence normalization

- Add 'No Webcam' option to the layout preset dropdown in SettingsPanel

- Add 'noWebcam' i18n translation key (en)
Copilot AI review requested due to automatic review settings May 7, 2026 06:58
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

this pr adds a new "no-webcam" layout preset that lets users hide the webcam overlay entirely. changes flow from type definition through preset configuration, layout computation logic, persistence normalization, ui dropdown selection, and i18n strings—basically threading a single new option through the whole system.

Changes

No-Webcam Layout Preset

Layer / File(s) Summary
Type Contract
src/lib/compositeLayout.ts
WebcamLayoutPreset union expanded to include "no-webcam" preset value.
Preset Configuration & Layout Logic
src/lib/compositeLayout.ts
WEBCAM_LAYOUT_PRESET_MAP adds "no-webcam" entry with zero-margin overlay config; computeCompositeLayout adds early branch for layoutPreset === "no-webcam" returning centered screenRect with webcamRect: null.
Project Persistence
src/components/video-editor/projectPersistence.ts
computeNormalizedWebcamLayoutPreset now treats "no-webcam" as a pass-through value (same group as "picture-in-picture").
Settings UI & Labeling
src/components/video-editor/SettingsPanel.tsx
Preset dropdown filtering includes "no-webcam" option; label case mapping uses layout.noWebcam translation key.
Localization
src/i18n/locales/en/settings.json
New noWebcam translation entry added under layout section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • siddharthvaddem

🎬 hide the webcam, show the screen
no-webcam preset keeps things clean
null rect passed down the chain so right
users can flip the switch tonight 🌙

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly describes the main change: adding a 'No Webcam' layout preset feature. It's concise, specific, and accurately reflects the primary functionality across all modified files.
Description check ✅ Passed Description covers all required sections: clear purpose, solid motivation explaining the user problem, correct feature type marked, testing steps provided with screenshots, and files listed. Well-structured and comprehensive.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/compositeLayout.ts`:
- Around line 195-203: The invalid-size guard must run before any
preset-specific early returns so centerRect never receives invalid dimensions:
move the existing size validation (the "invalid-size guard" that checks
canvasSize/screenSize/maxContentSize) to execute before the layoutPreset ===
"no-webcam" branch, and return early if sizes are invalid; ensure the code paths
that call centerRect (e.g., the "no-webcam" branch using centerRect with
canvasSize, screenSize, maxContentSize) only run after the guard passes; keep
the same return shape ({ screenRect, webcamRect: null }) for the "no-webcam"
case.
- Around line 195-203: The "no-webcam" branch currently calls centerRect (which
letterboxes) so the screen may not fill the canvas; replace that with a
cover/fill calculation so the screenRect covers the entire canvas (scale to
cover like CSS background-size: cover) using canvasSize and screenSize (ignore
maxContentSize for letterboxing) and return webcamRect: null; update the branch
that checks layoutPreset === "no-webcam" to compute a full-canvas cover
rectangle instead of calling centerRect, ensuring the returned screenRect spans
the canvas with the correct aspect-preserving scale and crop.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f0bb0350-0c58-49e6-accb-3a33a0a65c2c

📥 Commits

Reviewing files that changed from the base of the PR and between 899504f and ada1f43.

📒 Files selected for processing (4)
  • src/components/video-editor/SettingsPanel.tsx
  • src/components/video-editor/projectPersistence.ts
  • src/i18n/locales/en/settings.json
  • src/lib/compositeLayout.ts

Comment on lines +195 to +203
// "no-webcam" preset: hide the webcam entirely, screen fills the canvas normally
if (layoutPreset === "no-webcam") {
const screenRect = centerRect({
canvasSize,
size: screenSize,
maxSize: maxContentSize,
});
return { screenRect, webcamRect: null };
}
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

move the invalid-size guard above the no-webcam early return

Lowkey risky: at Line 196 you return before the size validation at Line 211, so centerRect can run with invalid dimensions and produce bogus geometry (NaN/Infinity). The guard should happen first for all presets.

Suggested fix
 	const { width: canvasWidth, height: canvasHeight } = canvasSize;
 	const { width: screenWidth, height: screenHeight } = screenSize;
 
+	if (canvasWidth <= 0 || canvasHeight <= 0 || screenWidth <= 0 || screenHeight <= 0) {
+		return null;
+	}
+
 	// "no-webcam" preset: hide the webcam entirely, screen fills the canvas normally
 	if (layoutPreset === "no-webcam") {
 		const screenRect = centerRect({
 			canvasSize,
 			size: screenSize,
 			maxSize: maxContentSize,
 		});
 		return { screenRect, webcamRect: null };
 	}
-
-	if (canvasWidth <= 0 || canvasHeight <= 0 || screenWidth <= 0 || screenHeight <= 0) {
-		return null;
-	}

Also applies to: 211-213

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/compositeLayout.ts` around lines 195 - 203, The invalid-size guard
must run before any preset-specific early returns so centerRect never receives
invalid dimensions: move the existing size validation (the "invalid-size guard"
that checks canvasSize/screenSize/maxContentSize) to execute before the
layoutPreset === "no-webcam" branch, and return early if sizes are invalid;
ensure the code paths that call centerRect (e.g., the "no-webcam" branch using
centerRect with canvasSize, screenSize, maxContentSize) only run after the guard
passes; keep the same return shape ({ screenRect, webcamRect: null }) for the
"no-webcam" case.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

no-webcam branch currently does “contain”, not “fill canvas”

Given the PR goal, this is kinda cursed: Line 197 uses centerRect(...), which letterboxes when aspect ratios differ. That means the screen won’t always fill the canvas in export/preview. If the intent is “fill like no webcam recording,” this branch should return full-canvas with cover behavior.

Suggested fix
 	if (layoutPreset === "no-webcam") {
-		const screenRect = centerRect({
-			canvasSize,
-			size: screenSize,
-			maxSize: maxContentSize,
-		});
-		return { screenRect, webcamRect: null };
+		return {
+			screenRect: { x: 0, y: 0, width: canvasWidth, height: canvasHeight },
+			webcamRect: null,
+			screenCover: true,
+		};
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/compositeLayout.ts` around lines 195 - 203, The "no-webcam" branch
currently calls centerRect (which letterboxes) so the screen may not fill the
canvas; replace that with a cover/fill calculation so the screenRect covers the
entire canvas (scale to cover like CSS background-size: cover) using canvasSize
and screenSize (ignore maxContentSize for letterboxing) and return webcamRect:
null; update the branch that checks layoutPreset === "no-webcam" to compute a
full-canvas cover rectangle instead of calling centerRect, ensuring the returned
screenRect spans the canvas with the correct aspect-preserving scale and crop.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ada1f434f7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"pictureInPicture": "Picture in Picture",
"verticalStack": "Vertical Stack",
"dualFrame": "Dual Frame",
"noWebcam": "No Webcam",
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 Badge Keep locale key structures in sync

Adding this key only to the English settings file leaves layout.noWebcam absent from every other locale. In non-English sessions the new dropdown label falls back to English, and the repository’s scripts/i18n-check.mjs compares the English baseline against all locale files and reports missing keys as errors, so any validation that includes npm run i18n:check will now include this new missing key. Add the key to the other settings.json files as well, even if the temporary value is English.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “No Webcam” layout preset to the video editor so users can hide the recorded webcam feed in both preview and exports while keeping the screen recording laid out normally.

Changes:

  • Extend WebcamLayoutPreset with "no-webcam" and short-circuit layout computation to return webcamRect: null.
  • Persist/normalize the new preset through project load/save.
  • Expose the new preset in the Settings panel dropdown and add an English translation string.

Reviewed changes

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

File Description
src/lib/compositeLayout.ts Adds the "no-webcam" preset and returns a null webcam rect when selected.
src/components/video-editor/projectPersistence.ts Allows "no-webcam" through preset normalization on load.
src/components/video-editor/SettingsPanel.tsx Adds "no-webcam" to the preset dropdown and label mapping.
src/i18n/locales/en/settings.json Adds the layout.noWebcam English string.

Comment on lines +195 to +199
// "no-webcam" preset: hide the webcam entirely, screen fills the canvas normally
if (layoutPreset === "no-webcam") {
const screenRect = centerRect({
canvasSize,
size: screenSize,
Comment on lines +195 to +203
// "no-webcam" preset: hide the webcam entirely, screen fills the canvas normally
if (layoutPreset === "no-webcam") {
const screenRect = centerRect({
canvasSize,
size: screenSize,
maxSize: maxContentSize,
});
return { screenRect, webcamRect: null };
}
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