Skip to content

Rewrite LiveTranslationFeature to TCA #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

touyou
Copy link
Contributor

@touyou touyou commented Apr 10, 2025

I tried to rewrite LiveTranslationFeature into TCA (aligning it with the architecture of other features).
And also add #93 and #95 features.

480p.mov

I found an issue where the simulator build doesn’t run the translation after stopping debugging. However, this can also be reproduced on the main branch, so it doesn’t seem to be a critical problem.

@d-date
Copy link
Member

d-date commented Apr 10, 2025

Thank you! I'll check this PR after the conference. It seems to be what I desired 😍

}
case .view(.connectStream):
return .run { send in
await send(.connectChatStream)
Copy link
Member

Choose a reason for hiding this comment

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

Call function instead. Sending other action in send causes performance issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@d-date
Thank you. I rewrite it on b32d9b4 .
By the way, is it okay to dispatch another action within a function that is itself called by an action, such as in the case of handleResponseChat?

}

extension LiveTranslationServiceClient: DependencyKey {
static func live() -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

Use liveValue directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@d-date Rewrote it on 7d53241

Comment on lines 16 to 19
var liveTranslation = LiveTranslation.State(
roomNumber: ProcessInfo.processInfo.environment["LIVE_TRANSLATION_KEY"]
?? (Bundle.main.infoDictionary?["Live translation room number"] as? String) ?? ""
)
Copy link
Member

Choose a reason for hiding this comment

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

Extract to BulidConfig, which defined as Dependency Client.
See how it works at isowords:

https://github.com/pointfreeco/isowords/tree/main/Sources/Build

Build is preserved in .gitignore so use BuildConfig instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@d-date I tried to write it on cf9000e.

@touyou touyou requested a review from d-date April 15, 2025 13:37
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.

2 participants