Skip to content

Feat/gradio types - #1145

Open
desireddymohithreddy0925 wants to merge 13 commits into
itzzavdhesh:mainfrom
desireddymohithreddy0925:feat/gradio-types
Open

Feat/gradio types#1145
desireddymohithreddy0925 wants to merge 13 commits into
itzzavdhesh:mainfrom
desireddymohithreddy0925:feat/gradio-types

Conversation

@desireddymohithreddy0925

@desireddymohithreddy0925 desireddymohithreddy0925 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Description

This PR adds a .d.ts declaration file to strictly type the inputs and outputs of the custom @gradio/client wrapper used within the backend voice generation logic.

Fixes #757

🤔 Problem It Solves

Previously, developers modifying the voice engine integration had zero IDE auto-complete for the payloads expected by the Hugging Face space. This lack of type safety frequently led to typos and server crashes during development.

💡 Proposed Solution

  • Created server/types/gradio.d.ts to strictly define the shapes of the PredictPayload and PredictResponse interfaces based on the Chatterbox model's API documentation.
  • Documented each endpoint parameter with JSDoc comments to massively improve the developer experience (DX).
  • Applied JSDoc annotations inside voiceController.js and added a jsconfig.json so VSCode instantly provides rich IntelliSense without requiring a massive refactor of the backend to TypeScript.

✅ Acceptance Criteria

  • Type definition file is created.
  • VSCode correctly provides autocomplete for the Gradio endpoint parameters.
  • Comments are added explaining each parameter.

🌱 Contributor Checklist

  • I am participating via GSSoC
  • I have read the contribution guidelines
  • I checked for existing issues before creating this

Summary by cubic

Add strict TypeScript types and JSDoc for the backend @gradio/client wrapper to make TTS requests type-safe and IDE-friendly. Also enforces lint/format in CI and includes small UI/accessibility polish, with a repo-wide Prettier formatting pass.

  • New Features

    • Added server/types/gradio.d.ts with strict payload/response types; enabled IntelliSense via JSDoc and server/jsconfig.json.
    • Hardened TTS endpoints: optional client-supplied voice_id for re-clone and clear 404 when a voice isn’t cached (non-mock).
    • UI polish: keyboard-accessible voice tuning sliders and smoother video preview with requestVideoFrameCallback.
  • Dependencies

    • Introduced ESLint/Prettier CI (.github/workflows/lint.yml), eslint.config.js, .lintstagedrc, and npm scripts lint and format:check.
    • Applied a repo-wide Prettier formatting sweep for consistency.

Written for commit 4fb5f74. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the itzzavdhesh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@desireddymohithreddy0925, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 83e9473a-d5fa-403a-9d13-6f3b384fcb83

📥 Commits

