Fix inbox empty-state alignment when sidebars are open#56
Conversation
The inbox view content used width: min(90vw, 1200px). 90vw follows the whole window, not the inbox panel, so with sidebars open the content overflowed the panel's right edge and the centred empty-state text drifted right of the panel centre. Size to the panel with width: 100%; max-width and margin: 0 auto still cap and centre on wide panels. Fixes #55
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe inbox modal layout is fixed to size relative to its container by changing the CSS width from a viewport-relative calculation to ChangesInbox Modal Layout Fix
🎯 2 (Simple) | ⏱️ ~5 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Problem
Reported in #55: "Your inbox is empty!" is off-centre when the Obsidian window/panel is narrower than the window — the content doesn't follow the main panel width.
Root cause
.flow-gtd-inbox-modal(the inbox view'scontentEl) usedwidth: min(90vw, 1200px).90vwis 90% of the whole window, not the inbox panel. When sidebars are open the panel is narrower than the window, socontentElstayed window-sized, overflowed past the panel's right edge, and the inner.flow-inbox-redesign(which centres the empty-state text withmargin: 0 auto) centred itself within that too-wide element — drifting the text right of the panel centre. The view title is drawn by Obsidian against the panel, hence the visible misalignment.Measured live with the right sidebar open: panel 498px (centre 249), but content centred at 405 and overflowing to 809px.
Fix
width: min(90vw, 1200px)→width: 100%. The element now follows its panel;max-width: 1200px+margin: 0 autostill cap and centre on very wide panels.After fix (sidebar open): content width 498 = panel 498, centre 249 = panel centre 249, no overflow. Full-width unaffected.
Tests
tests/inbox-modal-layout-style.test.ts(would fail on the old90vw).npm run format,npm run build,npm testall pass (917 tests).Fixes #55
Summary by CodeRabbit
Style
Tests