Skip to content

Fix chart indicators disappearing in fullscreen#68

Open
keshav-005 wants to merge 2 commits into
Open-Dev-Society:mainfrom
keshav-005:fix-49-preserve-chart-indicators
Open

Fix chart indicators disappearing in fullscreen#68
keshav-005 wants to merge 2 commits into
Open-Dev-Society:mainfrom
keshav-005:fix-49-preserve-chart-indicators

Conversation

@keshav-005
Copy link
Copy Markdown
Contributor

@keshav-005 keshav-005 commented Apr 22, 2026

Summary

  • keep TradingView chart widgets mounted when toggling fullscreen
  • resize the existing widget container instead of reinitializing the embed, which preserves indicator state
  • use viewport height in fullscreen mode so the widget never initializes against a zero-height container

Test plan

  • npx eslint components/TradingViewWidget.tsx hooks/useTradingViewWidget.tsx
  • npx tsc --noEmit (currently fails on pre-existing errors in lib/inngest/functions.ts; not caused by this change)

Fixes #49

Summary by CodeRabbit

  • Bug Fixes

    • Fixed TradingView widget height rendering to properly display at full viewport dimensions when expanded.
  • Refactor

    • Simplified widget configuration and initialization by removing unnecessary resize event listeners and redundant state management, improving code efficiency and performance.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 22, 2026

@keshav-005 is attempting to deploy a commit to the ravixalgorithm's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34828ec0-9a19-4834-842f-c5b383bf20ca

📥 Commits

Reviewing files that changed from the base of the PR and between fe59884 and daa6f1b.

📒 Files selected for processing (2)
  • components/TradingViewWidget.tsx
  • hooks/useTradingViewWidget.tsx

📝 Walkthrough

Walkthrough

Simplifies TradingViewWidget height handling by removing dynamic height state management and parameter passing to the hook. The widget now uses viewport-based sizing (100vh when expanded) instead of computed heights, addressing the issue of indicators disappearing during full-screen transitions.

Changes

Cohort / File(s) Summary
Height Parameter Removal
components/TradingViewWidget.tsx, hooks/useTradingViewWidget.tsx
Removed dynamic height parameter and state logic from both component and hook. Component now controls sizing with 100vh for expanded state and height prop for compact state. Hook signature simplified to accept only scriptUrl and config. Eliminated resize listener and intermediate height computation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 When widgets grew too tall and indicators fled,
A simpler path emerged instead—
One hundred viewport heights so clear,
No dancing heights that disappear! ✨
Full-screen harmony is finally here!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: fixing chart indicators disappearing in fullscreen by preserving widget state during fullscreen toggle.
Linked Issues check ✅ Passed The pull request addresses the core objective from issue #49 by preserving chart indicators when toggling fullscreen through widget lifecycle management changes.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the indicator loss issue: modifying TradingViewWidget and useTradingViewWidget to preserve state and handle fullscreen sizing appropriately.
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.

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.

Indicators disappear when going full screen

1 participant