Skip to content

Conversation

Jack251970
Copy link
Member

Improve JsonRPC Plugin Setting Panel

  • Constrain column 0 to 60% of the max width of the grid.
  • Use wrap as default text wrapping option.

Test

image image

@Jack251970 Jack251970 requested a review from Copilot September 15, 2025 10:44
@github-actions github-actions bot added this to the 2.1.0 milestone Sep 15, 2025
@Jack251970 Jack251970 requested a review from cibere September 15, 2025 10:44
@Jack251970 Jack251970 added the bug Something isn't working label Sep 15, 2025
Copy link

gitstream-cm bot commented Sep 15, 2025

🥷 Code experts: no user but you matched threshold 10

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Activity based on git-commit:

Jack251970
SEP
AUG
JUL
JUN 1 additions & 1 deletions
MAY
APR 21 additions & 6 deletions

Knowledge based on git-blame:
Jack251970: 73%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@Jack251970 Jack251970 added the kind/ui related to UI, icons, themes, etc label Sep 15, 2025
Copy link

gitstream-cm bot commented Sep 15, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the JsonRPC Plugin Setting Panel layout by implementing column width constraints and consistent text wrapping. The changes ensure better visual formatting and readability of plugin settings.

  • Constrains column 0 to 60% of the maximum grid width to prevent excessive horizontal expansion
  • Changes all text wrapping from WrapWithOverflow to Wrap for consistent text behavior
  • Adds dynamic layout handling through a SizeChanged event handler

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Warning

Rate limit exceeded

@Jack251970 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 31 seconds before requesting another review.

⌛ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between e571204 and 55f9857.

