Skip to content

fix: prevent Settings dialog deformation on long error messages - #219

Merged
jamiepine merged 2 commits into
spacedriveapp:mainfrom
Joelp03:fix/error-msg-dialog
Aug 8, 2026
Merged

fix: prevent Settings dialog deformation on long error messages#219
jamiepine merged 2 commits into
spacedriveapp:mainfrom
Joelp03:fix/error-msg-dialog

Conversation

@Joelp03

@Joelp03 Joelp03 commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Title: fix: prevent error message overflow in API modal

Description: This PR fixes a UI bug where long error strings, such as billing URLs, were overflowing the modal's horizontal boundaries. By applying overflow-hidden min-w-0 break-words, we ensure that the container respects its parent width regardless of the text length.

image image

Note

This fix adds text wrapping and overflow handling to error and success message containers in the Settings component. The change applies three CSS utilities—overflow-hidden, min-w-0, and break-words—to both the test result and message divs to prevent long text strings from breaking the modal layout.

Written by Tembo for commit 39f75c7d.

@coderabbitai

coderabbitai Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ec9277e-f8ee-49a8-a088-8dc6471e2426

📥 Commits

Reviewing files that changed from the base of the PR and between f7e97be and 7930184.

📒 Files selected for processing (1)
  • interface/src/routes/Settings.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • interface/src/routes/Settings.tsx

Walkthrough

Settings.tsx adds overflow containment and word-wrapping classes to the test result and status message blocks. The change updates UI styling only.

Changes

Settings text layout

Layer / File(s) Summary
Contain long Settings text
interface/src/routes/Settings.tsx
The testResult and message blocks now use overflow-hidden, min-w-0, and break-words.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes preventing long error messages from deforming the Settings dialog.
Description check ✅ Passed The description directly explains the UI overflow bug and the CSS changes that fix it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
interface/src/routes/Settings.tsx (1)

714-723: Consider applying the same overflow fix consistently and extracting a shared component.

The five message blocks in ApiKeysSection (Line 715), ServerSection (Line 878), WorkerLogsSection (Line 997), OpenCodeSection (Line 1222), and ConfigFileSection (Line 1419) are structurally identical to the two fixed ones but still lack min-w-0 break-words. A long API error response containing a URL in those sections would reproduce the same overflow bug.

Extracting a small shared component would eliminate all the duplication and make this fix universal in one place:

♻️ Suggested shared component + usage
+function MessageBanner({ text, type }: { text: string; type: "success" | "error" }) {
+  return (
+    <div
+      className={`rounded-md border px-3 py-2 text-sm min-w-0 break-words ${
+        type === "success"
+          ? "border-green-500/20 bg-green-500/10 text-green-400"
+          : "border-red-500/20 bg-red-500/10 text-red-400"
+      }`}
+    >
+      {text}
+    </div>
+  );
+}

Then replace each repetition, e.g. in ApiKeysSection:

-{message && (
-  <div
-    className={`mt-4 rounded-md border px-3 py-2 text-sm ${
-      message.type === "success"
-        ? "border-green-500/20 bg-green-500/10 text-green-400"
-        : "border-red-500/20 bg-red-500/10 text-red-400"
-    }`}
-  >
-    {message.text}
-  </div>
-)}
+{message && <div className="mt-4"><MessageBanner text={message.text} type={message.type} /></div>}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@interface/src/routes/Settings.tsx` around lines 714 - 723, Several identical
message blocks in ApiKeysSection, ServerSection, WorkerLogsSection,
OpenCodeSection, and ConfigFileSection are missing the overflow guard (min-w-0
break-words) and should be unified: create a small shared component (e.g.,
MessageBox or AlertMessage) that accepts props like type and text and applies
the existing className plus "min-w-0 break-words" and then replace the inline
divs in the five sections with this component (update usages in ApiKeysSection,
ServerSection, WorkerLogsSection, OpenCodeSection, ConfigFileSection to pass
message.type and message.text).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@interface/src/routes/Settings.tsx`:
- Around line 714-723: Several identical message blocks in ApiKeysSection,
ServerSection, WorkerLogsSection, OpenCodeSection, and ConfigFileSection are
missing the overflow guard (min-w-0 break-words) and should be unified: create a
small shared component (e.g., MessageBox or AlertMessage) that accepts props
like type and text and applies the existing className plus "min-w-0 break-words"
and then replace the inline divs in the five sections with this component
(update usages in ApiKeysSection, ServerSection, WorkerLogsSection,
OpenCodeSection, ConfigFileSection to pass message.type and message.text).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8582124 and 39f75c7.

📒 Files selected for processing (1)
  • interface/src/routes/Settings.tsx

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@jamiepine jamiepine left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Relevance-checked: the unwrapped error boxes are still at Settings.tsx:885/901 on current main. CI green on repaired toolchain.

@jamiepine
jamiepine merged commit 27be126 into spacedriveapp:main Aug 8, 2026
5 checks passed
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.

2 participants