-
Notifications
You must be signed in to change notification settings - Fork 0
Redaction: solid-block default (drop gaussian, warn mosaic) #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1fbea7e
feat: enable blur redaction
My-Denia a9e1183
fix(blur): address review — clamp duplicated blurs, exclusive cycle b…
My-Denia 7512f61
fix(blur): preserve blur type on settings edits (round-2 review)
My-Denia 8310ea7
feat(blur): redaction rework — solid opaque default, drop gaussian, w…
My-Denia 2583c67
fix(blur): hide solid freehand fill while drawing (round-4 review)
My-Denia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
| import { buildDuplicatedAnnotationRegion } from "./timelineClipboardUtils"; | ||
| import type { AnnotationRegion } from "./types"; | ||
|
|
||
| function createBlurRegion(overrides: Partial<AnnotationRegion> = {}): AnnotationRegion { | ||
| return { | ||
| id: "blur-1", | ||
| startMs: 100, | ||
| endMs: 900, | ||
| type: "blur", | ||
| content: "", | ||
| position: { x: 12, y: 18 }, | ||
| size: { width: 32, height: 24 }, | ||
| style: { | ||
| color: "#ffffff", | ||
| backgroundColor: "transparent", | ||
| fontSize: 32, | ||
| fontFamily: "Inter", | ||
| fontWeight: "bold", | ||
| fontStyle: "normal", | ||
| textDecoration: "none", | ||
| textAlign: "center", | ||
| textAnimation: "none", | ||
| }, | ||
| zIndex: 3, | ||
| annotationSource: "auto-caption", | ||
| blurData: { | ||
| type: "mosaic", | ||
| shape: "freehand", | ||
| color: "white", | ||
| intensity: 12, | ||
| blockSize: 8, | ||
| freehandPoints: [ | ||
| { x: 10, y: 20 }, | ||
| { x: 40, y: 30 }, | ||
| { x: 70, y: 80 }, | ||
| ], | ||
| }, | ||
| ...overrides, | ||
| }; | ||
| } | ||
|
|
||
| describe("buildDuplicatedAnnotationRegion", () => { | ||
| it("deep clones duplicated blur data without sharing mutable references", () => { | ||
| const source = createBlurRegion(); | ||
| const duplicate = buildDuplicatedAnnotationRegion(source, "blur-2", 9); | ||
|
|
||
| expect(duplicate.id).toBe("blur-2"); | ||
| expect(duplicate.zIndex).toBe(9); | ||
| expect(duplicate.annotationSource).toBeUndefined(); | ||
| expect(duplicate.position).toEqual({ x: 16, y: 22 }); | ||
|
|
||
| expect(duplicate).not.toBe(source); | ||
| expect(duplicate.position).not.toBe(source.position); | ||
| expect(duplicate.size).not.toBe(source.size); | ||
| expect(duplicate.style).not.toBe(source.style); | ||
| expect(duplicate.blurData).not.toBe(source.blurData); | ||
| expect(duplicate.blurData?.freehandPoints).not.toBe(source.blurData?.freehandPoints); | ||
| expect(duplicate.blurData?.freehandPoints?.[0]).not.toBe(source.blurData?.freehandPoints?.[0]); | ||
| }); | ||
|
|
||
| it("clamps a duplicated full-frame blur to the canvas so no unredacted strip is exposed", () => { | ||
| const fullFrame = createBlurRegion({ | ||
| position: { x: 0, y: 0 }, | ||
| size: { width: 100, height: 100 }, | ||
| }); | ||
| const duplicate = buildDuplicatedAnnotationRegion(fullFrame, "blur-full-2", 4); | ||
| // A bare +4 offset would shift it to {4,4} and clip a strip off the right/bottom edge, | ||
| // briefly exposing unredacted pixels; clamping keeps full coverage at {0,0}. | ||
| expect(duplicate.position).toEqual({ x: 0, y: 0 }); | ||
| expect(duplicate.size).toEqual({ width: 100, height: 100 }); | ||
| }); | ||
|
|
||
| it("clamps a duplicated bottom-right-edge blur back inside the canvas", () => { | ||
| const edge = createBlurRegion({ | ||
| position: { x: 80, y: 85 }, | ||
| size: { width: 20, height: 15 }, | ||
| }); | ||
| const duplicate = buildDuplicatedAnnotationRegion(edge, "blur-edge-2", 4); | ||
| // maxX = 100 - 20 = 80, maxY = 100 - 15 = 85: +4 would exceed both bounds, clamp holds. | ||
| expect(duplicate.position).toEqual({ x: 80, y: 85 }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
| import { BLUR_REGIONS_ENABLED } from "./featureFlags"; | ||
|
|
||
| describe("video editor feature flags", () => { | ||
| it("enables blur region entry points", () => { | ||
| expect(BLUR_REGIONS_ENABLED).toBe(true); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const BLUR_REGIONS_ENABLED = false; | ||
| export const BLUR_REGIONS_ENABLED = true; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.