📒 Files selected for processing (1)
  • Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (8 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Updated JsonRPCPluginSettings to constrain the settings panel’s left column width, switch text elements to TextWrapping.Wrap, and add a SizeChanged handler that recalculates column and child MaxWidth based on available width. Public APIs remain unchanged.

Changes

Cohort / File(s) Summary
Settings panel layout and wrapping
Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs
Added MainGridColumn0MaxWidthRatio (0.6) to cap column 0 width; hooked mainPanel.SizeChanged; implemented MainPanel_SizeChanged to set column 0 MaxWidth and propagate to child elements; replaced TextWrapping.WrapWithOverflow with TextWrapping.Wrap across labels, text blocks, and text boxes; ensured wrapping in text, path, and textarea inputs; updated layout comments.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SettingsPanel as Settings Panel (mainPanel)
  participant Handler as MainPanel_SizeChanged
  participant GridCol0 as Grid Column 0
  participant Children as Column 0 Children

  User->>SettingsPanel: Resize window/panel
  SettingsPanel-->>Handler: SizeChanged event
  Handler->>Handler: Compute workingWidth = ActualWidth - VScrollBarWidth
  alt workingWidth > 0
    Handler->>GridCol0: Set MaxWidth = 0.6 * workingWidth
    Handler->>Children: For single-column-span items, set MaxWidth to column 0 MaxWidth
  else
    Handler->>GridCol0: No change
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • onesounds

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Improve JsonRPC Plugin Setting Panel" succinctly and accurately reflects the primary change in the changeset — UI improvements to the JsonRPC plugin settings panel (constraining the left column and updating text wrapping) — and is concise and clear enough for history scanning.
Description Check ✅ Passed The PR description clearly states the implemented changes (constraining column 0 to 60% and using wrap for text) and includes screenshots demonstrating the result, so it is directly related to the changeset and satisfies the lenient description check.

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.

@Jack251970 Jack251970 requested a review from Copilot September 15, 2025 10:48
@coderabbitai coderabbitai bot added the enhancement New feature or request label Sep 15, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (1)

204-216: Label text may still not wrap due to StackPanel measure; propagate MaxWidth to children.

In a vertical StackPanel, children are measured with infinite width, so TextBlocks won’t wrap even with TextWrapping unless their own width is constrained. Your handler sets MaxWidth on the column-0 container (the StackPanel), but not on its children. Also, avoid int-casting and subtracting scrollbar width (ScrollViewer usually already constrains ActualWidth).

Apply this diff to fix both points:

@@
-            var workingWidth =
-                (int)(grid.ActualWidth - SystemParameters.VerticalScrollBarWidth); // take into account vertical scrollbar
+            // Use the actual available width; ScrollViewer's viewport already excludes the vertical scrollbar.
+            var workingWidth = grid.ActualWidth;
@@
-            var constrainedWidth = MainGridColumn0MaxWidthRatio * workingWidth;
+            var constrainedWidth = MainGridColumn0MaxWidthRatio * workingWidth;
@@
-            grid.ColumnDefinitions[0].MaxWidth = constrainedWidth;
-            foreach (var child in grid.Children)
-            {
-                if (child is FrameworkElement element && Grid.GetColumn(element) == 0 && Grid.GetColumnSpan(element) == 1)
-                {
-                    element.MaxWidth = constrainedWidth;
-                }
-            }
+            grid.ColumnDefinitions[0].MaxWidth = constrainedWidth;
+            foreach (var child in grid.Children)
+            {
+                if (child is FrameworkElement element && Grid.GetColumn(element) == 0 && Grid.GetColumnSpan(element) == 1)
+                {
+                    element.MaxWidth = constrainedWidth;
+                    // Important: StackPanel gives infinite width to children in the non‑stacking dimension.
+                    // Constrain descendants so TextBlocks actually wrap.
+                    if (element is Panel p) PropagateMaxWidthToChildren(p, constrainedWidth);
+                }
+            }
+
+            static void PropagateMaxWidthToChildren(Panel panel, double width)
+            {
+                foreach (var c in panel.Children)
+                {
+                    if (c is FrameworkElement fe)
+                    {
+                        fe.MaxWidth = width;
+                        if (fe is Panel nested) PropagateMaxWidthToChildren(nested, width);
+                    }
+                }
+            }

Also applies to: 503-524

♻️ Duplicate comments (1)
Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (1)

494-494: Event handler detachment concern previously discussed.

This was flagged before; author marked “No need”. Given the panel and handler share the same lifetime via the returned UserControl, acceptable to proceed.

🧹 Nitpick comments (2)
Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (2)

274-276: Don’t wrap file/folder path inputs.

Paths are easier to scan and edit as single‑line. Suggest disabling wrapping here.

Apply this diff:

-                                ToolTip = attributes.Description,
-                                TextWrapping = TextWrapping.Wrap
+                                ToolTip = attributes.Description,
+                                TextWrapping = TextWrapping.NoWrap

251-253: Check intent: TextBox wrapping without AcceptsReturn is typically a no‑op.

If you want multi‑line behavior for generic “input”, set AcceptsReturn = true (and adjust height). Otherwise, consider dropping TextWrapping to avoid confusion.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51df66e and e571204.

📒 Files selected for processing (1)
  • Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (8 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3593
File: Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs:143-165
Timestamp: 2025-09-13T06:04:26.965Z
Learning: In Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml, the ListView_SizeChanged handler in the C# file assumes 5 GridViewColumns but the XAML may have more columns. The user Jack251970 indicated this mismatch doesn't need to be fixed when pointed out during PR #3593 review.
📚 Learning: 2025-09-13T06:04:26.965Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3593
File: Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs:143-165
Timestamp: 2025-09-13T06:04:26.965Z
Learning: In Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml, the ListView_SizeChanged handler in the C# file assumes 5 GridViewColumns but the XAML may have more columns. The user Jack251970 indicated this mismatch doesn't need to be fixed when pointed out during PR #3593 review.

Applied to files:

  • Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: gitStream.cm
  • GitHub Check: build
  • GitHub Check: Check Spelling
🔇 Additional comments (3)
Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (3)

30-30: Good: extracted width ratio constant.

Using a named constant improves clarity and makes future tweaks straightforward.


160-169: Grid column setup looks right.

Auto for labels + Star for inputs is appropriate for this layout.


339-343: Textarea change looks good.

TextWrapping + AcceptsReturn is correct for multi‑line inputs.

@Jack251970 Jack251970 requested a review from Copilot September 15, 2025 10:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Jack251970 Jack251970 merged commit 43e3376 into dev Sep 16, 2025
13 checks passed
@Jack251970 Jack251970 deleted the json_plugin_setting branch September 16, 2025 00:04
TBM13 pushed a commit to TBM13/Flow.Launcher that referenced this pull request Sep 17, 2025
…setting

Improve JsonRPC Plugin Setting Panel
@jjw24 jjw24 removed the enhancement New feature or request label Sep 18, 2025
@jjw24 jjw24 modified the milestones: 2.1.0, 2.0.1 Sep 21, 2025
jjw24 pushed a commit that referenced this pull request Sep 21, 2025
@jjw24 jjw24 mentioned this pull request Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/ui related to UI, icons, themes, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants