mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
fix: auto-open video grid on camera/screenshare and harden CI supply chain (BUG-105, BUG-139)
BUG-105: checkVideoMode now auto-opens the video grid when any video stream (local or remote camera/screenshare) becomes active. Previously tiles were added to a hidden grid container. BUG-139: All GitHub Actions pinned to commit SHAs instead of mutable tags. Tool installs (govulncheck, tauri-typegen, cargo-audit) pinned to specific versions instead of @latest.
This commit is contained in:
+14
-14
@@ -19,9 +19,9 @@ jobs:
|
||||
run:
|
||||
working-directory: Server/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: "1.25"
|
||||
cache-dependency-path: Server/go.sum
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
run: go build -o chatserver.exe -ldflags "-s -w" .
|
||||
|
||||
- name: Go vulnerability check
|
||||
run: go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./...
|
||||
run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4 && govulncheck ./...
|
||||
|
||||
- name: Run tests with race detection and coverage
|
||||
run: go test -race ./... -coverprofile=coverage.out -cover
|
||||
@@ -40,14 +40,14 @@ jobs:
|
||||
|
||||
- name: Upload Go coverage
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: go-coverage
|
||||
path: Server/coverage.out
|
||||
retention-days: 7
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v9
|
||||
uses: golangci/golangci-lint-action@4afd733a84b2f1a21f7c2e8a0e49adb3c0f2dbb6 # v9.0.0
|
||||
with:
|
||||
version: v2.11.3
|
||||
working-directory: Server/
|
||||
@@ -59,9 +59,9 @@ jobs:
|
||||
run:
|
||||
working-directory: Client/tauri-client/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
@@ -93,7 +93,7 @@ jobs:
|
||||
|
||||
- name: Upload client coverage
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: client-coverage
|
||||
path: Client/tauri-client/coverage/
|
||||
@@ -109,21 +109,21 @@ jobs:
|
||||
run:
|
||||
working-directory: Client/tauri-client/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: Client/tauri-client/package-lock.json
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e18c1f174353f26 # stable
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: Rust cache
|
||||
uses: swatinem/rust-cache@v2
|
||||
uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
|
||||
with:
|
||||
workspaces: Client/tauri-client/src-tauri
|
||||
|
||||
@@ -131,7 +131,7 @@ jobs:
|
||||
run: npm ci
|
||||
|
||||
- name: Install tauri-typegen
|
||||
run: cargo install tauri-typegen --quiet
|
||||
run: cargo install tauri-typegen@0.1.3 --quiet
|
||||
|
||||
- name: Generate TypeScript IPC bindings
|
||||
working-directory: Client/tauri-client/
|
||||
@@ -144,7 +144,7 @@ jobs:
|
||||
- name: Security audit (Rust dependencies)
|
||||
working-directory: Client/tauri-client/src-tauri/
|
||||
run: |
|
||||
cargo install cargo-audit --quiet
|
||||
cargo install cargo-audit@0.21.2 --quiet
|
||||
cargo audit
|
||||
|
||||
- name: Build Tauri app
|
||||
|
||||
@@ -107,6 +107,10 @@ export function createVideoModeController(opts: VideoModeControllerOptions): Vid
|
||||
if (!anyVideoOn && videoMode) {
|
||||
showChat();
|
||||
}
|
||||
// BUG-105: Auto-open video grid when any video stream becomes active.
|
||||
if (anyVideoOn && !videoMode) {
|
||||
showVideoGrid();
|
||||
}
|
||||
|
||||
// Manage local self-view tile — only add once, skip if already showing
|
||||
const currentUserId = getCurrentUserId();
|
||||
|
||||
@@ -104,7 +104,7 @@ describe("createVideoModeController", () => {
|
||||
expect(ctrl.isVideoMode()).toBe(false);
|
||||
});
|
||||
|
||||
it("checkVideoMode does NOT auto-switch to video grid when remote has camera", () => {
|
||||
it("checkVideoMode auto-opens video grid when remote has camera (BUG-105)", () => {
|
||||
const users = new Map([[2, { userId: 2, camera: true, screenshare: false, username: "bob" }]]);
|
||||
mockVoiceStoreGetState.mockReturnValue(
|
||||
makeVoiceState({ currentChannelId: 10, voiceUsers: new Map([[10, users]]) }),
|
||||
@@ -118,8 +118,7 @@ describe("createVideoModeController", () => {
|
||||
});
|
||||
ctrl.checkVideoMode();
|
||||
|
||||
// Auto-open was removed — video mode requires manual activation
|
||||
expect(ctrl.isVideoMode()).toBe(false);
|
||||
expect(ctrl.isVideoMode()).toBe(true);
|
||||
});
|
||||
|
||||
it("checkVideoMode auto-closes video grid when no streams remain", () => {
|
||||
@@ -146,7 +145,7 @@ describe("createVideoModeController", () => {
|
||||
expect(slots.messagesSlot.style.display).toBe("");
|
||||
});
|
||||
|
||||
it("checkVideoMode does NOT auto-switch when local camera is on", () => {
|
||||
it("checkVideoMode auto-opens when local camera is on (BUG-105)", () => {
|
||||
const users = new Map([[1, { userId: 1, camera: false, screenshare: false, username: "me" }]]);
|
||||
mockVoiceStoreGetState.mockReturnValue(
|
||||
makeVoiceState({
|
||||
@@ -162,8 +161,7 @@ describe("createVideoModeController", () => {
|
||||
getCurrentUserId: () => 1,
|
||||
});
|
||||
ctrl.checkVideoMode();
|
||||
// Auto-open removed — must be activated manually
|
||||
expect(ctrl.isVideoMode()).toBe(false);
|
||||
expect(ctrl.isVideoMode()).toBe(true);
|
||||
});
|
||||
|
||||
it("adds local self-view tile when local camera is on", () => {
|
||||
@@ -271,7 +269,7 @@ describe("createVideoModeController", () => {
|
||||
expect(slots.videoGridSlot.style.display).toBe("none");
|
||||
});
|
||||
|
||||
it("checkVideoMode does NOT auto-switch when local screenshare is on", () => {
|
||||
it("checkVideoMode auto-opens when local screenshare is on (BUG-105)", () => {
|
||||
const users = new Map([[1, { userId: 1, camera: false, screenshare: false, username: "me" }]]);
|
||||
mockVoiceStoreGetState.mockReturnValue(
|
||||
makeVoiceState({
|
||||
@@ -290,8 +288,7 @@ describe("createVideoModeController", () => {
|
||||
});
|
||||
ctrl.checkVideoMode();
|
||||
|
||||
// Auto-open removed — must be activated manually
|
||||
expect(ctrl.isVideoMode()).toBe(false);
|
||||
expect(ctrl.isVideoMode()).toBe(true);
|
||||
});
|
||||
|
||||
it("adds local screenshare self-view tile when local screenshare is on", () => {
|
||||
@@ -362,7 +359,7 @@ describe("createVideoModeController", () => {
|
||||
expect(vg.removeStream).toHaveBeenCalledWith(1_000_001);
|
||||
});
|
||||
|
||||
it("checkVideoMode does NOT auto-switch when remote has screenshare on", () => {
|
||||
it("checkVideoMode auto-opens when remote has screenshare on (BUG-105)", () => {
|
||||
const users = new Map([
|
||||
[1, { userId: 1, camera: false, screenshare: false, username: "me" }],
|
||||
[2, { userId: 2, camera: false, screenshare: true, username: "bob" }],
|
||||
@@ -378,8 +375,7 @@ describe("createVideoModeController", () => {
|
||||
});
|
||||
ctrl.checkVideoMode();
|
||||
|
||||
// Auto-open removed — must be activated manually
|
||||
expect(ctrl.isVideoMode()).toBe(false);
|
||||
expect(ctrl.isVideoMode()).toBe(true);
|
||||
});
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user