Skip to content

Add ROI calculator to Overview section#4

Open
lbardet wants to merge 1 commit into
idos-network:masterfrom
lbardet:master
Open

Add ROI calculator to Overview section#4
lbardet wants to merge 1 commit into
idos-network:masterfrom
lbardet:master

Conversation

@lbardet

@lbardet lbardet commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds the idOS ROI calculator as a full-viewport page in the docs
  • Listed in the sidebar under Overview, below Market focus, as "ROI calculator"
  • Implemented as a standalone React page (src/pages/roi-calculator.js) with the calculator HTML embedded via iframe
  • The iframe fills the entire screen below the navbar — no title, breadcrumbs, or pagination chrome

Test plan

  • Navigate to /roi-calculator and confirm the calculator loads full-screen
  • Confirm "ROI calculator" appears in the sidebar under Overview, below Market focus
  • Confirm no horizontal or vertical scroll on the page

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced an interactive ROI calculator page to the documentation site, providing users with a dedicated resource for financial analysis and calculations.
  • Documentation

    • Updated the documentation index and site navigation to include the ROI calculator, making it easily discoverable from the main sidebar and navigation menu.

Embeds the idOS ROI calculator (github.com/lbardet/idos-roi-calculator) as a full-viewport iframe page, listed in the sidebar under Overview below Market focus.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@lbardet is attempting to deploy a commit to the idOS Engineering Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new Docusaurus page (roi-calculator.js) is added that renders a full-viewport iframe embedding /roi-calculator.html within the site layout. The page is registered in the sidebar as a link item and added to the SUMMARY.md table of contents.

Changes

ROI Calculator Page Addition

Layer / File(s) Summary
ROI calculator page, sidebar, and TOC
docusaurus-site/src/pages/roi-calculator.js, docusaurus-site/sidebars.ts, SUMMARY.md
New RoiCalculator default export renders a fixed-position, full-height iframe pointing to /roi-calculator.html inside site Layout with title/description metadata and no footer. Sidebar gains a link item at /roi-calculator labeled "ROI calculator", and SUMMARY.md adds the matching TOC bullet under OVERVIEW.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny hops in, builds a frame so neat,
An iframe of numbers, a calculator treat!
The sidebar links point, the TOC grows tall,
/roi-calculator.html answers the call.
🐇✨ ROI for all!

🚥 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 'Add ROI calculator to Overview section' directly and clearly describes the main change—adding a new ROI calculator feature to the documentation's Overview section, which aligns with all three 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 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.

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

Actionable comments posted: 4

🤖 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 `@docusaurus-site/src/pages/roi-calculator.js`:
- Around line 8-12: The hardcoded `top: 60` value in the style object is brittle
because it assumes a fixed navbar height and will require multiple updates if
the navbar height ever changes. Extract this `top: 60` offset into a shared
constant (either in a constants file or at the top of the file) or define it as
a CSS variable, then reference that constant or variable in the style object
instead of the hardcoded value. This ensures the navbar offset can be maintained
in a single location and keeps related values synchronized across the codebase.
- Around line 14-18: The iframe element in the roi-calculator.js file that loads
"/roi-calculator.html" is missing security hardening. Add a sandbox attribute
with the value allow-same-origin allow-scripts to the iframe element to restrict
its capabilities and reduce the attack surface. Additionally, if the ROI
calculator requires fullscreen functionality, add the allowFullscreen attribute
to the iframe as well.
- Line 1: Remove the React import statement from the top of the
roi-calculator.js file. The line importing React from 'react' is unnecessary
with React 19's modern JSX transform that Docusaurus 3.10.1 uses by default, and
removing it aligns with current React best practices.

In `@SUMMARY.md`:
- Line 9: The SUMMARY.md file contains a TOC entry referencing a non-existent
`roi-calculator.md` file, while the ROI calculator is actually implemented as a
React component and already registered in sidebars.ts. Remove the line `* [ROI
calculator](roi-calculator.md)` from SUMMARY.md since the entry is redundant
with the sidebar navigation and SUMMARY.md should only contain markdown-based
documentation entries, not React page routes.
🪄 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: 4c904c34-afd2-46be-8025-0065e0e78cba

📥 Commits

Reviewing files that changed from the base of the PR and between e0cb903 and a913a08.

📒 Files selected for processing (4)
  • SUMMARY.md
  • docusaurus-site/sidebars.ts
  • docusaurus-site/src/pages/roi-calculator.js
  • docusaurus-site/static/roi-calculator.html

@@ -0,0 +1,22 @@
import React from 'react';

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 | 🔵 Trivial | ⚡ Quick win

Remove unnecessary React import for React 19 compatibility.

With React 19's modern JSX transform enabled (which Docusaurus 3.10.1 uses by default), the React import on Line 1 is no longer required. Removing it aligns with current React 19 best practices.

♻️ Proposed fix
-import React from 'react';
 import Layout from '`@theme/Layout`';
