Skip to content

Zorin issue#377

Closed
SahilPanhotra wants to merge 16 commits intowebadderallorg:mainfrom
SahilPanhotra:zorin_issue
Closed

Zorin issue#377
SahilPanhotra wants to merge 16 commits intowebadderallorg:mainfrom
SahilPanhotra:zorin_issue

Conversation

@SahilPanhotra
Copy link
Copy Markdown

@SahilPanhotra SahilPanhotra commented Apr 28, 2026

Pull Request Template

Description

Motivation

Type of Change

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

Related Issue(s)

Screenshots / Video

Screenshot (if applicable):

![Screenshot Description](path/to/screenshot.png)

Video (wherever possible):

<video src="path/to/video.mp4" controls width="600"></video>

Testing Guide

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.

Thank you for contributing!

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Linux/Wayland portal-based screen capture support with automatic capability detection
    • New "Detecting system capabilities" status during startup
    • Portal source selection UI for Linux environments with entire-screen mode option
  • Bug Fixes

    • Improved GPU acceleration defaults for Linux systems
    • Enhanced project file handling with proper extension management
    • Better project overwrite verification logic
  • Localization

    • Updated UI strings in English, Spanish, French, Korean, Dutch, Portuguese (Brazil), and Chinese

SahilPanhotra and others added 16 commits April 27, 2026 18:26
Adds robust D-Bus probing for Wayland ScreenCast portals with fallback timeouts. Fixes UX regression forcing Wayland users to manually select the synthetic portal source. Adds comprehensive JSDoc comments to major functions.
# Conflicts:
#	electron/ipc/project/manager.ts
#	electron/ipc/register/project.ts
Fixed 2 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Fixed 1 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ff353e8-fc50-4a62-9264-01e3db746a49

📥 Commits

Reviewing files that changed from the base of the PR and between 05f6f65 and 6330a7a.

📒 Files selected for processing (66)
  • .gitignore
  • electron/electron-env.d.ts
  • electron/extensions/errorUtils.ts
  • electron/extensions/extensionIpc.ts
  • electron/gpuSwitches.test.ts
  • electron/gpuSwitches.ts
  • electron/ipc/captions/generate.ts
  • electron/ipc/captions/whisper.ts
  • electron/ipc/cursor/bounds.ts
  • electron/ipc/cursor/interaction.ts
  • electron/ipc/cursor/monitor.ts
  • electron/ipc/cursor/telemetry.ts
  • electron/ipc/ffmpeg/binary.ts
  • electron/ipc/paths/binaries.ts
  • electron/ipc/project/manager.test.ts
  • electron/ipc/project/manager.ts
  • electron/ipc/project/session.ts
  • electron/ipc/recording/ffmpeg.ts
  • electron/ipc/recording/mac.ts
  • electron/ipc/recording/windowsFallbacks.test.ts
  • electron/ipc/recording/windowsFallbacks.ts
  • electron/ipc/register/assets.ts
  • electron/ipc/register/captions.ts
  • electron/ipc/register/permissions.ts
  • electron/ipc/register/project.ts
  • electron/ipc/register/settings.ts
  • electron/ipc/register/sources.ts
  • electron/ipc/utils.ts
  • electron/main.ts
  • electron/mediaServer.ts
  • electron/preload.ts
  • scripts/create-release.mjs
  • src/components/launch/LaunchWindow.tsx
  • src/components/ui/accordion.tsx
  • src/components/ui/dialog.tsx
  • src/components/ui/dropdown-menu.tsx
  • src/components/ui/select.tsx
  • src/components/video-editor/ExtensionIcon.tsx
  • src/components/video-editor/ExtensionManager.tsx
  • src/components/video-editor/GifOptionsPanel.tsx
  • src/components/video-editor/KeyboardShortcutsHelp.tsx
  • src/components/video-editor/ProjectBrowserDialog.tsx
  • src/components/video-editor/SettingsPanel.tsx
  • src/components/video-editor/TutorialHelp.tsx
  • src/components/video-editor/VideoEditor.tsx
  • src/components/video-editor/VideoPlayback.tsx
  • src/components/video-editor/videoPlayback/layoutUtils.ts
  • src/components/video-editor/videoPlayback/uploadedCursorAssets.ts
  • src/components/video-editor/videoPlayback/webcamSync.test.ts
  • src/contexts/ThemeContext.tsx
  • src/hooks/recordingMimeType.test.ts
  • src/hooks/recordingMimeType.ts
  • src/hooks/useScreenRecorder.ts
  • src/i18n/locales/en/extensions.json
  • src/i18n/locales/en/launch.json
  • src/i18n/locales/es/launch.json
  • src/i18n/locales/fr/launch.json
  • src/i18n/locales/ko/launch.json
  • src/i18n/locales/nl/launch.json
  • src/i18n/locales/pt-BR/extensions.json
  • src/i18n/locales/pt-BR/launch.json
  • src/i18n/locales/zh-CN/launch.json
  • src/lib/constants.ts
  • src/lib/exporter/forwardFrameSource.ts
  • src/lib/exporter/mediaResource.test.ts
  • src/lib/exporter/mediaResource.ts

