fix(window): repair two regressions from the audit remediation (#97) - #99
Merged
Conversation
FrameApply.changed๋ 'Undo๋ฅผ ๊ธฐ๋กํ ์ง'๋ฅผ ๋ฌป๋๋ฐ reached์ฉ ๊ด๋ํ ํ์ฉ์ค์ฐจ(origin 2ptยท size 8pt)๋ฅผ ์ฐ๊ณ ์์๋ค. ์ฐ๊ธฐ ์ฌ๋ถ๋ changeEpsilon(0.5pt)์ผ๋ก ์ ํ๋ฏ๋ก 0.5~8pt ๊ตฌ๊ฐ์์ ๋ ํ์ ์ด ์ด๊ธ๋, ์ฐฝ์ ์ค์ ๋ก ๋ฐ๋์๋๋ฐ undo๊ฐ ๊ธฐ๋ก๋์ง ์์๋ค. ๊ทธ๋ฌ๋ฉด ์ง์ ๋ช ๋ น์ undo ํญ๋ชฉ์ด ์ด์๋จ์ Undo ์ ์ฐฝ์ด ํ์ฐธ ์ frame์ผ๋ก ํ๋ค. changed๊ฐ ์ฐ๊ธฐ์ ๋์ผํ changeEpsilon์ ์ฐ๋๋ก ํด '์ธ ๋งํผ ๋ฌ๋ผ์ก์ผ๋ฉด ๋ณํ ๊ฒ' ๋ถ๋ณ์์ ๋ณต์ํ๋ค. reached๋ '์ฑ์ด ๋ชฉํ์ ๋๋ฌํ๋'๋ผ๋ ๋ค๋ฅธ ์ง๋ฌธ์ด๋ฏ๋ก ๊ด๋ํ ๊ฐ์ ์ ์งํ๋ค. ์ํฅ ๋ฒ์(์์ ์ ์ค์): 7๊ฐ ๋ช ๋ น 384์กฐํฉ โ ์๋ ์ถ์ 100pt ํํ ๊ตฌ๊ฐ, ์ ๋ ๋ฐฐ์น, ์ด๋ ํด๋จํ ๊ตฌ๊ฐ. ์์ ํ ๋์ผ ์ค์์์ ๋ถ์ผ์น 0. b7692e5(#97)์์ ๋ค์ด์จ ํ๊ท.
anchoredOrigin์ .right/.bottom ๊ฒฝ๋ก์ ์์ ์์ญ ํด๋จํ๊ฐ ์์๋ค. M-4 ์ด์ ์๋ ์๋ ์ถ์๋ workAreaEdges(ํด๋จํ ์์) ๊ฒฝ๋ก๋ฅผ ํ์ผ๋ฏ๋ก, ๋ช ์์ anchor๋ฅผ ๋์ ํ๋ฉฐ ๋ณดํธ๋ฅผ ์์ ํ๊ท๋ค. ์ต์ํญ์ด ํฐ ์ ์ฝ ์ฑ์ ํ๋ฉด ์ผ์ชฝ ๊ทผ์ฒ์์ ์ฐ์ธก ์ต์ปค๋ก ์ถ์ํ๋ฉด ๊ณ ์ ๋ชจ์๋ฆฌ๋ฅผ ์งํค๋ ค๋ค ์ฐฝ์ด ์์ ์์ญ ๋ฐ์ผ๋ก ๋ฐ๋ ธ๋ค(์: target.maxX=350, ์ฑ ์ค์ ํญ 800 โ x=-450). ๋ actualSize์ ์ ํ์ฑ์ ๊ฒ์ฌํ์ง ์์, ์ฑ์ด NaN/๋ฌดํ ํฌ๊ธฐ๋ฅผ ๋ณด๊ณ ํ๋ฉด NaN origin์ด ๊ทธ๋๋ก AX ์ฐ๊ธฐ๋ก ํ๋ฌ๊ฐ๋ค. ๋น์ ์ ํฌ๊ธฐ๋ฉด ์ต์ปค ๋ณด์ ์ ํฌ๊ธฐํ๊ณ ๋ชฉํ origin์ ์ด๋ค. ๋ ๋ค b7692e5(#97)์์ ๋ค์ด์จ ํ๊ท. ํ๊ท ํ ์คํธ 3๊ฑด ์ถ๊ฐ(ํด๋จํ ์ข/ํ, NaN ํด๋ฐฑ).
โฆependent ๋ฆฌ๋ทฐ์์ ์ถ๊ฐ๋ก ๋๋ฌ๋ 3๊ฑด. ์์ ๋ ํ๊ท์ ๊ฐ์ ๊ณ์ด(ํ์ฉ์ค์ฐจยท๋น๊ต์ ์ค๊ณ)์ด๋ค. 1) Writer์ readFrame์ด ๋น์ ์ frame์ ๊ฑฐ๋ฅด์ง ์์, NaN achieved๊ฐ Executor๋ก ํ๋ฌ๊ฐ FrameApply.changed์์ 'true'(NaN ๋น๊ต๋ ์ ๋ถ false โ ๋ค๋ฆ์ผ๋ก ํ์ )๊ฐ ๋๊ณ **ํ์ undo ํญ๋ชฉ**์ด ๋ฉ์ฉกํ ์ง์ ํญ๋ชฉ์ ๋ฎ์๋ค. readFrame์์ isUsableFrame์ผ๋ก ์ฐจ๋จํ๋ค. 2) NSScreen.bestMatch์ ์์ฐจ ๋น๊ต์๊ฐ ๋น์ถ์ด์ ์ด์๋ค. ๋๋ฅ ๋ก ์ด๊ธด ํ๋ฉด์ ๋ ์์ ๋ฉด์ ์ด ๊ธฐ์ค(bestArea)์ ๋ฎ์ถฐ ์ดํ ํ๋ณด์ ๋ฌธํฑ์ด ๋ด๋ ค๊ฐ๊ณ , ์ด๊ฑฐ ์์์ ๋ฐ๋ผ ์ต๋ ๋ฉด์ ์ด ์๋ ํ๋ฉด์ด ๋ฝํ ์ ์์๋ค(L-1์ด ์์ ๋ ค๋ ์์ ์์กด์ฑ). ์ต๋ ๋ฉด์ ์ ๋จผ์ ํ์ ํ ๋ค ๊ทธ ๋๋ฅ ์งํฉ์์๋ง ์ฐฝ ์ค์ฌ ํฌํจ โ ์์ displayID๋ก ๊ณ ๋ฅด๋ 2-ํจ์ค๋ก ๋ฐ๊พผ๋ค. 3) ๊ฐ์ ํจํด์ด selectAdjacentIndex์๋ ์์๋ค. perpendicular ๋น๊ต์ ๋ฐ๋๋ฐด๋๋ฅผ ์ฐ๋ฉด [1.2,0.8,0.4,0.0]์์ ์ต์๊ฐ ์๋ 0.4๊ฐ ๋ฝํ๊ณ ์์๋ฅผ ๋ค์ง์ผ๋ฉด ๊ฒฐ๊ณผ๊ฐ ๋ฌ๋ผ์ก๋ค. ๋น๊ต์์ ๋ฐ๋๋ฐด๋๋ฅผ ๋นผ ์ฐธ ์ต์๊ฐ์ ๊ณ ๋ฅด๊ฒ ํ๋ค(์ ํ ๋๋ฅ ๋ง ๋จผ์ ๋์จ ์ธ๋ฑ์ค). ์ญ์ ๋ tiebreak๋ฅผ ์ฌ์ ํ ์ฝ์ํ๋ ํค๋ ์ฃผ์๋ ์ ์ . ํ๊ท ํ ์คํธ 2๊ฑด ์ถ๊ฐ(์ฌ๋ค๋ฆฌ ์ ยท์ญ์). 194 checks.
This was referenced Jul 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
#97 ์ฌํ ๋ฆฌ๋ทฐ์์ ์ ๊ฐ ๊ทธ PR๋ก ๋์ด๋ค์ธ ํ๊ท 2๊ฑด์ ์ฐพ์ ๊ณ ์น๋ค. ๋ ๋ค probe๋ก ์ฌํํ๊ณ ํ๊ท ํ ์คํธ๋ฅผ ๋ถ์๋ค.
1. ์์ ๋ณ๊ฒฝ์์ Undo๊ฐ ์์ค๋จ (
3f7b290)FrameApply.changed๋ "Undo๋ฅผ ๊ธฐ๋กํ ์ง"๋ฅผ ๋ฌป๋๋ฐ,reached์ฉ ๊ด๋ํ ํ์ฉ์ค์ฐจ(origin 2ptยทsize 8pt)๋ฅผ ์ฌ์ฌ์ฉํ๊ณ ์์๋ค. ์ ์ ์ฐ๊ธฐ ์ฌ๋ถ๋changeEpsilon(0.5pt) ์ผ๋ก ์ ํ๋ฏ๋ก 0.5~8pt ๊ตฌ๊ฐ์์ ๋ ํ์ ์ด ์ด๊ธ๋ฌ๋ค โ ์ฐฝ์ ์ค์ ๋ก ๋ฐ๋๋๋ฐ undo๋ ๊ธฐ๋ก๋์ง ์์๋ค.๋ ๋์ ๊ฑด ๋จ์ํ "๋๋๋ฆด ๊ฒ ์์"์ด ์๋๋ผ๋ ์ ์ด๋ค: ๊ธฐ๋ก์ ๊ฑด๋๋ฐ๋ฉด ์ง์ ๋ช ๋ น์ undo ํญ๋ชฉ์ด ์ด์๋จ์, ์์ ์กฐ์ ํ Undo๋ฅผ ๋๋ฅด๋ฉด ์ฐฝ์ด ํ์ฐธ ์ frame์ผ๋ก ํ๋ค.
์ฌํ ์ค์ (์์ ์ โ ํ):
โ
changed๊ฐ ์ฐ๊ธฐ์ ๊ฐ์changeEpsilon์ ์ฐ๋๋ก ํด "์ธ ๋งํผ ๋ฌ๋ผ์ก์ผ๋ฉด ๋ณํ ๊ฒ" ๋ถ๋ณ์์ ๋ณต์.reached๋ "์ฑ์ด ๋ชฉํ์ ๋๋ฌํ๋"๋ผ๋ ๋ค๋ฅธ ์ง๋ฌธ์ด๋ฏ๋ก ๊ด๋ํ ๊ฐ ์ ์ง.2. ์ต์ปค origin ํด๋จํ ๋๋ฝ + ๋น์ ์ ํฌ๊ธฐ ์ ํ (
2a374ef)anchoredOrigin์.right/.bottom์ ์์ ์์ญ ํด๋จํ๊ฐ ์์๋ค. M-4 ์ด์ ์ ์๋ ์ถ์๋workAreaEdges(ํด๋จํ ์์) ๊ฒฝ๋ก๋ฅผ ํ์ผ๋ฏ๋ก, ๋ช ์์ anchor๋ฅผ ๋์ ํ๋ฉฐ ๋ณดํธ๋ฅผ ์์ ํ๊ท๋ค.์ต์ํญ์ด ํฐ ์ ์ฝ ์ฑ์ ํ๋ฉด ์ผ์ชฝ ๊ทผ์ฒ์์ ์ฐ์ธก ์ต์ปค๋ก ์ถ์ํ๋ฉด ์ฐฝ์ด ํ๋ฉด ๋ฐ์ผ๋ก ๋ฐ๋ ธ๋ค. ํจ๊ป,
actualSize์ ํ์ฑ์ ๊ฒ์ฌํ์ง ์์ ์ฑ์ด NaN ํฌ๊ธฐ๋ฅผ ๋ณด๊ณ ํ๋ฉด NaN origin์ด ๊ทธ๋๋ก AX ์ฐ๊ธฐ๋ก ํ๋ฌ๊ฐ๋ค(๋ณด์ ๋ฆฌ๋ทฐ๊ฐ defense-in-depth๋ก ์ง์ ํ ์ง์ ).๊ฒ์ฆ
make test186 โ 192 checks (ํ๊ท ํ ์คํธ 6๊ฑด ์ถ๊ฐ) ยทmake lint0 ยทmake coverage๋ผ์ธ 100% ยทmake buildโ๋ฆฌ๋ทฐ
๋ณด์ ๋ฆฌ๋ทฐ ์๋ฃ โ ๊ถํ ๊ฒ์ดํธ ์ฝํ ์์(์ด์ ์์). ์ ํฉ์ฑยท์๊ณ ๋ฆฌ์ฆ ๋ฆฌ๋ทฐ๋ ์งํ ์ค์ด๋ฉฐ, ์ถ๊ฐ ๋ฐ๊ฒฌ์ด ์์ผ๋ฉด ์ด PR์ ์ปค๋ฐ์ ๋ง๋ถ์ธ๋ค.