Skip to content

Conversation

@suryansh00001
Copy link
Contributor

@suryansh00001 suryansh00001 commented Oct 30, 2025

🐞 Related Issue

Fixes #543


📋 Summary

This PR fixes overlapping content and layout issues in the documentation site when viewed on smaller screens.


💡 Changes Made

  • Adjusted CSS grid/flex layout to ensure responsive scaling
  • Fixed text and image overlap in sections X and Y
  • Updated media queries for mobile breakpoints
  • Verified with Chrome DevTools (iPhone SE, Pixel 7, iPad Mini)

✅ Testing

  • Tested on mobile and tablet viewports
  • Verified that no elements overlap
  • Confirmed desktop layout remains unaffected

Summary by CodeRabbit

  • Style

    • Improved responsive layout for mobile and tablet; tables, images, and code blocks now scale, wrap, and scroll appropriately
    • API documentation constrained to a fixed, 500px-friendly presentation on very narrow viewports; header/footer and embedded docs align better
    • Footer social/icons centered and simplified on very small phones
  • Bug Fixes

    • Ensured the fixed-width API layout reliably activates across load timings to prevent layout flashes or misalignment

Added a wrapper and script to enhance API page styling.
Added responsive styles for headers, images, tables, and code blocks to improve layout on small screens.
@github-actions github-actions bot added UI documentation Improvements or additions to documentation enhancement New feature or request labels Oct 30, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 6bb4861 and cacf101.

📒 Files selected for processing (1)
  • docs/stylesheets/extra.css (1 hunks)
 ___________________________________
< Mission: Impossible - Rogue Code. >
 -----------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Tip

You can customize the tone of the review comments and chat replies.

Set the tone_instructions setting in your project's settings in CodeRabbit to customize the tone of the review comments and chat replies. For example, you can set the tone to Act like a strict teacher, Act like a pirate and more.

Walkthrough

Adds responsive CSS rules across multiple breakpoints and wraps the Python backend API reference in an .api-500-wrapper; a small script marks the page with body.api-fixed-500 on DOM availability to enforce a 500px constrained layout for that API page.

Changes

Cohort / File(s) Summary
API Reference Markup
docs/backend/backend_python/api.md
Wraps API content in a container with class api-500-wrapper and injects a script that adds api-fixed-500 to document.body once the DOM is ready; script includes guards for timing and errors.
Responsive Styling
docs/stylesheets/extra.css
Adds responsive CSS across breakpoints (<=768px, <=600px, <=480px) to hide social icons on small mobiles, scale/wrap headers, images, tables, and code blocks, make tables/code horizontally scrollable, adjust paddings and logo sizes, improve Swagger/OpenAPI/Redoc responsiveness, and introduce .api-500-wrapper & body.api-fixed-500 rules to constrain API page layout to 500px.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Browser
  participant DOM
  participant Script
  Note over Browser: Page load begins
  Browser->>DOM: Parse HTML
  DOM-->>Script: DOMContentLoaded (script runs)
  Script->>Browser: Add class "api-fixed-500" to body (guarded)
  alt Success
    Script-->>Browser: body has class, CSS rules apply (.api-500-wrapper constraints)
  else Failure
    Script-->>Browser: error caught, no class added
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • CSS changes cover many breakpoints and components—verify visual behavior across viewports.
  • Check the API page script for robustness across different load timings and theme integrations.
  • Inspect Swagger/Redoc selectors to ensure no regressions with theme updates.

Possibly related PRs

Poem

🐇 I hopped through CSS, soft and fleet,