📝 Walkthrough

Walkthrough

This PR introduces Linux/Wayland capture capabilities detection via D-Bus probing, refactors extensive IPC module imports and formatting across electron handlers, adds a shared LINUX_PORTAL_SOURCE_ID constant, updates source selection logic to conditionally enable manual or portal-based modes, changes the Linux X11 GPU switch from "egl" to "angle", and adds i18n strings for new UI states.

Changes

Cohort / File(s) Summary
Linux Portal Capabilities
electron/electron-env.d.ts, electron/preload.ts, electron/ipc/register/settings.ts, src/components/launch/LaunchWindow.tsx, src/hooks/useScreenRecorder.ts
New CaptureCapabilities interface exposed via window.electronAPI.getCaptureCapabilities(). Settings handler probes D-Bus for portal support, caches results for 60 seconds, and determines Wayland vs X11 using environment hints. Renderer fetches capabilities at launch and switches UI mode between manual source selection, portal-only selection, and portal source highlighting.
Linux Portal Constant & Source Selection
src/lib/constants.ts, electron/main.ts, src/hooks/useScreenRecorder.ts
Introduces shared LINUX_PORTAL_SOURCE_ID constant ("screen:linux-portal") replacing hardcoded sentinel strings. Display media handler and recording hook updated to reference the constant for portal source matching and persistence logic.
GPU & Graphics
electron/gpuSwitches.ts, electron/gpuSwitches.test.ts
Linux X11 forced GL switch changed from "egl" to "angle" when shouldForceLinuxEgl evaluates true; test expectation updated accordingly.
IPC Module Imports & Formatting
electron/ipc/captions/generate.ts, electron/ipc/captions/whisper.ts, electron/ipc/cursor/bounds.ts, electron/ipc/cursor/interaction.ts, electron/ipc/cursor/monitor.ts, electron/ipc/cursor/telemetry.ts, electron/ipc/ffmpeg/binary.ts, electron/ipc/paths/binaries.ts, electron/ipc/recording/ffmpeg.ts, electron/ipc/recording/mac.ts, electron/ipc/utils.ts, scripts/create-release.mjs
Reorder imports, consolidate type-only imports, adjust function signature formatting into multi-line declarations, and fix trailing newlines. No runtime behavior changes.
Project Manager & Session
electron/ipc/project/manager.ts, electron/ipc/project/session.ts, electron/ipc/project/manager.test.ts
Add escapeRegExp helper and use it to safely construct file-extension-stripping regex in normalizeProjectSaveName, preventing metacharacters in extensions from altering match behavior. ensureNamedProjectSaveDoesNotOverwriteDifferentProject now explicitly permits overwriting when both payloads have matching videoPath. Reformat function signatures and test imports.
Captions & Permission Handlers
electron/ipc/register/captions.ts, electron/ipc/register/permissions.ts, electron/ipc/register/assets.ts
Make whisperExecutablePath optional in captions handler. Reformat IPC endpoint registrations (quote style, indentation, semicolons). Adjust imports and control flow layout without changing endpoint behavior.
Project & Sources Handlers
electron/ipc/register/project.ts, electron/ipc/register/sources.ts
Update normalizeProjectSaveName to remove all known (current + legacy) project extensions via combined regex. Adjust import ordering, reformat handler layout, fix "show-source-highlight" HTML loading and async error return shape. No endpoint behavior changes beyond extension handling.
UI Component Formatting
src/components/ui/accordion.tsx, src/components/ui/dialog.tsx, src/components/ui/dropdown-menu.tsx, src/components/ui/select.tsx, src/components/video-editor/ExtensionIcon.tsx, src/components/video-editor/ExtensionManager.tsx, src/components/video-editor/GifOptionsPanel.tsx, src/components/video-editor/KeyboardShortcutsHelp.tsx, src/components/video-editor/ProjectBrowserDialog.tsx, src/components/video-editor/SettingsPanel.tsx, src/components/video-editor/VideoEditor.tsx, src/components/video-editor/VideoPlayback.tsx, src/components/video-editor/videoPlayback/layoutUtils.ts, src/components/video-editor/videoPlayback/uploadedCursorAssets.ts, src/components/video-editor/videoPlayback/webcamSync.test.ts, src/contexts/ThemeContext.tsx
Reorder imports, reformat JSX/function signatures into multi-line expressions, adjust ternary/boolean logic formatting, update indentation. No rendering logic, behavior, or export signatures changed.
TutorialHelp Component
src/components/video-editor/TutorialHelp.tsx
Expand phosphor icon imports to multi-line, split exported button class strings into multi-line format, reorder toast import, add explicit JSX whitespace ({" "}), reformat dialog/tutorial text rendering and click handlers. No behavior or export signatures changed.
Other Component & Hook Formatting
src/hooks/recordingMimeType.test.ts, src/hooks/recordingMimeType.ts, src/lib/exporter/forwardFrameSource.ts, src/lib/exporter/mediaResource.test.ts, src/lib/exporter/mediaResource.ts, src/i18n/locales/en/extensions.json, src/i18n/locales/pt-BR/extensions.json
Reorder imports, condense filter/ternary expressions to single lines, reformat function signatures, add trailing newlines. No logic or export changes.
Media Server & File Cleanup
electron/mediaServer.ts, electron/extensions/errorUtils.ts, electron/extensions/extensionIpc.ts, .gitignore
Reformat byte-range request handling conditions across multiple lines. Add trailing newlines to error utils. Ignore *.codex files and electron/native/bin/ directory.
Internationalization (i18n)
src/i18n/locales/en/launch.json, src/i18n/locales/es/launch.json, src/i18n/locales/fr/launch.json, src/i18n/locales/ko/launch.json, src/i18n/locales/nl/launch.json, src/i18n/locales/pt-BR/launch.json, src/i18n/locales/zh-CN/launch.json
Add two new UI string keys across all locales: recording.detectingCapabilities (status message) and recording.portalEntireScreen (fullscreen label).

