Skip to content

fix(frontend): overlay main content with inbox when active#601

Open
dembrane-sam-bot wants to merge 1 commit into
mainfrom
sam/overlay-inbox-main-content
Open

fix(frontend): overlay main content with inbox when active#601
dembrane-sam-bot wants to merge 1 commit into
mainfrom
sam/overlay-inbox-main-content

Conversation

@dembrane-sam-bot
Copy link
Copy Markdown
Contributor

@dembrane-sam-bot dembrane-sam-bot commented May 27, 2026

What this changes

  • Inbox view overlays the main content on the right, keeping the sidebar layout completely untouched and avoiding any sidebar shift — BaseLayout.tsx
  • Inbox block in the sidebar stays active when the inbox overlay is active — InboxBlock.tsx
  • Inbox feed is beautifully centered with a maximum width of 2xl (672px) for maximum readability on wider desktop viewports — InboxView.tsx
  • URL state query parameter ?sidebar=inbox remains deep-linkable and shareable — useSidebarView.ts
  • Clicking the back arrow on the inbox overlay removes ?sidebar=inbox from the URL query parameters, automatically removing the overlay — useSidebarView.ts, BaseLayout.tsx

Confidence

Confidence: high. Built exactly according to Plan B + Sameer's overlay requirement. Verified the git diff and structural/indentation cleanliness.

Summary by CodeRabbit

  • New Features

    • Inbox now displays as an overlay on the main content area, allowing users to view inbox notifications without switching the sidebar view.
  • Refactor

    • Improved sidebar state management for better handling of overlay views.
    • Adjusted layout structure for enhanced overlay positioning and presentation.

Review Change Stack

- keep sidebar view/layout untouched when opening inbox
- overlay main content on the right with the inbox centered max-width feed
- back link on inbox feed removes overlay and returns to prior view
@github-actions
Copy link
Copy Markdown

Hi @dembrane-sam-bot!

Thank you for contributing to Dembrane ECHO! Before we consider your Pull Request, we ask that you sign our Contributor License Agreement (CLA). This is only required for your first Pull Request.

Please review the CLA, and sign it by adding your GitHub username to the contributors.yml file. Thanks!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Walkthrough

Inbox rendering shifts from AppSidebar's view-routing system to an overlay mode: ResolvedSidebarView gains an overlay field, sidebar resolution sets it for inbox/help modes, AppSidebar drops inbox routing, InboxBlock reads overlay state instead, and BaseLayout conditionally renders InboxView as an absolutely positioned overlay.

Changes

Inbox Overlay Mode

Layer / File(s) Summary
Sidebar view type and resolution logic
echo/frontend/src/features/sidebar/types.ts, echo/frontend/src/features/sidebar/hooks/useSidebarView.ts
ResolvedSidebarView adds optional overlay field ("inbox" | "help" | null), and resolveSidebarView sets it when resolving overlay-mode routes.
Sidebar component overlay integration
echo/frontend/src/features/sidebar/AppSidebar.tsx, echo/frontend/src/features/sidebar/blocks/InboxBlock.tsx
AppSidebar removes the inbox view case and its InboxView import; InboxBlock switches from view === "inbox" to overlay === "inbox" for determining active state.
BaseLayout overlay rendering
echo/frontend/src/components/layout/BaseLayout.tsx
BaseLayout imports useSidebarView, reads the overlay value, adds relative to <main> for positioning context, and conditionally renders a full-inset absolute InboxView wrapper when overlay === "inbox".
InboxView layout refinement
echo/frontend/src/features/sidebar/views/InboxView.tsx
Refactors JSX structure to wrap content in a centered outer div and updates nav classes to constrain width and padding consistently.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Dembrane/echo#585: The main PR's inbox overlay changes directly build on the sidebar introduced in PR #585 by modifying the existing AppSidebar, useSidebarView/ResolvedSidebarView view-resolution logic, and InboxBlock behavior for the inbox overlay mode.
  • Dembrane/echo#594: Both PRs affect how the sidebar "inbox/help" routing state is interpreted—main PR introduces an overlay-based inbox/help mode via useSidebarView/InboxBlock, while the retrieved PR updates AppBreadcrumbs logic for the inbox/help view cases—so breadcrumb behavior can depend on the same inbox/help sidebar resolution changes.

Suggested labels

bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making the inbox overlay the main content when active, which is the core objective across all modified files.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sam/overlay-inbox-main-content

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.