Wrapped the API so small screens meet,
Tables scroll and logos shrink,
Redoc dances—no more clink,
A tiny rabbit's responsive treat 🥕✨

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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Fix #543: Improve documentation site responsiveness on mobile devices" directly corresponds to the main objective of the changeset. The title is clear, concise, and accurately summarizes the primary focus of the changes, which involve responsive CSS modifications and layout fixes to address mobile display issues in the documentation site. The title references the specific issue being fixed and clearly conveys the intent without being vague or overly generic.
Linked Issues Check ✅ Passed The code changes directly address the primary objective from issue #543 to improve documentation site responsiveness on mobile devices and fix overlapping content on smaller screens. The modifications to docs/stylesheets/extra.css introduce comprehensive responsive adjustments across multiple breakpoints (600px, 768px, 480px), including fixes for social icons, headers, images, tables, and code blocks on mobile. Additionally, the changes to docs/backend/backend_python/api.md add a 500px fixed-layout wrapper to handle responsive behavior on very small viewports. These changes align with the issue's reported problem of content overlap and the testing performed on mobile and tablet viewports as described in the PR.
Out of Scope Changes Check ✅ Passed All code changes in this pull request are directly related to the stated objective of improving documentation site responsiveness on mobile devices. The modifications are limited to CSS styling enhancements (docs/stylesheets/extra.css) and HTML/JavaScript adjustments for the Python backend API page (docs/backend/backend_python/api.md), both of which are necessary to address the responsive design issues identified in issue #543. There are no unrelated changes such as dependency updates, refactoring of unrelated features, or modifications to non-documentation areas.

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.

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8980d72 and c4542d3.

📒 Files selected for processing (2)
  • docs/backend/backend_python/api.md (1 hunks)
  • docs/stylesheets/extra.css (1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.28.0)
docs/stylesheets/extra.css

[high] 260-261: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 markdownlint-cli2 (0.18.1)
docs/backend/backend_python/api.md

4-4: Hard tabs
Column: 1

(MD010, no-hard-tabs)


9-9: Hard tabs
Column: 1

(MD010, no-hard-tabs)


10-10: Hard tabs
Column: 1

(MD010, no-hard-tabs)


11-11: Hard tabs
Column: 1

(MD010, no-hard-tabs)


12-12: Hard tabs
Column: 1

(MD010, no-hard-tabs)


13-13: Hard tabs
Column: 1

(MD010, no-hard-tabs)


14-14: Hard tabs
Column: 1

(MD010, no-hard-tabs)


15-15: Hard tabs
Column: 1

(MD010, no-hard-tabs)


16-16: Hard tabs
Column: 1

(MD010, no-hard-tabs)


17-17: Hard tabs
Column: 1

(MD010, no-hard-tabs)


18-18: Hard tabs
Column: 1

(MD010, no-hard-tabs)


19-19: Hard tabs
Column: 1

(MD010, no-hard-tabs)


20-20: Hard tabs
Column: 1

(MD010, no-hard-tabs)


21-21: Hard tabs
Column: 1

(MD010, no-hard-tabs)


22-22: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🔇 Additional comments (7)
docs/stylesheets/extra.css (6)

23-50: Base responsive foundations are well-structured. The image scaling (100% max-width), table horizontal scrolling, and code block wrapping follow best practices for mobile-friendly content. Padding adjustments to .md-main and .md-content provide consistent breathing room across breakpoints.


52-118: Tablet and phone breakpoints scale thoughtfully. The progression from 768px (tablet) to 480px (small phones) incrementally reduces header logo size (34px → 28px → 24px), adjusts title wrapping with white-space: normal, and uses flex-wrap strategically. Right-aligning actions via margin-left: auto on small phones prevents header overflow. These are solid mobile UX patterns.


120-156: 4-column home page layout reflow is well-designed. Using the attribute selector [style*="display:flex"] to target and override inline styles is pragmatic. The breakpoint progression (25% → 50% → 100%) ensures content reflows cleanly, and the h2 text alignment adjustment prevents awkward spacing on stacked layouts.


158-208: Swagger UI responsiveness covers key overlap scenarios. Flex-wrap on the topbar, word-break on text, wrapping operation summaries, and horizontal scroll on bodies/parameters prevent content overlap. The stacking at 720px ensures readability. These changes directly address the overlay issues mentioned in issue #543.


218-289: Consider the UX implications of the 500px fixed layout for the Python API page. This design constrains the header, main content, and footer to a fixed 500px pane on screens ≤500px with horizontal scrolling. While this ensures the API reference remains readable, it may feel restrictive compared to the adaptive responsive approach used elsewhere in the docs.

Questions to verify:

  • Is the 500px constraint necessary for the Swagger UI component to function properly, or is it a fallback?
  • Have you tested the scroll behavior and UX on actual devices (iPhone SE, Pixel 7) to confirm it's not jarring?
  • Should narrower devices (< 500px) fall back to full-width responsive instead of fixed-width scrolling?