Reviewing files that changed from the base of the PR and between e915118 and 4fb5f74.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • server/data/voiceforge.db is excluded by !**/*.db
📒 Files selected for processing (85)
  • .github/ISSUE_TEMPLATE/elusoc_bug_report.md
  • .github/ISSUE_TEMPLATE/elusoc_feature_request.md
  • .github/ISSUE_TEMPLATE/gssoc_bug_report.md
  • .github/ISSUE_TEMPLATE/gssoc_feature_request.md
  • .github/ISSUE_TEMPLATE/nsoc_bug_report.md
  • .github/ISSUE_TEMPLATE/nsoc_feature_request.md
  • .github/ISSUE_TEMPLATE/ssoc_bug_report.md
  • .github/ISSUE_TEMPLATE/ssoc_feature_request.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/PULL_REQUEST_TEMPLATE/elusoc.md
  • .github/PULL_REQUEST_TEMPLATE/gssoc.md
  • .github/PULL_REQUEST_TEMPLATE/nsoc.md
  • .github/PULL_REQUEST_TEMPLATE/ssoc.md
  • .github/workflows/lint.yml
  • .github/workflows/mentor-merge-eligibility.yml
  • .github/workflows/pr-review-handler.yml
  • .lintstagedrc
  • CONTRIBUTING.md
  • README.md
  • client/index.html
  • client/postcss.config.js
  • client/public/404.html
  • client/src/App.jsx
  • client/src/components/AudioTrimmer.jsx
  • client/src/components/FavoriteMessages.jsx
  • client/src/components/Footer.jsx
  • client/src/components/KeyboardShortcutsModal.jsx
  • client/src/components/LanguageSelector.jsx
  • client/src/components/MessageCard.jsx
  • client/src/components/PrivacyModeToggle.jsx
  • client/src/components/ProfileCard.jsx
  • client/src/components/QuickReplies.jsx
  • client/src/components/ReceiveProfileModal.jsx
  • client/src/components/ScrollToBottomButton.jsx
  • client/src/components/ScrollToTopButton.jsx
  • client/src/components/ShareProfileModal.jsx
  • client/src/components/SpeechHistory.jsx
  • client/src/components/TextToSpeech.jsx
  • client/src/components/ThemeContext.jsx
  • client/src/components/VideoPreview.jsx
  • client/src/components/VoiceForge.jsx
  • client/src/components/VoiceQuickSettings.jsx
  • client/src/components/VoiceRecorder.jsx
  • client/src/components/useToast.jsx
  • client/src/hooks/useSpeechHistory.js
  • client/src/hooks/useTTS.js
  • client/src/hooks/useVirtualCamera.js
  • client/src/hooks/useVoiceClone.js
  • client/src/main.jsx
  • client/src/pages/About.jsx
  • client/src/pages/Analytics.jsx
  • client/src/pages/Call.jsx
  • client/src/pages/Contributors.jsx
  • client/src/pages/Onboarding.jsx
  • client/src/pages/PrivacyPolicy.jsx
  • client/src/pages/Settings.jsx
  • client/src/styles.css
  • client/src/utils/audioExtractor.js
  • client/src/utils/audioProcessor.js
  • client/src/utils/db.js
  • client/src/utils/faceProcessor.js
  • client/src/utils/formatTime.js
  • client/src/utils/languages.js
  • client/src/utils/pitchShifter.js
  • client/src/utils/voiceSettings.js
  • client/src/utils/voiceSettings.test.js
  • client/src/utils/wavEncoder.js
  • client/src/utils/webrtc.js
  • client/tailwind.config.js
  • client/vite.config.js
  • docs/virtual-camera.md
  • eslint.config.js
  • package.json
  • playwright.config.js
  • pr_body.md
  • server/controllers/voiceController.js
  • server/index.js
  • server/jsconfig.json
  • server/middleware/upload.js
  • server/routes/voice.js
  • server/test/helpers.js
  • server/test/voiceController.mock-mode.test.js
  • server/test/voiceController.secure-id.test.js
  • server/types/gradio.d.ts
  • tests/permissions.spec.js
✨ 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.

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

✍️ DCO Sign-off Needed

Hey @desireddymohithreddy0925! 👋 One or more commits in this PR are missing a Signed-off-by: line.

Warning

How to fix:

For the latest commit:

git commit --amend --signoff
git push --force-with-lease

For multiple commits, replace N with the number to update:

git rebase --signoff HEAD~N
git push --force-with-lease

This comment will update automatically after you push.


🤖 VoiceForge Automation · Updates automatically on edits

@github-actions

Copy link
Copy Markdown

🛠️ PR Needs Updates

Hey @desireddymohithreddy0925! 👋 A few things need fixing before a mentor can review this PR.

Warning

  • Select a program PR template: GSSoC, NSOC, SSOC, or ELUSOC.
  • Use the mandatory VoiceForge PR template and keep all required sections.
  • Use a clear PR title, for example feat: add voice preview or [feature]: add voice preview.
  • This PR changes 87 files. VoiceForge keeps contributor PRs focused, so please recheck the changed files and reduce the PR to 13 files or fewer unless a maintainer explicitly approves the larger scope.

How to fix:

  • PR template: Use one complete program PR template and keep all required sections.
  • PR title: Use a clear title like fix: update onboarding progress bar or [bug refactor]: replace pending stream cache.
  • Large PR: Please recheck the changed files, remove accidental edits, and keep this contribution polished and focused on one approved issue. If the larger scope is truly needed, ask a mentor before continuing.
  • Program: Choose exactly one program: GSSoC, NSOC, SSOC, or ELUSOC.

Once fixed, the workflow re-runs automatically and pings the right mentor.


🤖 VoiceForge Automation · Updates automatically on edits

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread eslint.config.js
Comment thread package.json
Comment thread .github/workflows/lint.yml
Comment thread client/src/components/VideoPreview.jsx
Comment thread server/jsconfig.json
Comment thread client/src/components/VoiceRecorder.jsx
Comment thread client/src/pages/Contributors.jsx
@Itzzavdheshh

Copy link
Copy Markdown
Collaborator

Hi @desireddymohithreddy0925 Your PR has Branch Conflict please resolve them and ping me after! Thanks

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add strict TypeScript definitions (.d.ts) for the custom Gradio client wrapper .

2 participants