Skip to content

Appearance: a Hover edge width slider for the edge under the pointer - #22546

Open
0rdnungsamt wants to merge 9 commits into
tangency-labs:mainfrom
0rdnungsamt:feat/hover-edge-appearance
Open

0rdnungsamt wants to merge 9 commits into
tangency-labs:mainfrom
0rdnungsamt:feat/hover-edge-appearance

Conversation

@0rdnungsamt

@0rdnungsamt 0rdnungsamt commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

The edge under the pointer is drawn at a width the person chooses: a Hover edge width slider in Preferences › Appearance (1–6 pt, 0.5 pt steps), defaulting to 2 pt — the width it has today, so nothing changes until someone turns it up.

Why

On a light grey body the 2 pt hovered edge was hard to tell from the model's own edges (#22042). A fixed wider default would change the look for everyone, so the width is a setting instead, as the maintainer asked.

What

  • prefs/fields/appearance.rs: a hover_edge_width preference, default 2, accepted 1…6, with its slider row on the Appearance page. The row is labelled "Hover edge width" in nine languages (a pending locale file).
  • prefs.rs: the range constant, the drawing-time fallback (a hand edit outside 1…6 draws 2 pt), and the migrate / prepare_preferences entries every range-checked preference carries.
  • viewport.rs: the hovered edge (Hit::Edge) is drawn at that width instead of a hard-coded 2 pt; the hard-coded 3 pt of the earlier revision is gone. Colour and halo unchanged, and the highlight geometry key includes the width, so a change shows at once.
  • Fillet and chamfer surface patches still light their edges thin (LIT_EDGE_W), since their colour sets them apart.

Tested

  • viewport.rs::the_hovered_edge_is_drawn_at_the_width_preferences_set hovers a cylinder's top edge: by default the edge is drawn in the theme's hover colour at 2 pt, a 5 pt setting draws 5 pt, and a hand edit outside the range draws as by default. The test reads plain and lifted line widths.
  • These pass:
    • the fillet and chamfer hover test;
    • the prefs field tests (every_field_is_stored_once_and_reads_back, page_files_keep_their_fields_sorted);
    • the i18n and colour_tokens UI tests;
    • clippy -D warnings on ui-egui (all targets);
    • cargo xtask lists;
    • the app build.

Screenshots

Preferences › Appearance, the new row:

The Hover edge width row on Preferences › Appearance

The hovered edge at the default 2 pt, and at 5 pt:

The hovered edge at the default 2 pt
The hovered edge at 5 pt

Changes a default: no

Fixes #22042

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Graphics preferences now include settings for hovered-edge colour and width. The Graphics page exposes these settings, and viewport highlights use them for ordinary hovered edges.

Changes: Hovered-Edge Appearance

Layer / File(s) Summary
Preference settings and controls
crates/ui-egui/src/prefs.rs, crates/ui-egui/src/prefs/fields/graphics.rs, crates/ui-egui/src/prefs/graphics.rs, assets/locales/pending/hover-edge-appearance.json
Graphics preferences define hovered-edge colour and width defaults, validation, migration, and reset ownership. The Graphics page adds colour and width controls, with labels translated into nine locales.
Viewport highlight rendering
crates/ui-egui/src/viewport.rs
The viewport cache key includes hovered-edge colour and width. Ordinary hovered edges use those settings. Fillet/Chamfer lit edges retain their existing colour and width. Tests cover defaults and configured values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · previous review ff968

This change adds configurable hovered-edge colour and width preferences with unchanged defaults. No merge-blocking issue was found.

Pre-merge checks: Passed 5

