Skip to content

fix: GUI + API Client bugfixes (v2.2.1) - #37

Merged
Bulletdev merged 13 commits into
mainfrom
fix/v2.2.1-gui-apiclient-bugfixes
Nov 12, 2026
Merged

Bulletdev merged 13 commits into
mainfrom
fix/v2.2.1-gui-apiclient-bugfixes

Conversation

@Bulletdev

Copy link
Copy Markdown
Member

Summary

  • Dashboard: Add INFO severity card (5th column), summary panel with top modules, wire INFO count through status bar
  • BruImporter: Parse collection.bru for root auth/headers, skip folder.bru as request items, handle auth: inherit in method blocks, fix brace-depth parser for {{template}} vars
  • ApiClientView: Custom tree renderer (replaces broken HTML renderer), tab bar overflow with dropdown, persistent session context for token propagation, auto-extract token from JSON responses
  • RequestExecutor: NPE fix with Objects.equals() for nullable uid
  • AiAssistant: [Consultando ...] feedback + error handling for tool calls

Test plan

  • Import Bruno collection with collection.bru containing auth: bearer -- verify root config parsed
  • Verify folder.bru files no longer appear as "GET (no url)" requests in tree
  • Send authenticated request with auth: inherit -- verify token propagates from collection root
  • Check dashboard shows 5 severity cards (CRITICAL/HIGH/MEDIUM/LOW/INFO) + summary panel
  • Verify tab bar overflow (>>) dropdown works when many tabs open
  • Verify spotlessCheck and compileJava pass

…derer, tab overflow, session context)

Dashboard:
- Add INFO severity card (5th column) + summary panel with top modules
- Wire INFO count through GuiStatusBar and AnarCryGui.incrementSeverityCount

API Client - BruImporter:
- Parse collection.bru for root auth/headers (RootConfig) -- fixes token not propagating
- Skip folder.bru as request items, use for folder name + root config
- Handle auth:inherit in method block KV parsing
- New parseRootConfig() resolves auth mode selector + auth:bearer/basic blocks
- New parseMetaName() extracts folder name from meta block
- Fix brace-depth parser replacing broken regex for body:json with {{template}} vars

API Client - ApiClientView:
- Replace HTML tree renderer with custom JPanel renderer (method label + name label)
- Tab bar overflow with ">>" dropdown button, active tab always visible
- Persistent session context (RunContext) for token propagation across requests
- Auto-extract token from JSON responses (token, accessToken, access_token, jwt)
- Remove dead escapeHtml() method

RequestExecutor:
- Use Objects.equals() for nullable uid comparison (NPE fix)

AiAssistant:
- Add [Consultando ...] feedback message during tool calls
- Error handling for tool call failures
@Bulletdev Bulletdev self-assigned this Nov 11, 2026
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 2
Warnings 2

⚠️ High confidence issues found. Please review.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

@codacy-production

codacy-production Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 776 complexity · 51 duplication

Metric Results
Complexity 776
Duplication 51

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

…Encoded, cookie jar

1. Folder variables no longer silently discarded -- mergeInherited() now
   loads folder vars into the actual VariableStore instead of a dummy

2. buildCurrentRequestItem() now includes params (query + path), pre/post
   vars, and assertions from the editor tabs -- previously only sent
   method/URL/headers/body/auth

3. FormUrlEncoded body type now correctly builds BodyConfig.FormUrlEncoded
   with parsed key=value params instead of falling through to Json

4. CookieManager wired to HttpClient via cookieHandler() -- Set-Cookie
   headers now persist across requests in the same session

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

⚠️ Resolve issues before merging

Three high-confidence logic defects should be fixed before merging: null request IDs can misassign folder configuration, brace parsing can break on quoted JSON content, and clearing the selected environment can leave stale variables active.

The requested regression scenarios and build verification are all marked missing, so several acceptance criteria remain unverified, particularly around importer behavior, GUI updates, persistence, and assistant feedback.

