Skip to content

feat(sketch): element size fields in the Style tab - #701

Draft
tstapler wants to merge 2 commits into
mainfrom
feat/element-size-panel
Draft

tstapler wants to merge 2 commits into
mainfrom
feat/element-size-panel

Conversation

@tstapler

Copy link
Copy Markdown
Owner

What

Mounts the existing ElementStatsPanel at the end of the Style tab when exactly one element is selected: x, y, width, height and angle, each committed on Enter or blur as one undo step. On a Technical sheet width and height take inches (12 3/16"), and x/y are captioned (1/16").

Fixes from review

  • Rotated rectangles/ellipses: the panel showed the rotated bounds but wrote them as the unrotated box, so typing a height on a 45° rectangle widened and moved it. ElementStats.of now reports the element's own box (same one ResizeElement writes).
  • Locked elements: commands don't enforce locked, so the panel did not either; a locked element now shows "Locked: unlock it to edit." instead of fields.

Known limits

Width on a zero-width line/freedraw does nothing, and Point/Arc refuse resize with a toast. Not changed here.

Tested

ElementStatsGeometryTest (new, rotated + ellipse), ElementStatsHostTest (new, Robolectric: select → type x moves it; absent with no selection; locked), existing StylePanelTest/StylePanelModelTest, detekt, sketch baseline guard. Not seen on a device.

@github-actions

Copy link
Copy Markdown
Contributor

JVM Load Benchmark (Desktop)

0 regressed · 1 improved · 4 unchanged · 0 new · 0 removed

jvm/WriteLatency

Benchmark Base Head Change
jankBaselineP95Ms 40 ms 24 ms 🟢 -40.0% ▰▰▰▰▱
4 unchanged

jvm/GraphLoad

Benchmark Base Head Change
phase1TtiMs 0 ms 0 ms ⚪ n/a (base is 0)
phase2Ms 0 ms 0 ms ⚪ n/a (base is 0)
phase3Ms 1 ms 1 ms ⚪ 0.0% ▱▱▱▱▱
totalMs 1 ms 1 ms ⚪ 0.0% ▱▱▱▱▱
Environment
Base Head
branch main HEAD
gitSha 20a23172e 34e29a49c
graphConfig xlarge xlarge
pageCount 230 230

A change counts when it is ≥ 5% and, where the data allows, statistically significant. Judged: 5 by threshold only (point estimates).

@github-actions

Copy link
Copy Markdown
Contributor

JVM Load Benchmark: profiling details

Flamegraphs (this PR) **Allocation** — object allocation pressure (JDBC/SQLite churn)

Alloc flamegraph not available

CPU — method-level hotspots by on-CPU time

CPU flamegraph not available

Top allocation hotspots (this PR) `33.8%` byte[]_[k] `7.5%` java.lang.String_[k] `6.3%` int[]_[k] `5.6%` java.lang.Object[]_[k] `4.4%` java.util.LinkedHashMap$Entry_[k]
Top CPU hotspots (this PR) `98.8%` /usr/lib/x86_64-linux-gnu/libc.so.6 `0.5%` /tmp/sqlite-3.51.3.0-c6d951c3-c37c-43b1-a009-e8790e97a61c-libsqlitejdbc.so `0.1%` SR_handler `0.1%` pthread_cond_signal `0%` prctl

@github-actions

Copy link
Copy Markdown
Contributor

CI memory (Gradle diff-coverage job, 16 GB runner)

2 benchmarks (no base to compare with)

ci-memory/diff-coverage

Benchmark Value Range
peak_used [max] 8359 MB —
min_available [min] 7341 MB —
Environment
Head
sha 34e29a49c8bb85518417c42d478869fb77cd5a04

Head-only report: add a base to see changes.

@github-actions

Copy link
Copy Markdown
Contributor

Android Load Benchmark (API 30 x86_64 emulator)

7 regressed · 1 improved · 1 unchanged · 0 new · 0 removed

android/WriteLatency

Benchmark Base Head Change
phase3P95Ms 4 ms 19 ms 🔴 +375.0% ▰▰▰▰▰
jankFactor 0.67 x 1.9 x 🔴 +183.6% ▰▰▰▰▰
baselineP95Ms 6 ms 10 ms 🔴 +66.7% ▰▰▰▰▰
writes 14 writes 21 writes 🟢 +50.0% ▰▰▰▰▰

android/SafIo

Benchmark Base Head Change
safPerFileMs 0.13 ms 0.27 ms 🔴 +107.7% ▰▰▰▰▰
safOverhead 4 x 8 x 🔴 +100.0% ▰▰▰▰▰

android/GraphLoad

Benchmark Base Head Change
phase3Ms 3041 ms 4323 ms 🔴 +42.2% ▰▰▰▰▰
phase1Ms 23 ms 32 ms 🔴 +39.1% ▰▰▰▰▱
1 unchanged

android/SafIo

Benchmark Base Head Change
safDirectPerFileMs 0 ms 0 ms ⚪ n/a (base is 0)
Environment
Base Head
branch main HEAD
gitSha 20a23172e 34e29a49c
pageCount 530 530

A change counts when it is ≥ 5% and, where the data allows, statistically significant. Judged: 9 by threshold only (point estimates).

@github-actions

Copy link
Copy Markdown
Contributor

CI memory (Bazel Android build, 16 GB runner)

0 regressed · 0 improved · 2 unchanged · 0 new · 0 removed

No meaningful changes.

2 unchanged

ci-memory/android-build

Benchmark Base Head Change
peak_used [max] 12780 MB 12784 MB ⚪ 0.0% ▱▱▱▱▱
min_available [min] 3202 MB 3198 MB ⚪ -0.1% ▱▱▱▱▱
Environment
Base Head
sha 20a23172eecf9401021aa5481b3df25f3f83b343 34e29a49c8bb85518417c42d478869fb77cd5a04

A change counts when it is ≥ 10% and ≥ 500 absolute and, where the data allows, statistically significant. Judged: 2 by threshold only (point estimates).

This branch has not been deployed

No deployments
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.

1 participant