If this is a deliberate choice to support legacy or very small devices, consider documenting the rationale in a comment or ADR so future maintainers understand the trade-off.


260-261: False positive from Gitleaks. Lines 260–261 are CSS selectors for .md-header and header elements within the .api-fixed-500 scope—not API keys or secrets. This can be safely ignored or suppressed in the security scanner configuration.

docs/backend/backend_python/api.md (1)

3-5: Wrapper markup is clean and appropriate. The .api-500-wrapper class provides a CSS hook that mirrors the styling scopes defined in extra.css. The structure maintains semantic clarity without introducing unnecessary complexity.

Copy link
Contributor

@rahulharpal1603 rahulharpal1603 left a comment

Choose a reason for hiding this comment

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

Image

Make this element centered for mobile devices.

center elements on small mobile viewports.
@suryansh00001
Copy link
Contributor Author

@rahulharpal1603 check

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: 1

🧹 Nitpick comments (2)
docs/stylesheets/extra.css (2)

11-13: Remove redundant visibility property.

When display: none is used, the element is removed from the document flow, making visibility: hidden unnecessary. Removing it simplifies the CSS without changing behavior.


131-167: Attribute selector approach works but is fragile.

Using div[style*="display:flex"] is a pragmatic workaround for overriding inline styles in docs/index.md, and the progressive breakpoints (25% → 50% → 100%) are sensible. However, this approach is brittle—any markup change (e.g., extra spaces: display: flex instead of display:flex) breaks the selector. If possible, consider adding a class to those divs instead (e.g., class="home-feature-grid") to decouple styling from inline attributes.

Can you verify that the inline styles in docs/index.md use the exact format display:flex (no spaces) to ensure the selector matches reliably?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4542d3 and 6bb4861.

📒 Files selected for processing (1)
  • docs/stylesheets/extra.css (2 hunks)
🧰 Additional context used
🪛 Gitleaks (8.28.0)
docs/stylesheets/extra.css

[high] 271-272: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (7)
docs/stylesheets/extra.css (7)

34-61: Core responsive utilities look good.

The image scaling, horizontal scrolling for tables/code, and content padding adjustments follow responsive design best practices. No concerns here.


64-97: Tablet breakpoint adjustments are well-structured.

Responsive scaling of logo/title, flex-wrap for header, and padding adjustments follow good practices. No issues identified.


100-129: Small phone adjustments are coherent and appropriate.

Progressive scaling of typography, spacing, and the use of margin-left: auto to right-align header actions are solid techniques. No concerns.


169-219: Swagger UI responsive fixes are comprehensive and well-targeted.

The rules progressively address wrapping, scrolling, and layout stacking without introducing conflicts. Good practices here.


221-227: Redoc responsive handling is consistent and minimal.

Mirrors the Swagger approach appropriately.


229-300: Verify the 500px minimum-width trade-off for very small viewports.

The API wrapper forces a 500px minimum width on screens ≤500px, requiring horizontal scroll rather than reflowing. This is a deliberate trade-off: API documentation stays readable at the cost of horizontal scrolling on very small devices (older phones, landscape mode).

Confirm with stakeholders that this trade-off aligns with accessibility and UX expectations. Consider whether a collapsed/accordion layout for very small screens might be preferable.


271-272: Gitleaks warning is a false positive.

The static analysis flagged lines 271-272 as a "Generic API Key," but these are CSS selectors (body.api-fixed-500 .md-footer__copyright). No credentials or secrets are present. Safe to dismiss.

@rahulharpal1603
Copy link
Contributor

Why are we hiding the icons?
Can't they be centered?

Removed CSS rules for hiding social icons on small mobile viewports and adjusted footer styles.
@suryansh00001
Copy link
Contributor Author

@rahulharpal1603 done sir .. My bad... I didn't see the structure properly

@rahulharpal1603 rahulharpal1603 merged commit cec1303 into AOSSIE-Org:main Nov 10, 2025
7 of 8 checks passed
Copy link
Contributor

@rahulharpal1603 rahulharpal1603 left a comment

Choose a reason for hiding this comment

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

Thanks @suryansh00001 !

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

Labels

documentation Improvements or additions to documentation enhancement New feature or request UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Improving documentation site's responsiveness.

2 participants