About this PR

  • Add automated regression coverage for the changed importer, request execution, persistence, GUI, and assistant behaviors, and include build/format verification in CI or the PR validation.

Test suggestions

  • Import a Bruno collection with collection-level bearer authentication and headers.
  • Verify folder.bru is excluded from request items while folder metadata and configuration are retained.
  • Execute a request with auth: inherit and resolve folder or collection authentication.
  • Parse Bruno blocks containing template variables and nested braces.
  • Verify dashboard INFO counts, five severity cards, status-bar counts, and summary text.
  • Verify overflowing request tabs appear in the dropdown and selecting one activates it.
  • Verify JSON token extraction persists the token for a subsequent request.
  • Verify nullable request IDs do not cause unrelated requests to be assigned to the same folder.
  • Verify AI tool-call progress and failure feedback.
  • Run spotlessCheck and compileJava successfully.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Import a Bruno collection with collection-level bearer authentication and headers.
2. Verify folder.bru is excluded from request items while folder metadata and configuration are retained.
3. Execute a request with auth: inherit and resolve folder or collection authentication.
4. Parse Bruno blocks containing template variables and nested braces.
5. Verify dashboard INFO counts, five severity cards, status-bar counts, and summary text.
6. Verify overflowing request tabs appear in the dropdown and selecting one activates it.
7. Verify JSON token extraction persists the token for a subsequent request.
8. Verify nullable request IDs do not cause unrelated requests to be assigned to the same folder.
9. Verify AI tool-call progress and failure feedback.
10. Run spotlessCheck and compileJava successfully.

Make this review better

TIP Add a ticket key to the branch or title so the reviewer can check the PR against it. Or tell us which ticket tracker you use here.
TIP Add Codacy review.md instructions or an AGENTS.md so the reviewer knows your conventions.

TIP How was this review? Give us feedback