@coderabbitai coderabbitai Bot added the bug Something isn't working label May 27, 2026
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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@echo/frontend/src/components/layout/BaseLayout.tsx`:
- Around line 56-63: Wrap the overlay container for the InboxView with proper
ARIA attributes to make it a announced modal: add role="dialog" and
aria-modal="true" to the div, and provide either aria-labelledby pointing to a
heading ID inside InboxView (create a unique id in InboxView and reference it)
or an aria-label like "Inbox" on the wrapper; also ensure the wrapper is
focusable (e.g., tabIndex={-1}) so you can move focus into it when opened.
Reference the overlay variable and the InboxView component inside BaseLayout to
locate where to add these attributes.

In `@echo/frontend/src/features/sidebar/types.ts`:
- Line 26: Remove the redundant "| null" from the overlay property type so it
reads overlay?: "inbox" | "help"; — update the declaration that currently shows
overlay?: "inbox" | "help" | null; (in
echo/frontend/src/features/sidebar/types.ts) and ensure any code that may rely
on explicit null handling instead treats absent values as undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a038dbcf-aa2b-48fc-9236-6f692f1f334d

📥 Commits

Reviewing files that changed from the base of the PR and between b12baf5 and 7c48fa3.

📒 Files selected for processing (6)
  • echo/frontend/src/components/layout/BaseLayout.tsx
  • echo/frontend/src/features/sidebar/AppSidebar.tsx
  • echo/frontend/src/features/sidebar/blocks/InboxBlock.tsx
  • echo/frontend/src/features/sidebar/hooks/useSidebarView.ts
  • echo/frontend/src/features/sidebar/types.ts
  • echo/frontend/src/features/sidebar/views/InboxView.tsx
💤 Files with no reviewable changes (1)
  • echo/frontend/src/features/sidebar/AppSidebar.tsx

Comment on lines +56 to +63
{overlay === "inbox" && (
<div
className="absolute inset-0 z-50 flex flex-col overflow-hidden"
style={{ backgroundColor: "var(--app-background)" }}
>
<InboxView />
</div>
)}
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add ARIA attributes to the overlay wrapper.

Screen readers need semantic hints to announce the overlay properly.

♿ Suggested a11y improvement
  {overlay === "inbox" && (
    <div
      className="absolute inset-0 z-50 flex flex-col overflow-hidden"
      style={{ backgroundColor: "var(--app-background)" }}
+     role="dialog"
+     aria-label="Inbox"
    >
      <InboxView />
    </div>
  )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{overlay === "inbox" && (
<div
className="absolute inset-0 z-50 flex flex-col overflow-hidden"
style={{ backgroundColor: "var(--app-background)" }}
>
<InboxView />
</div>
)}
{overlay === "inbox" && (
<div
className="absolute inset-0 z-50 flex flex-col overflow-hidden"
style={{ backgroundColor: "var(--app-background)" }}
role="dialog"
aria-label="Inbox"
>
<InboxView />
</div>
)}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@echo/frontend/src/components/layout/BaseLayout.tsx` around lines 56 - 63,
Wrap the overlay container for the InboxView with proper ARIA attributes to make
it a announced modal: add role="dialog" and aria-modal="true" to the div, and
provide either aria-labelledby pointing to a heading ID inside InboxView (create
a unique id in InboxView and reference it) or an aria-label like "Inbox" on the
wrapper; also ensure the wrapper is focusable (e.g., tabIndex={-1}) so you can
move focus into it when opened. Reference the overlay variable and the InboxView
component inside BaseLayout to locate where to add these attributes.

projectId?: string;
section?: string;
};
overlay?: "inbox" | "help" | null;
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 | 🔵 Trivial | 💤 Low value

Optional: | null is redundant in the type union.

Since the field is already optional, it can be undefined. The codebase never explicitly sets overlay to null—it's either "inbox", "help", or omitted. Cleaner type:

-  overlay?: "inbox" | "help" | null;
+  overlay?: "inbox" | "help";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
overlay?: "inbox" | "help" | null;
overlay?: "inbox" | "help";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@echo/frontend/src/features/sidebar/types.ts` at line 26, Remove the redundant
"| null" from the overlay property type so it reads overlay?: "inbox" | "help";
— update the declaration that currently shows overlay?: "inbox" | "help" | null;
(in echo/frontend/src/features/sidebar/types.ts) and ensure any code that may
rely on explicit null handling instead treats absent values as undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant