Skip to content

Narrow source tab transcription interface - #38

Merged
makoMakoGo merged 1 commit into
mainfrom
codex/source-tab-interface
Jun 10, 2026
Merged

makoMakoGo merged 1 commit into
mainfrom
codex/source-tab-interface

Conversation

@makoMakoGo

@makoMakoGo makoMakoGo commented Jun 9, 2026 •

Copy link
Copy Markdown
Owner

对应 Issue

Closes #27

变更

  • SourceTab 改为显式 props,不再通过 Pick<ReturnType<typeof useTranscriptionFlow>> 绑定整个转录 hook 返回形状。
  • SourceTab 只接收渲染所需的输入状态、运行状态和少量用户动作。
  • Home 不再为来源页派生 canTranscribe / indeterminate progress,而是把展示所需状态传给 SourceTab,由来源页组件完成本地展示判断。
  • Home 的 ASR key 判断改为复用 hasAsrApiKey。

验证

  • npm test
  • npm run build

依赖

Summary by Sourcery

Narrow the SourceTab transcription interface to explicit UI state and actions and simplify its integration in Home.

Enhancements:

  • Refine SourceTab props to accept only display-related input/run state and UI actions instead of the full transcription hook.
  • Compute canTranscribe and progress display locally within SourceTab based on provided state.
  • Reuse centralized ASR API key detection via hasAsrApiKey in Home and pass minimal state into SourceTab.

@sourcery-ai

sourcery-ai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Refactors the SourceTab component to take a narrow, explicit UI contract instead of the full transcription hook, moving derived state (canTranscribe, progress) into SourceTab and reusing a shared hasAsrApiKey helper in Home while wiring the hook’s fields into the new props shape.

File-Level Changes

Change Details Files
Narrow SourceTab’s interface to explicit input/run state and action callbacks instead of passing the full transcription hook return value.
  • Replace Pick<ReturnType>-based props with typed SourceTabInputState, SourceTabRunState, and SourceTabActions structures.
  • Make file input ref, input/run state, and action callbacks explicit props on SourceTab.
  • Update all internal references from transcriptionFlow.* to fileInputRef, input, run, and actions.*.
components/SourceTab.tsx
Move presentation-only derived state (canTranscribe, indeterminate progress) into SourceTab and keep Home focused on wiring and shared helpers.
  • Compute canTranscribe locally in SourceTab based on run.audioInfo, hasApiKey, and run.loading.
  • Compute showIndeterminateProgress inside SourceTab using run.status and run.uploadProgress.
  • Remove canTranscribe and showIndeterminateProgress props from SourceTab’s public API and corresponding usage in Home.
  • In Home, replace manual API key string check with reusable hasAsrApiKey(settingsState.settings) helper and adapt SourceTab invocation to the new props shape.
components/SourceTab.tsx
app/page.tsx

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e088cc3f-436b-4fe3-ae7a-eb49f345e42e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/source-tab-interface

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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors how transcription flow state and actions are passed from the Home page to the SourceTab component. Instead of passing the entire transcriptionFlow object, the props are now grouped into nested input, run, and actions objects, and some local state derivations are moved directly into SourceTab. The reviewer suggests flattening these props instead of grouping them into nested objects, as creating new object literals on every render in the parent component degrades performance by breaking reference stability and rendering optimizations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread components/SourceTab.tsx Outdated
Comment thread app/page.tsx Outdated

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@makoMakoGo

Copy link
Copy Markdown
Owner Author

Bot review 处理完毕:

  • Gemini:采纳 props 扁平化建议;SourceTab 仍使用显式 UI contract,不再依赖 useTranscriptionFlow 返回类型。
  • Sourcery:无行级反馈,仅 review guide。
  • CodeRabbit:目标分支非默认分支,自动 review skipped。

本地验证:npm test 通过;npm run build 通过。

@makoMakoGo

Copy link
Copy Markdown
Owner Author

Bot review 处理完毕:Gemini 关于 SourceTab props 扁平化的两条建议已采纳,threads 已 resolved;最新 npm test 与 npm run build 已通过,PR checks 当前全绿。

@makoMakoGo
makoMakoGo force-pushed the codex/remote-transcription-run branch from 3255cd0 to a951161 Compare June 10, 2026 09:40
@makoMakoGo
makoMakoGo force-pushed the codex/source-tab-interface branch from 2ba40c5 to 6677e7c Compare June 10, 2026 09:42
@makoMakoGo
makoMakoGo changed the base branch from codex/remote-transcription-run to main June 10, 2026 09:42
@makoMakoGo
makoMakoGo merged commit 4b05a92 into main Jun 10, 2026
3 checks passed
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.

收窄 SourceTab/Home 的转录 Interface

1 participant