Sequence Diagram

sequenceDiagram
    participant Renderer as Renderer<br/>(LaunchWindow)
    participant Preload as Preload<br/>(contextBridge)
    participant Main as Main Process<br/>(IPC Handler)
    participant System as System<br/>(D-Bus)

    Renderer->>Preload: getCaptureCapabilities()
    activate Preload
    Preload->>Main: ipcRenderer.invoke("get-capture-capabilities")
    deactivate Preload
    
    activate Main
    alt Wayland Detected
        Main->>System: Check for org.freedesktop.portal.ScreenCast<br/>(via gdbus/busctl/dbus-send)
        alt Portal Available
            System-->>Main: Interface exists
            Main->>Main: supportsPortalSourceSelection = true
        else Portal Unavailable
            System-->>Main: Interface not found / timeout
            Main->>Main: supportsPortalSourceSelection = false
        end
        Main->>Main: Cache result (60s TTL)
    else X11/Other
        Main->>Main: supportsManualSourceSelection = true<br/>supportsPortalSourceSelection = false
    end
    Main-->>Preload: CaptureCapabilities
    deactivate Main
    
    activate Preload
    Preload-->>Renderer: Promise<CaptureCapabilities>
    deactivate Preload
    
    activate Renderer
    alt supportsPortalSourceSelection?
        Renderer->>Renderer: UI mode = portal-only<br/>(bypass source picker,<br/>use synthetic portal source)
    else supportsManualSourceSelection?
        Renderer->>Renderer: UI mode = manual sources<br/>(show sources dropdown,<br/>enable manual selection)
    else
        Renderer->>Renderer: Default mode
    end
    Renderer->>Renderer: Render based on capability
    deactivate Renderer
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement, refactor, i18n, linux

Poem

🐰 A rabbit hops through portals new,
Detecting what the system can do—
Wayland whispers, D-Bus calls sing,
Formatting clean on every wing! 🌿✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant