Improve the UX around post translation (#933)

This commit is contained in:
Jed Fox 2023-03-01 09:05:22 -05:00 committed by GitHub
parent b8f1304c56
commit 44f366083c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -483,9 +483,14 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
return
}
if let cell = cell as? StatusTableViewCell {
if case .translateStatus = action {
DispatchQueue.main.async {
cell.statusView.viewModel.isCurrentlyTranslating = true
if let cell = cell as? StatusTableViewCell {
cell.statusView.viewModel.isCurrentlyTranslating = true
} else if let cell = cell as? StatusThreadRootTableViewCell {
cell.statusView.viewModel.isCurrentlyTranslating = true
}
cell.invalidateIntrinsicContentSize()
}
}

View File

@ -463,12 +463,14 @@ extension StatusView.Style {
// status content
statusView.contentContainer.addArrangedSubview(statusView.contentMetaText.textView)
statusView.contentContainer.addArrangedSubview(statusView.statusCardControl)
// translated info
statusView.containerStackView.addArrangedSubview(statusView.isTranslatingLoadingView)
statusView.containerStackView.addArrangedSubview(statusView.translatedInfoView)
// link preview card
statusView.contentContainer.addArrangedSubview(statusView.statusCardControl)
statusView.spoilerOverlayView.translatesAutoresizingMaskIntoConstraints = false
statusView.containerStackView.addSubview(statusView.spoilerOverlayView)
statusView.contentContainer.pinTo(to: statusView.spoilerOverlayView)