if (ci instanceof Folder folder) {
for (CollectionItem child : folder.items()) {
if (child instanceof RequestItem ri && ri.uid().equals(item.uid())) {
if (child instanceof RequestItem ri && java.util.Objects.equals(ri.uid(), item.uid())) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Do not treat two null UIDs as equal; compare object identity or require both UIDs to be non-null before comparing them. Otherwise requests without assigned IDs can inherit configuration from an unrelated folder.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

vars.loadEnv(env);
}
sessionContext = new RunContext(vars);
} else if (env != null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Reset or rebuild the session variable store whenever the selected environment changes, including when the environment is null, so stale variables are not used.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.


// Walk forward counting braces to find the matching '}'
while (i < len && depth > 0) {
char c = text.charAt(i);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Track quoted-string and escape state while scanning block contents so braces inside strings do not affect nesting depth.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 2
Warnings 2

⚠️ High confidence issues found. Please review.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

…un results panel

Phase 1-3 implementation closing Bruno Desktop feature gaps:

- Auth CardLayout forms for all 12 auth types (Basic, Bearer, JWT, OAuth1,
  OAuth2, AWS v4, Digest, Hawk, NTLM, Akamai EdgeGrid, API Key, Cookie)
- 4 new auth injectors: AwsV4, EdgeGrid, NTLM, OAuth1
- GraalJS scripting engine with bru/req/res bridge objects for
  pre-request and post-response scripts
- KvTableEditor reusable component for headers, params, form body
- Run results panel replacing JOptionPane with status/headers/body tabs
- Status code coloring (green 2xx, orange 3xx/4xx, red 5xx)
- Cookies response tab from CookieManager
- Copy cURL button via CurlGenerator
- Insomnia JSON collection importer
- Auth inherit propagation in combo selector
- Request history sidebar with timestamp navigation
- Variable inspector tab showing env/collection/folder/request vars
- Proxy settings UI (host, port, auth, bypass list)
- Body CardLayout switching text editor vs form table
- BruImporter script block parsing
- RequestExecutor scripting integration (pre/post execution)
- Version bump 2.2.0 -> 2.2.1
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 2
Warnings 2

⚠️ High confidence issues found. Please review.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

AnarCryLaf.installLight() with dedicated light customizations.
Theme-aware helpers (fg, bg, border, buttonBg, sectionLine) replace
hardcoded dark-only constants across DashboardView, AssistantView,
GlobalSearchDialog, LogPane, and GuiModulesPanel.
Replace Unicode/emoji text with 16x16 PNG icons (Tabler Icons, MIT).
Add theme toggle, GitHub repo link, license info, keybindings buttons.
Cookies click opens Preferences. StatusBarIcons loader with fallback.
…export

Auth variable interpolation in all 12 AuthConfig variants. GraalJS
pre-request/post-response/test scripts. cURL export, Insomnia import.
Tab content badges, query/path param split, description column,
tab state cache. Proxy sidebar removed (centralized to Preferences).
AppSettings singleton persists all preferences to ~/.anarcry/settings.json
via Gson. Loads on startup, saves on Apply. PreferencesDialog reworked:
10 category tabs, Check for Updates (GitHub API), support panel with art
and hyperlinks, certificates panel (PEM/PKCS12 client certs, custom CA).
Proxy moved from API Client sidebar to Preferences. AnarCryGui builds
ProxySelector + SSLContext from Preferences and injects via setNetworkConfig.
Saved theme and resolution applied on app launch.
Changelog updated with Preferences persistence, light theme, proxy
centralization, certificates panel, SSL context builder, Check for
Updates, status bar icons. Architecture tree adds AppSettings and
PreferencesDialog. Launcher window size bumped to 200x92c.
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 2
Warnings 2

⚠️ High confidence issues found. Please review.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

DigestAuthInjector MD5 (RFC 7616 requires MD5 for HTTP Digest Auth)
and WsseInjector SHA-1 (WSSE PasswordDigest spec requires SHA-1)
are protocol-mandated, not security flaws. Added nosemgrep inline
suppressions alongside existing SonarQube @SuppressWarnings.
@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

✅ No issues found.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

@codacy-production

codacy-production Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 778 complexity · 56 duplication

Metric Results
Complexity 778
Duplication 56

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

Logo (logoAnarChyNoBG.png) resized to 64/128/256px for window icon
(taskbar + title bar) and 400px for splash screen. SplashScreen shows
logo with version and loading indicator while GUI initializes, dismissed
when the main frame becomes visible.
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

✅ No issues found.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

…reset

AnarCryLaf: add theme listener system and resetColors() that nullifies
non-UIResource backgrounds/foregrounds on the entire component tree
before running custom listeners, ensuring no stale colors survive a
toggle in either direction.

ApiClientView: RSyntaxTextArea picks dark.xml/default.xml based on
current theme; method badge backgrounds use light tints in light mode;
tree/tab label colors use AnarCryLaf.fg() instead of hardcoded white.

RepeaterView: same RSyntaxTextArea theme-aware fix.

AssistantView, LogPane, DashboardView: theme listeners to refresh
custom backgrounds, JFreeChart paints, and text colors on toggle.

AnarCryGui, PreferencesDialog: call fireThemeChanged(frame) after
updateComponentTreeUI to apply custom colors last.
@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

✅ No issues found.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

DigestAuthInjector uses MD5 (RFC 7616) and WsseInjector uses SHA-1
(WSSE PasswordDigest spec). Both are protocol requirements, not
application-level crypto choices.
@Bulletdev Bulletdev added the enhancement New feature or request label Nov 12, 2026
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

✅ No issues found.

@github-actions

Copy link
Copy Markdown

SpotBugs + FindSecBugs

  • Total findings: 0
  • High priority (P1/P2): 0

✅ No high-priority issues.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
SpotBugs + FindSecBugs ✅ success
Semgrep ✅ success
Secret Detection ✅ success

✅ All security checks passed!

@Bulletdev
Bulletdev merged commit 3f73920 into main Nov 12, 2026
9 checks passed
@Bulletdev
Bulletdev deleted the fix/v2.2.1-gui-apiclient-bugfixes branch November 12, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant