Skip to content

Add scroll indicators to device menu dropdown#736

Open
manux81 wants to merge 2 commits into
Autonomy-Logic:developmentfrom
manux81:fix/679-scroll-indicator
Open

Add scroll indicators to device menu dropdown#736
manux81 wants to merge 2 commits into
Autonomy-Logic:developmentfrom
manux81:fix/679-scroll-indicator

Conversation

@manux81
Copy link
Copy Markdown

@manux81 manux81 commented Apr 19, 2026

Fixes #679. Adds scroll up/down affordances to Select dropdowns so long device lists clearly indicate they can be scrolled.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Warning

Rate limit exceeded

@manux81 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 60 minutes before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9e947951-e380-4cf2-80d0-ec155e3ef436

📥 Commits

Reviewing files that changed from the base of the PR and between c4e53a2 and dc972d8.

📒 Files selected for processing (1)
  • src/frontend/components/_atoms/select/index.tsx

Walkthrough

This pull request introduces portalling control for UI tooltips and dropdowns, adds filtering for deleted POUs in project file reading, improves main process error handling for extension installation, adds window state checks to prevent operations on destroyed windows, and fixes C++ variable class mapping to include the 'local' class.

Changes

Cohort / File(s) Summary
Deleted POU Filtering
src/backend/editor/services/project-service/utils/read-project.ts
Computes set of deleted POU identifiers and filters them from returnData.pous after project assembly, before subsequent transformations.
Tooltip Portalling
src/frontend/components/_atoms/tooltip/index.tsx, src/frontend/components/_atoms/graphical-editor/fbd/block.tsx
Adds optional portalled prop (default true) to TooltipContent to conditionally render inside or outside a Radix Portal; block component uses non-portaled tooltips.
Select Component Enhancement
src/frontend/components/_atoms/select/index.tsx
Adds portalled prop to SelectContent (default true), includes scroll buttons with directional arrows, and updates viewport styling to support flex-based layouts.
Table Cell Dropdowns
src/frontend/components/_molecules/global-variables-table/selectable-cell.tsx, src/frontend/components/_molecules/variables-table/selectable-cell.tsx
Applies non-portaled dropdown rendering via portalled={false} on SelectContent; C++ language mapping updated to include 'local' class in selectable options.
Main Process Error Handling & Window State
src/main/main.ts, src/main/menu.ts, src/main/modules/ipc/main.ts
Wraps extension installer in try/catch with fallback, adds window state guards (hasLiveWindow(), getFallbackMenu()), and prevents operations on destroyed windows in menu building and theme updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • JoaoGSP
  • Gustavohsdp

Poem

🐰 Portals dance and filters sing,
Windows guarded, states now ring,
Tooltips float with bounded grace,
C++ classes find their place! ✨

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The title states 'Add scroll indicators to device menu dropdown' but the primary changes span multiple systems (backend project deletion logic, IPC window handling, extension startup, tooltip portalling behavior, and select component scroll indicators). Consider using a more comprehensive title like 'Fix various stability issues and add scroll indicators to Select dropdowns' or breaking into multiple smaller PRs with focused scopes.
Description check ⚠️ Warning The PR description is minimal and lacks the required template structure with sections for References, detailed Description of changes, and DOD checklist. Add References section with issue/Jira links, expand Description to detail all proposed changes, and include completed DOD checklist items.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@manux81 manux81 force-pushed the fix/679-scroll-indicator branch from c4e53a2 to 0408808 Compare April 19, 2026 20:28
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
src/main/menu.ts (1)

35-37: hasLiveWindow() does not guard against a null/undefined mainWindow.

this.mainWindow is typed as BrowserWindow and populated in the constructor, so in practice this is fine. However, if mainWindow were ever cleared (e.g., after the 'closed' event in main.ts sets mainWindow = null), calling isDestroyed() on it would throw. Since the stated intent of this helper is defensive window-liveness gating, consider making it null-safe to match the broader hardening goal of the PR.

