Skip to content

Fix zip and subprocess invariants, split oversized UI builders - #131

Merged
JE-Chen merged 3 commits into
devfrom
cleanup/project-scan-fixes
Jul 29, 2026
Merged

Fix zip and subprocess invariants, split oversized UI builders#131
JE-Chen merged 3 commits into
devfrom
cleanup/project-scan-fixes

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jul 29, 2026

Copy link
Copy Markdown
Member

Result of a full-project scan (ruff, security checklist, complexity caps).

Correctness

  • zip() over request/name pairs (har_codegen) and node/offset pairs (diagram_mermaid_parser) now uses strict=True. Both rely on equal-length sequences; a mismatch previously dropped items silently.
  • ColorButton built its default QColor in the argument default, so one instance was created at import time and shared by every button. It is now per instance.
  • The S310 suppression in diagram_net_utils sat one line below the Request() call it was meant to cover, so it suppressed nothing. The URL/redirect validation itself was already correct.

Explicitness

  • The three subprocess.run() calls that inspect returncode themselves now pass check=False explicitly. No behaviour change.

Structure

  • DiagramEditorWidget.__init__ (101 statements) and DiagramPropertyPanel.__init__ (106) are split into per-section builders.
  • tools_menu repeated the same eight-line action block seventeen times and held a second copy of every widget factory. Tab and dock actions are now table-driven over one shared _WIDGET_FACTORIES registry, matching the dispatch-table pattern the module already used for docks. Net -190 lines.

Verification

  • ruff check pybreeze/ exe/ test/ clean
  • 873 unit tests pass
  • Both startup integration tests exit 0
  • tools_menu was diffed against the previous version at runtime: 19 tab actions, 19 dock keys and 43 window attributes match, including menu order, labels, and the widget class and constructor arguments behind every action.

Note: this branch also carries 99ef96f, which was already committed locally on dev but not yet pushed.

JE-Chen added 3 commits July 28, 2026 13:03
The Chain-of-Thought review framework reads a file or a pull request and
reports what it found; until now nothing in the IDE could reach it. It now
sits with the other automation tools: Automation > Code Review reviews the
file being edited or a pull request, and the output streams into a run
window like any other run.

One settings form holds what a review needs -- the inference backend and
where it is, the code host, the repository -- and every one of those is
handed to the child process as a PRTHINKER_* environment variable. That is
deliberate for the keys and the token: a command line is visible in a task
manager and lands in logs, and an environment variable does not.

The framework installs from source rather than from PyPI, so the install
entry asks for its folder once, remembers it, and installs that folder with
its runner extras. It needs Python 3.12 or newer, which is a property of
the interpreter chosen for running, not of the editor.

A file has to be saved before it can be reviewed, and a pull request review
needs a repository in the settings; both say so rather than starting a run
that could only fail.
- zip() over request/name and node/offset pairs now uses strict=True; both
  rely on equal-length sequences, so a mismatch silently dropped items.
- subprocess.run() calls that inspect returncode themselves now pass
  check=False explicitly.
- Move the S310 suppression onto the Request() call it applies to; the
  directive sat on the following line and suppressed nothing.
DiagramEditorWidget.__init__ and DiagramPropertyPanel.__init__ each built
their whole UI inline (101 and 106 statements); both are now split into
per-section builders.

tools_menu repeated the same eight-line action block seventeen times and
kept a second copy of every widget factory. Tab and dock actions are now
driven by tables sharing one _WIDGET_FACTORIES registry, matching the
dispatch-table pattern the module already used for docks.

Also gives ColorButton a per-instance default colour instead of one QColor
built at import time and shared by every instance.
@sonarqubecloud

Copy link
Copy Markdown

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 78 complexity · 0 duplication

Metric Results
Complexity 78
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen
JE-Chen merged commit 4d11a97 into dev Jul 29, 2026
7 checks passed
@JE-Chen
JE-Chen deleted the cleanup/project-scan-fixes branch July 29, 2026 13:28
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