Skip to content

Trailcode/hot keys#94

Closed
trailcode wants to merge 4 commits intomainfrom
Trailcode/hot-keys
Closed

Trailcode/hot keys#94
trailcode wants to merge 4 commits intomainfrom
Trailcode/hot-keys

Conversation

@trailcode
Copy link
Copy Markdown
Owner

@trailcode trailcode commented Apr 30, 2026

Note

Medium Risk
Moderate risk because it adds new global hotkey handling and introduces platform-specific system() calls to open local documentation files, plus build changes that affect packaging/preloading of resources.

Overview
Adds Blender-style view roll: Shift+NumPad 4/6 now rotates the 3D view by a configurable step, persisted as gui.view_roll_step_deg (default 45°) and exposed in Settings → 3D view navigation.

Introduces offline help packaging: Markdown docs/licenses are copied (native) or preloaded (Emscripten) into res/doc/, and Help → Usage Guide (plus the new ? help next to the roll setting) opens the packaged file when available, otherwise falling back to GitHub.

Adds supporting infrastructure: Occt_view::roll_view_z_deg, an executable-directory helper in paths.*, updates default settings JSON and scripting help text, and includes new documentation (usage-occt-view.md) plus a couple of repo-local issue drafts and a small PDF-to-PNG conversion script.

Reviewed by Cursor Bugbot for commit 739cae9. Bugbot is set up for automated code reviews on this repo. Configure here.

@trailcode trailcode closed this Apr 30, 2026
@trailcode trailcode deleted the Trailcode/hot-keys branch April 30, 2026 01:48
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 739cae9. Configure here.

Comment thread src/gui_settings.cpp
const double v = g["view_roll_step_deg"].get<double>();
EZY_ASSERT_MSG(v >= k_gui_view_roll_step_deg_min && v <= k_gui_view_roll_step_deg_max,
"settings gui.view_roll_step_deg out of range [0.1, 180]");
m_view_roll_step_deg = v;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert crashes app on out-of-range user settings value

High Severity

EZY_ASSERT_MSG is used to validate the user-editable view_roll_step_deg setting, but this macro calls DEBUG_BREAK (__debugbreak / raise(SIGTRAP)) unconditionally in all builds (it's not guarded by NDEBUG). If a user manually sets view_roll_step_deg outside [0.1, 180] in their settings JSON, the app crashes on startup. Every other setting in this function uses silent range checks with fallback or std::clamp for invalid values — this is the only one that asserts on user-provided data.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 739cae9. Configure here.

Comment thread src/gui.cpp
#else
(void) p;
#endif
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New function duplicates existing open_url_ logic

Low Severity

The new open_local_file_default_app_ function duplicates the platform-specific std::system command construction already present in open_url_. Both build the identical start / open / xdg-open command string. The caller open_packaged_doc_or_url_ already checks file existence before calling, making the existence check inside this helper also redundant. A call to open_url_(p.string().c_str()) would achieve the same result without duplicating the shell-command logic, reducing the risk of fixing a bug in one copy but not the other.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 739cae9. Configure here.

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