🛡️ Proposed fix
-  private hasLiveWindow(): boolean {
-    return !this.mainWindow.isDestroyed()
-  }
+  private hasLiveWindow(): boolean {
+    return !!this.mainWindow && !this.mainWindow.isDestroyed()
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/menu.ts` around lines 35 - 37, The hasLiveWindow helper should be
null-safe: change its logic in hasLiveWindow to first check that this.mainWindow
is not null/undefined before calling isDestroyed (e.g., return this.mainWindow
!= null && !this.mainWindow.isDestroyed()); update references to mainWindow and
isDestroyed so the method safely handles cases where the constructor-created
mainWindow may have been cleared (e.g., after the 'closed' event).
src/main/modules/ipc/main.ts (1)

828-832: Use Winston logger instead of console.error.

The rest of this file uses logger (Winston) for error reporting. Switching console.error here keeps logging consistent and structured.

♻️ Proposed fix
   handleWindowRebuildMenu = () => {
     void this.menuBuilder.buildMenu().catch((error) => {
-      console.error('Error rebuilding application menu:', error)
+      logger.error('Error rebuilding application menu: ' + getErrorMessage(error))
     })
   }

As per coding guidelines: "Use Winston for structured logging in the main process".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/modules/ipc/main.ts` around lines 828 - 832, In
handleWindowRebuildMenu, replace the console.error call in the
menuBuilder.buildMenu().catch block with the project's Winston logger (use the
same logger instance used elsewhere in this file, e.g., logger.error) and
include the error object and a clear context message like "Error rebuilding
application menu" so logs remain structured and consistent; update the catch to
call logger.error with both the message and the caught error.
src/frontend/components/_atoms/select/index.tsx (1)

26-31: Type the portalled prop explicitly rather than leaning on intersection.

ISelectContentProps extends ComponentPropsWithoutRef<typeof PrimitiveSelect.Content> and adds portalled?: boolean. This works, but mirroring the tooltip file’s intersection style (& { portalled?: boolean }) — or keeping it here — is fine; just make sure the portalled key is always destructured before ...res is spread onto PrimitiveSelect.Content so it never leaks as an unknown DOM attribute. Lines 43–44 do that correctly, so this is just a defensive note for future edits.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/components/_atoms/select/index.tsx` around lines 26 - 31,
ISelectContentProps currently relies on ComponentPropsWithoutRef<typeof
PrimitiveSelect.Content> and adds portalled?: boolean via intersection;
explicitly declare portalled?: boolean in the ISelectContentProps type (so it's
clearly owned by this interface) and ensure any usage in Select.Content
component destructures portalled (and viewportRef/data-align/data-side) before
spreading ...res into PrimitiveSelect.Content to prevent portalled from leaking
as an unknown DOM attribute.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/frontend/components/_atoms/select/index.tsx`:
- Around line 26-31: ISelectContentProps currently relies on
ComponentPropsWithoutRef<typeof PrimitiveSelect.Content> and adds portalled?:
boolean via intersection; explicitly declare portalled?: boolean in the
ISelectContentProps type (so it's clearly owned by this interface) and ensure
any usage in Select.Content component destructures portalled (and
viewportRef/data-align/data-side) before spreading ...res into
PrimitiveSelect.Content to prevent portalled from leaking as an unknown DOM
attribute.

In `@src/main/menu.ts`:
- Around line 35-37: The hasLiveWindow helper should be null-safe: change its
logic in hasLiveWindow to first check that this.mainWindow is not null/undefined
before calling isDestroyed (e.g., return this.mainWindow != null &&
!this.mainWindow.isDestroyed()); update references to mainWindow and isDestroyed
so the method safely handles cases where the constructor-created mainWindow may
have been cleared (e.g., after the 'closed' event).

In `@src/main/modules/ipc/main.ts`:
- Around line 828-832: In handleWindowRebuildMenu, replace the console.error
call in the menuBuilder.buildMenu().catch block with the project's Winston
logger (use the same logger instance used elsewhere in this file, e.g.,
logger.error) and include the error object and a clear context message like
"Error rebuilding application menu" so logs remain structured and consistent;
update the catch to call logger.error with both the message and the caught
error.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6fd74949-58e5-49f7-b38b-62d29d5cf604

📥 Commits

Reviewing files that changed from the base of the PR and between df844ee and c4e53a2.

📒 Files selected for processing (9)
  • src/backend/editor/services/project-service/utils/read-project.ts
  • src/frontend/components/_atoms/graphical-editor/fbd/block.tsx
  • src/frontend/components/_atoms/select/index.tsx
  • src/frontend/components/_atoms/tooltip/index.tsx
  • src/frontend/components/_molecules/global-variables-table/selectable-cell.tsx
  • src/frontend/components/_molecules/variables-table/selectable-cell.tsx
  • src/main/main.ts
  • src/main/menu.ts
  • src/main/modules/ipc/main.ts

@manux81 manux81 changed the title Fixes #679. Add scroll indicators to device menu dropdown Add scroll indicators to device menu dropdown Apr 19, 2026
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.

Please add some kind of scroll indicator to the device menu (see picture)

1 participant