Skip to content

Narrow polish tab interfaces - #34

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

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

Conversation

@makoMakoGo

@makoMakoGo makoMakoGo commented Jun 9, 2026 •

Copy link
Copy Markdown
Owner

关联 issue

Refs #28

依赖关系

这个 PR 叠在 #32 (codex/polish-run-module) 之上,因为它收窄的是 #21 润色运行模块之后的 UI 消费接口。

#32 合并并 retarget 后,本 PR 再 rebase/retarget 到对应 base。

改动内容

  • TranscriptionTab 不再通过 ReturnType<typeof usePolishFlow> 派生 props,而是显式声明只需要 polishText 和 polishing。
  • PolishTab 不再通过 ReturnType<typeof usePolishFlow> 派生 props,而是显式声明润色页需要的最小 interface。
  • PolishTab 只依赖领域状态 PolishResult,避免重新耦合到 hook 的完整返回形状。

验证

  • rg "ReturnType<typeof usePolishFlow>|import type \\{ usePolishFlow \\}" components 无匹配
  • npm test
  • npm run build

Summary by Sourcery

Narrow the polish-related tab components to depend on explicit minimal polish flow interfaces instead of the full usePolishFlow hook return type.

Enhancements:

  • Define minimal, explicit polish flow prop types for PolishTab and TranscriptionTab instead of deriving them from usePolishFlow.
  • Limit PolishTab to depend only on the PolishResult domain state rather than the full hook return shape.

@sourcery-ai

sourcery-ai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Narrowed the polish-related props consumed by TranscriptionTab and PolishTab to small, explicit interfaces decoupled from the full usePolishFlow return type, and wired them to the domain-level PolishResult type instead of the hook.

File-Level Changes

Change Details Files
Narrowed and made explicit the polish-flow interface consumed by PolishTab, decoupling it from usePolishFlow and tying the result field to the domain-level PolishResult type.
  • Removed dependence on ReturnType and the associated Pick type for PolishTab props.
  • Introduced a concrete PolishTabPolishFlow interface with only the methods and flags actually used by the component.
  • Typed the result property as PolishResult from the transcription-state domain module, ensuring only domain data, not hook shapes, flow through the component.
components/PolishTab.tsx
Replaced the generic usePolishFlow-derived type in TranscriptionTab with a minimal explicit interface containing just the polish-related fields it uses.
  • Removed import and use of ReturnType in TranscriptionTab.
  • Defined TranscriptionTabPolishFlow as a simple object type with polishText and polishing only, matching the component’s actual usage.
  • Left the existing useTranscriptionFlow-based typing intact, keeping polish and transcription concerns clearly separated.
components/TranscriptionTab.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

Warning

Review limit reached

@makoMakoGo, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 32 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8957e61-5a5a-4c78-a6c7-98b9bd7cd5ee

📥 Commits

Reviewing files that changed from the base of the PR and between f485607 and 505b367.

📒 Files selected for processing (2)
  • components/PolishTab.tsx
  • components/TranscriptionTab.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polish-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 decouples the PolishTab and TranscriptionTab components from the usePolishFlow hook. Instead of deriving types using Pick<ReturnType<typeof usePolishFlow>, ...>, the types PolishTabPolishFlow and TranscriptionTabPolishFlow are now explicitly defined with their required properties. There are no review comments, and I have no feedback to provide.

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.

@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 left some high level feedback:

  • Now that TranscriptionTabPolishFlow and PolishTabPolishFlow both describe parts of the polish flow, consider extracting a shared interface/type (e.g. a smaller PolishActions type) to avoid duplicating the polishText/polishing shape in multiple components.
  • Since PolishTabPolishFlow is now a hand-written structural type, you may want to colocate it with the domain types (e.g. near PolishResult) or export it from a shared module so the hook and components depend on the same contract and are less likely to drift over time.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that `TranscriptionTabPolishFlow` and `PolishTabPolishFlow` both describe parts of the polish flow, consider extracting a shared interface/type (e.g. a smaller `PolishActions` type) to avoid duplicating the `polishText`/`polishing` shape in multiple components.
- Since `PolishTabPolishFlow` is now a hand-written structural type, you may want to colocate it with the domain types (e.g. near `PolishResult`) or export it from a shared module so the hook and components depend on the same contract and are less likely to drift over time.

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 无行动项。
  • Sourcery 建议抽共享 PolishActions / 共享 contract:不采纳。当前两个 Tab 的消费面不同,重复只有 polishText / polishing 两个字段;保留组件本地显式 contract 更贴合 收窄 TranscriptionTab/PolishTab 的润色 Interface #28 的目标,也避免为了少量重复引入新的共享 UI 类型耦合。
  • CodeRabbit 因 stacked PR base 非默认分支跳过 review,是模板消息,无可执行意见。

验证:rg "ReturnType<typeof usePolishFlow>|import type \\{ usePolishFlow \\}" components 无匹配,npm test、npm run build 均已通过。

@makoMakoGo
makoMakoGo force-pushed the codex/polish-run-module branch 2 times, most recently from aeaa7c4 to 2a2ece1 Compare June 10, 2026 09:47
@makoMakoGo
makoMakoGo force-pushed the codex/polish-tab-interface branch from 5ad235d to 505b367 Compare June 10, 2026 09:48
@makoMakoGo
makoMakoGo changed the base branch from codex/polish-run-module to main June 10, 2026 09:48
@makoMakoGo
makoMakoGo merged commit 4321ae7 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.

1 participant