Skip to content

feat: reposition search error toast to top-center#295

Open
rattnak wants to merge 3 commits into
ioflux-org:mainfrom
rattnak:feat/search-error-toast-261
Open

feat: reposition search error toast to top-center#295
rattnak wants to merge 3 commits into
ioflux-org:mainfrom
rattnak:feat/search-error-toast-261

Conversation

@rattnak

@rattnak rattnak commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Repositions the "not in schema" error toast from a fixed bottom-left position to a top-center portal-rendered toast. On mobile, the previous position overlapped with the zoom controls; on desktop, it appeared far from the search bar. The toast now renders via createPortal outside the ReactFlow DOM context with fixed positioning, keeping it visible and unobstructed on all screen sizes.

What kind of change does this PR introduce

Bug fix / UI improvement (no new features or breaking changes.)

Issue Number

Closes #261

Screenshots/Video

Screen.Recording.2026-04-05.at.8.28.08.PM.mov

Does this PR introduce a breaking change?

No

If relevant, did you update the documentation?

No

Summary by CodeRabbit

  • Bug Fixes
    • Repositioned the "not in schema" error notification to the top-center to avoid overlapping mobile zoom controls while staying close to the search bar on desktop.
  • Accessibility
    • Improved error popup accessibility and close control labeling for better screen reader support and clearer interaction.

@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd92bcfd-5b36-4468-8713-2bf4146514d8

📥 Commits

Reviewing files that changed from the base of the PR and between b09a548 and ce3ce19.

📒 Files selected for processing (1)
  • src/components/GraphView.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/GraphView.tsx

📝 Walkthrough

Walkthrough

Moves the "not in schema" error toast from an in-tree bottom position to a React portal at the top-center of the viewport, using fixed positioning, responsive top offsets, accessibility attributes, and a high z-index to avoid overlap with mobile zoom controls.

Changes

Cohort / File(s) Summary
Release metadata
\.changeset/tangy-words-flash.md
Adds a changeset marking a patch release for json-schema-studio documenting the UI change.
Error toast repositioning
src/components/GraphView.tsx
Replaced in-component absolute popup with a createPortal render to document.body; changed to fixed top-center placement, added role="alert", aria-live="assertive", aria-atomic="true", type="button"/aria-label on close, and z-[9999] stacking.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GraphView
    participant DocumentBody as "document.body (Portal Target)"
    User->>GraphView: trigger search -> not-in-schema error
    GraphView->>DocumentBody: createPortal(render error toast)
    DocumentBody-->>User: display top-center toast (fixed, high z-index)
    User->>DocumentBody: click close button
    DocumentBody->>GraphView: dispatch close callback (setShowErrorPopup(false))
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny toast hopped from low to high,
No longer lost where the zooms would vie,
Through a portal it flew to the top of the view,
Now errors are seen and the UX feels new! 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main UI change: repositioning the search error toast to top-center.
Description check ✅ Passed The description covers all required template sections with sufficient detail including summary, change type, issue closure, and breaking change status.
Linked Issues check ✅ Passed The code changes fully implement all requirements from issue #261: error toast repositioned to top-center, portal-rendered to avoid overlap with zoom controls on mobile and remain visible on desktop.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #261; the changeset file, portal implementation, accessibility attributes, and styling adjustments are all necessary for repositioning the error toast.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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 and usage tips.

@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Preview Deployed!

Item Status
Latest Deploy Visit Preview
Environment Preview (PR-295)
Action View Logs

Last updated at 2026-04-06T00:41:49Z

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (2)
src/components/GraphView.tsx (1)

407-415: Add alert semantics for better accessibility.

This error toast should expose live-region semantics, and the close button should have an explicit accessible label.

♿ Suggested accessibility tweak
-        <div className="fixed top-[120px] sm:top-[100px] left-1/2 -translate-x-1/2 flex gap-2 px-2 py-1 bg-red-500 text-white rounded-md shadow-lg z-[9999]">
+        <div
+          role="alert"
+          aria-live="assertive"
+          className="fixed top-[120px] sm:top-[100px] left-1/2 -translate-x-1/2 flex gap-2 px-2 py-1 bg-red-500 text-white rounded-md shadow-lg z-[9999]"
+        >
           <div className="text-sm font-medium tracking-wide font-roboto">
             {errorMessage}
           </div>
           <button
+            aria-label="Dismiss search error"
             className="cursor-pointer"
             onClick={() => setShowErrorPopup(false)}
           >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/GraphView.tsx` around lines 407 - 415, The error toast lacks
ARIA semantics and an accessible label for the close control: add live-region
attributes (e.g., role="alert" and aria-live="assertive" with
aria-atomic="true") to the container that renders errorMessage, and give the
close button a clear accessible name (e.g., add aria-label="Close error" and
ensure it is a real button element with type="button") so the CgClose control
and setShowErrorPopup handler are reachable and announced by assistive tech.
.changeset/tangy-words-flash.md (1)

5-5: Polish changelog sentence grammar for clarity.

Current line mixes verb forms; a small wording cleanup will read better in release notes.

✍️ Suggested wording
-move "not in schema" error toast to top-center via React portal by preventing overlap with zoom controls on mobile and keeps the toast near the search bar on desktop.
+Move the "not in schema" error toast to the top-center via a React portal to prevent overlap with zoom controls on mobile and keep it near the search bar on desktop.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/tangy-words-flash.md at line 5, The changelog line is
grammatically awkward; update the sentence in .changeset/tangy-words-flash.md so
it reads clearly and uses parallel verb forms—for example: "Move the 'not in
schema' error toast to the top-center via a React portal to prevent overlap with
mobile zoom controls and to keep the toast near the search bar on desktop."
Ensure the quoted phrase 'not in schema' remains intact and that the sentence
uses consistent tense and conjunctions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.changeset/tangy-words-flash.md:
- Line 5: The changelog line is grammatically awkward; update the sentence in
.changeset/tangy-words-flash.md so it reads clearly and uses parallel verb
forms—for example: "Move the 'not in schema' error toast to the top-center via a
React portal to prevent overlap with mobile zoom controls and to keep the toast
near the search bar on desktop." Ensure the quoted phrase 'not in schema'
remains intact and that the sentence uses consistent tense and conjunctions.

In `@src/components/GraphView.tsx`:
- Around line 407-415: The error toast lacks ARIA semantics and an accessible
label for the close control: add live-region attributes (e.g., role="alert" and
aria-live="assertive" with aria-atomic="true") to the container that renders
errorMessage, and give the close button a clear accessible name (e.g., add
aria-label="Close error" and ensure it is a real button element with
type="button") so the CgClose control and setShowErrorPopup handler are
reachable and announced by assistive tech.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9eb65a4c-ff8a-4a7b-a1d2-098d70d0ab89

📥 Commits

Reviewing files that changed from the base of the PR and between a173afb and b09a548.

📒 Files selected for processing (2)
  • .changeset/tangy-words-flash.md
  • src/components/GraphView.tsx

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.

Feat: Reposition search error toast to top-center for better accessibility

1 participant