📝 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
import React from 'react';
import Layout from '`@theme/Layout`';
🤖 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 `@docusaurus-site/src/pages/roi-calculator.js` at line 1, Remove the React
import statement from the top of the roi-calculator.js file. The line importing
React from 'react' is unnecessary with React 19's modern JSX transform that
Docusaurus 3.10.1 uses by default, and removing it aligns with current React
best practices.

Comment on lines +8 to +12
position: 'fixed',
top: 60,
left: 0,
right: 0,
bottom: 0,

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 | 🔵 Trivial | ⚖️ Poor tradeoff

Extract hardcoded navbar offset into a constant or CSS variable.

The top: 60 offset assumes a fixed navbar height, which creates fragility if the navbar height changes in the future. Consider extracting this to a shared constant or CSS variable that can be maintained centrally.

🤖 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 `@docusaurus-site/src/pages/roi-calculator.js` around lines 8 - 12, The
hardcoded `top: 60` value in the style object is brittle because it assumes a
fixed navbar height and will require multiple updates if the navbar height ever
changes. Extract this `top: 60` offset into a shared constant (either in a
constants file or at the top of the file) or define it as a CSS variable, then
reference that constant or variable in the style object instead of the hardcoded
value. This ensures the navbar offset can be maintained in a single location and
keeps related values synchronized across the codebase.

Comment on lines +14 to +18
<iframe
src="/roi-calculator.html"
style={{ width: '100%', height: '100%', border: 'none', display: 'block' }}
title="idOS ROI Calculator"
/>

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 | 🔵 Trivial | ⚡ Quick win

Add sandbox attribute to iframe for security; consider allowFullscreen if needed.

The iframe lacks a sandbox attribute, which is a security best practice even for internal content. This limits the attack surface if the embedded content is compromised. Additionally, if the ROI calculator UI requires fullscreen capability, the allowFullscreen attribute should be present.

🛡️ Proposed fix (with sandbox + allowFullscreen for full interactivity)
         <iframe
           src="/roi-calculator.html"
+          sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
+          allowFullscreen
           style={{ width: '100%', height: '100%', border: 'none', display: 'block' }}
           title="idOS ROI Calculator"
         />

If the calculator only needs to display static content without forms or popups, use:

sandbox="allow-same-origin allow-scripts"
📝 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
<iframe
src="/roi-calculator.html"
style={{ width: '100%', height: '100%', border: 'none', display: 'block' }}
title="idOS ROI Calculator"
/>
<iframe
src="/roi-calculator.html"
sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
allowFullscreen
style={{ width: '100%', height: '100%', border: 'none', display: 'block' }}
title="idOS ROI Calculator"
/>
🤖 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 `@docusaurus-site/src/pages/roi-calculator.js` around lines 14 - 18, The iframe
element in the roi-calculator.js file that loads "/roi-calculator.html" is
missing security hardening. Add a sandbox attribute with the value
allow-same-origin allow-scripts to the iframe element to restrict its
capabilities and reduce the attack surface. Additionally, if the ROI calculator
requires fullscreen functionality, add the allowFullscreen attribute to the
iframe as well.

Comment thread SUMMARY.md
* [Why idOS?](why-idos.md)
* [What is self-custodial data?](what-is-self-custodial-data.md)
* [Market focus](market-focus.md)
* [ROI calculator](roi-calculator.md)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix inconsistency: TOC entry references non-existent roi-calculator.md.

The SUMMARY.md entry links to roi-calculator.md, but the ROI calculator is implemented as a React page component (roi-calculator.js), not a markdown file. This creates a cross-file inconsistency with sidebars.ts, which correctly links to the /roi-calculator route.

SUMMARY.md is designed for markdown-based documentation, not React pages. Either:

  1. Remove the entry from SUMMARY.md (React pages don't belong in TOC), or
  2. Change the link to /roi-calculator to match the sidebar

Option 1 is recommended: since the ROI calculator is already registered in sidebars.ts and appears in the sidebar navigation, the TOC entry is redundant.

✏️ Proposed fix: Remove from TOC
 * [What is idOS?](README.md)
 * [Why idOS?](why-idos.md)
 * [What is self-custodial data?](what-is-self-custodial-data.md)
 * [Market focus](market-focus.md)
-* [ROI calculator](roi-calculator.md)
 * [Example use cases](example-use-cases/README.md)

Alternative fix: Link to route instead of markdown file

-* [ROI calculator](roi-calculator.md)
+* [ROI calculator](/roi-calculator)
🤖 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 `@SUMMARY.md` at line 9, The SUMMARY.md file contains a TOC entry referencing a
non-existent `roi-calculator.md` file, while the ROI calculator is actually
implemented as a React component and already registered in sidebars.ts. Remove
the line `* [ROI calculator](roi-calculator.md)` from SUMMARY.md since the entry
is redundant with the sidebar navigation and SUMMARY.md should only contain
markdown-based documentation entries, not React page routes.

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.

1 participant