Check name Status Explanation
Linked Issues check Passed [#22042] requests user-configurable hover colour and hover line thickness for 3D edges. The reviewed head implements both. hover_edge_colour: Option<[u8; 3]> (None = theme colour) and `hover_edge_wi…
Out of Scope Changes check Passed Every changed area maps to an objective of #22042. Preference fields, clamping, migration, and reset handling in crates/ui-egui/src/prefs.rs and prefs/fields/graphics.rs support the configurable colou…
Title check Passed The title names the main change: a width slider for the hovered edge in Appearance preferences. It matches the changeset, which adds a hover edge width preference (1–6 pt, default 2 pt) and applies it…
Description check Passed The description follows the template. It explains what the change does and who benefits, and it links issue #22042. It states 'Changes a default: no' with a reason (the default width stays 2 pt). It i…
Existing Defaults Unchanged Passed PR #22546 (tangency-labs/solidcraft, author 0rdnungsamt, head feat/hover-edge-appearance, base main) adds a Hover edge width preference. The default is 2.0 pt, which equals the width the viewport alre…
Full details: Linked Issues check

Explanation

[#22042] requests user-configurable hover colour and hover line thickness for 3D edges. The reviewed head implements both. hover_edge_colour: Option&lt;[u8; 3]&gt; (None = theme colour) and hover_edge_width: f32 (default 2.0, accepted range 1 to 6 pt) are added in crates/ui-egui/src/prefs/fields/graphics.rs. The Graphics page exposes a Theme/Custom choice, a colour swatch, and a 0.5 pt width slider (crates/ui-egui/src/prefs/graphics.rs). The viewport applies both to Hit::Edge hovers (crates/ui-egui/src/viewport.rs), and the highlight cache key includes both values. Defaults match the previous appearance, which the issue asks to keep. The issue also asks, ideally, for separate hover and selection settings. The issue states this as a preference ('Ideally'), not as a firm requirement, and the PR does not add it. The PR's viewport test covers defaults, custom colour, width change without line-count change, and NaN fallback. Test results are author-reported and were not re-run.

Full details: Out of Scope Changes check

Explanation

Every changed area maps to an objective of #22042. Preference fields, clamping, migration, and reset handling in crates/ui-egui/src/prefs.rs and prefs/fields/graphics.rs support the configurable colour and width. The Graphics page controls expose those settings. The viewport changes apply them to hovered edges and update the cache key. Locale strings in assets/locales/pending/hover-edge-appearance.json label the new controls. The Fillet/Chamfer lit-patch exception keeps its existing colour and width. This is a narrow carve-out and does not change unrelated geometry or selection appearance. No change was found that is unrelated to the issue.

Full details: Title check

Explanation

The title names the main change: a width slider for the hovered edge in Appearance preferences. It matches the changeset, which adds a hover edge width preference (1–6 pt, default 2 pt) and applies it when drawing the hovered edge. Minor mismatch: the raw summary places the setting under Graphics, while the description and title place it under Appearance, so the title's location is not confirmed by the file summaries.

Full details: Description check

Explanation

The description follows the template. It explains what the change does and who benefits, and it links issue #22042. It states 'Changes a default: no' with a reason (the default width stays 2 pt). It includes a Validation section with the tests and checks run. It includes screenshots of the new row and the hovered edge at 2 pt and 5 pt, as the template requires for UI additions. Gaps: the template asks for full-flow screenshots at 1280×720 and a small-window check, and the description does not show these. The Integration status section is absent. The image links point to a commit-pinned path in a fork, and the reviewer cannot confirm they load. The description also names 'appearance.rs' while the summaries place the preference in graphics.rs, and the PR objectives describe the setting under Graphics > Surfaces and edges, so the location needs confirmation.

Full details: Existing Defaults Unchanged

Explanation

PR #22546 (tangency-labs/solidcraft, author 0rdnungsamt, head feat/hover-edge-appearance, base main) adds a Hover edge width preference. The default is 2.0 pt, which equals the width the viewport already drew for a hovered edge. No UX default changes. Evidence from the PR's own commit (a875dd4, diff against its parent a61b0f4): - crates/ui-egui/src/viewport.rs: the hovered edge previously drawn at (hover_edge, 2.0) now draws at crate::prefs::hover_edge_width(&amp;app.preferences). That function returns the saved value when it lies in 1…6, otherwise 2.0. With the default, the width is 2.0, so the look is unchanged. The colour (hover_edge) and the lit fillet/chamfer path (LIT_EDGE_W) are unchanged. - The earlier 3.0 pt HOVER_EDGE_W constant, present in the parent revision, is removed in this commit. The final default is 2.0 pt, as on main. - crates/ui-egui/src/prefs.rs: adds HOVER_EDGE_WIDTH (1…6), the hover_edge_width getter, a migrate reset, and a prepare_preferences range check. These are additive. - crates/ui-egui/src/prefs/fields/appearance.rs: adds a new hover_edge_width: f32 = 2.0 field with a slider row. Additive. - crates/ui-egui/src/prefs/interface.rs: adds one settings row to the Appearance page. Additive. - The highlight cache key gains the width. This affects caching only, not the rendered default. - A pending locale file adds strings only. The raw summary described graphics.rs colour settings and a 3 pt default. The commit diff does not show those. The summary is stale relative to the final commit, so I did not rely on it. The description's Changes a default: no agrees with the code. The upstream merge commits on the branch are not contributor changes, and I excluded them. Previous standing FAIL: its details are unavailable. The most likely cause is the earlier 3 pt hover default, which the final commit removes. Current code shows 2.0 pt as the default. Prior failure addressed: The prior revision (parent a61b0f4) drew hovered edges at a hard-coded 3.0 pt (HOVER_EDGE_W). Commit a875dd4 removes that constant and draws at hover_edge_width, whose default is 2.0 pt, the width on main (hover_edge, 2.0). The prior failure's details are unavailable, so this is inferred from the removed 3 pt default.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9aa4788 and ff96845.

Files selected for processing: 5

  • assets/locales/pending/hover-edge-appearance.json
  • crates/ui-egui/src/prefs.rs
  • crates/ui-egui/src/prefs/fields/graphics.rs
  • crates/ui-egui/src/prefs/graphics.rs
  • crates/ui-egui/src/viewport.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

The edge under the pointer was always drawn in the theme's hover colour at
2 pt, which is hard to see on some models (tangency-labs#22042). Two new preferences on
the Graphics page change it: "Hovered edge color" (Theme, or a custom
colour) and "Hovered edge width" (1 to 6 pt). The defaults draw exactly as
before. The viewport's highlight cache key includes both, so a change shows
at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0rdnungsamt
0rdnungsamt marked this pull request as ready for review November 26, 2026 20:53
@bherbruck bherbruck added the approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) label Nov 26, 2026
0rdnungsamt and others added 2 commits November 27, 2026 00:28
…ed orange

The colour check allows no colour literal outside the theme tokens, so
Custom now starts from the accent token. The saved colour itself is the
user's own data, like the sketch dimension colour, so prefs.rs is allowed
two colour literals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gb, no extra literal

The saved [u8; 3] goes through solidcraft_theme::srgb, as body
appearance colours do, so prefs.rs keeps its one allowed colour literal
and colour_tokens_tests.rs is as on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bherbruck

bherbruck commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for chasing the hard-to-see hover edge (#22042). This is done in 05f94edfe1: the two Graphics settings are gone, the hovered edge is 3 pt by default, and the 1280x720 before/after screenshots are in the description. CI is green. Since this changes what every user sees, Nate reviews the look next. Nothing else is needed from you.

…ettings are gone

As the maintainer asked, the hovered edge gets no Preferences rows: hover_edge_colour and
hover_edge_width, their rows, fields and strings are removed. The default look is clearer
instead: the edge under the pointer is drawn 3 pt wide (2 before) in the theme's hover
colour, so it stands out from the model's edges on a light body (tangency-labs#22042).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0rdnungsamt 0rdnungsamt changed the title Viewport: preferences for the hovered edge's colour and width Viewport: the hovered edge is drawn 3 pt wide, clearer on light bodies Nov 27, 2026
@0rdnungsamt

Copy link
Copy Markdown
Contributor Author

Done in 05f94ed: the two Graphics settings are gone, and the hovered edge is drawn 3 pt wide instead of 2 pt. Before and after screenshots at 1280×720 are in the description.

@bherbruck

Copy link
Copy Markdown
Collaborator

@0rdnungsamt where this stands: 05f94edfe1 merges cleanly and its checks are fine, so nothing is needed from you right now. It changes what people see, so it's waiting on a UI look from our side (the needs-ui-review label). I'll comment here if that look asks for anything; otherwise it goes into the queue once it's done.

@bherbruck

Copy link
Copy Markdown
Collaborator

Thanks for this. Rather than changing the hover width for everyone, I'd like it as a setting: a Hover edge width slider in Preferences (Appearance), defaulting to today's width, so people who want a thicker hover can turn it up. Could you rework it that way?

@bherbruck bherbruck added the status:decision Waiting on a maintainer group decision; don't merge or close label Dec 4, 2026
0rdnungsamt and others added 3 commits December 4, 2026 22:45
…earance

# Conflicts:
#	crates/ui-egui/src/viewport.rs
The maintainer asked for the hovered edge's width as a setting rather than a
fixed wider default: a "Hover edge width" slider on Preferences › Appearance
(1 to 6 pt, 0.5 pt steps) draws the edge under the pointer at the width it
sets, 2 pt by default — the width it has today, so nothing changes until
someone turns it up (tangency-labs#22042). A hand edit outside 1…6 draws 2 pt, as every
range-checked preference does.

The 3 pt default of the previous commit is gone: the hovered edge is drawn at
the preference again, and the highlight geometry key includes its width, so a
change shows at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0rdnungsamt 0rdnungsamt changed the title Viewport: the hovered edge is drawn 3 pt wide, clearer on light bodies Appearance: a Hover edge width slider for the edge under the pointer Dec 5, 2026
@0rdnungsamt

Copy link
Copy Markdown
Contributor Author

Thanks for this. Rather than changing the hover width for everyone, I'd like it as a setting: a Hover edge width slider in Preferences (Appearance), defaulting to today's width, so people who want a thicker hover can turn it up. Could you rework it that way?

Reworked that way in a875dd40dd: the width is now a Hover edge width slider in Preferences › Appearance — 1–6 pt in 0.5 pt steps, defaulting to 2 pt, the width it has today, so nothing changes until someone turns it up. The hard-coded 3 pt of the previous revision is gone, and the description carries new screenshots: the row on the Appearance page, and the hovered edge at 2 pt vs 5 pt.

The one-line if/else exceeded the line width; the formatter splits it
across four lines. Whitespace only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bherbruck

Copy link
Copy Markdown
Collaborator

@0rdnungsamt thanks, that's exactly what I asked for: a Hover edge width slider in Appearance that defaults to today's 2 pt, so nothing changes until someone turns it up. My side is all that's left: I review the new head (aa472d497e), lift the hold, and it goes to the merge queue once it's green. Nothing needed from you.

@bherbruck bherbruck added ready to merge reviewed, every ask addressed; merge once CI is green and removed status:decision Waiting on a maintainer group decision; don't merge or close needs-ui-review Needs a look from whoever owns the UI's look labels Dec 6, 2026
tangency-repo-manager Bot added a commit that referenced this pull request Dec 6, 2026

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

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Customisable 3D Edge Hover Highlighting

2 participants