Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apps/desktop-gpui/locales/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,16 @@ description = "Den Link zum Teilen an Slack, Discord oder Ihren eigenen Webhook
name = "Slack beim Teilen benachrichtigen"

[main]


delete_recording_confirm = "Möchten Sie diese Aufnahme wirklich löschen?"
delete_screenshot_confirm = "Möchten Sie dieses Bildschirmfoto wirklich löschen?"

[main.network]
upload_check_failed = "Upload-Prüfung fehlgeschlagen - Support kontaktieren"
checking_upload = "Upload wird geprüft..."
upload_speed = "{speed} Mbps Upload"

[main.clean_capture]
title = "Halten Sie Ihre Aufnahme sauber"

Expand Down Expand Up @@ -3283,4 +3290,4 @@ no_resumable_state = "Für diese Aufnahme gibt es keinen fortsetzbaren Upload"
verification_failed = "Die Prüfung der Aufnahme ist fehlgeschlagen: {status}"

[message.cli]
binary_missing = "Mitgelieferte CLI unter {path} nicht gefunden"
binary_missing = "Mitgelieferte CLI unter {path} nicht gefunden"
9 changes: 8 additions & 1 deletion apps/desktop-gpui/locales/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,16 @@ description = "Send the share link to Slack, Discord, or your own webhook."
name = "Tell Slack when you share something"

[main]


delete_recording_confirm = "Are you sure you want to delete this recording?"
delete_screenshot_confirm = "Are you sure you want to delete this screenshot?"

[main.network]
upload_check_failed = "Upload check failed - contact support"
checking_upload = "Checking upload..."
upload_speed = "{speed} Mbps up"
Comment on lines +981 to +984

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.

P1 Desktop build fails

Adding [main.network] before the existing delete messages moves those keys into main.network in every locale. The generator therefore stops creating tr::main::delete_recording_confirm() and tr::main::delete_screenshot_confirm(), which existing callers still use. This breaks the desktop build.

Move the new table below both delete messages in all seven catalogs.

Knowledge Base Used: GPUI desktop client

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/locales/en.toml
Line: 977-980

Comment:
**Desktop build fails**

Adding `[main.network]` before the existing delete messages moves those keys into `main.network` in every locale. The generator therefore stops creating `tr::main::delete_recording_confirm()` and `tr::main::delete_screenshot_confirm()`, which existing callers still use. This breaks the desktop build.

Move the new table below both delete messages in all seven catalogs.

**Knowledge Base Used:** [GPUI desktop client](https://app.greptile.com/-/switch-tenant?tenant=cap&next=%2Fcustom-context%2Fknowledge-base%2Fcapsoftware%2Fcap%2F-%2Fdocs%2Fgpui-desktop-client.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.


[main.clean_capture]
title = "Keep your capture clean"

Expand Down Expand Up @@ -3285,4 +3292,4 @@ no_resumable_state = "This recording has no resumable upload state"
verification_failed = { text = "Recording verification failed: {status}", context = "{status} is a technical status, usually in English." }

[message.cli]
binary_missing = { text = "Bundled CLI binary not found at {path}", context = "{path} is a file path." }
binary_missing = { text = "Bundled CLI binary not found at {path}", context = "{path} is a file path." }
9 changes: 8 additions & 1 deletion apps/desktop-gpui/locales/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,16 @@ description = "Envía el enlace para compartir a Slack, Discord o tu propio webh
name = "Avisar a Slack cuando compartas algo"

[main]


delete_recording_confirm = "¿Seguro que quieres eliminar esta grabación?"
delete_screenshot_confirm = "¿Seguro que quieres eliminar esta captura de pantalla?"

[main.network]
upload_check_failed = "Error en la comprobación de subida - contacte con soporte"
checking_upload = "Comprobando subida..."
upload_speed = "{speed} Mbps de subida"

[main.clean_capture]
title = "Mantén limpia tu captura"

Expand Down Expand Up @@ -3283,4 +3290,4 @@ no_resumable_state = "Esta grabación no tiene una subida que se pueda reanudar"
verification_failed = "La verificación de la grabación ha fallado: {status}"

[message.cli]
binary_missing = "No se encontró la CLI incluida en {path}"
binary_missing = "No se encontró la CLI incluida en {path}"
9 changes: 8 additions & 1 deletion apps/desktop-gpui/locales/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,16 @@ description = "Envoyez le lien de partage à Slack, Discord ou votre propre webh
name = "Prévenir Slack quand vous partagez"

[main]


delete_recording_confirm = "Voulez-vous vraiment supprimer cet enregistrement ?"
delete_screenshot_confirm = "Voulez-vous vraiment supprimer cette capture d'écran ?"

[main.network]
upload_check_failed = "Échec du test de téléversement - contactez le support"
checking_upload = "Vérification du téléversement..."
upload_speed = "{speed} Mbps en téléversement"

[main.clean_capture]
title = "Gardez votre capture propre"

Expand Down Expand Up @@ -3283,4 +3290,4 @@ no_resumable_state = "Cet enregistrement n'a pas d'envoi pouvant reprendre"
verification_failed = "La vérification de l'enregistrement a échoué : {status}"

[message.cli]
binary_missing = "CLI intégrée introuvable dans {path}"
binary_missing = "CLI intégrée introuvable dans {path}"
9 changes: 8 additions & 1 deletion apps/desktop-gpui/locales/hi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,16 @@ description = "शेयर लिंक Slack, Discord या अपने व
name = "कुछ शेयर करने पर Slack को बताएँ"

[main]


delete_recording_confirm = "क्या आप वाकई यह रिकॉर्डिंग हटाना चाहते हैं?"
delete_screenshot_confirm = "क्या आप वाकई यह स्क्रीनशॉट हटाना चाहते हैं?"

[main.network]
upload_check_failed = "अपलोड जांच विफल - सहायता से संपर्क करें"
checking_upload = "अपलोड जांचा जा रहा है..."
upload_speed = "{speed} Mbps अपलोड"

[main.clean_capture]
title = "अपना कैप्चर साफ़ रखें"

Expand Down Expand Up @@ -3283,4 +3290,4 @@ no_resumable_state = "इस रिकॉर्डिंग का कोई ऐ
verification_failed = "रिकॉर्डिंग की जाँच विफल हुई: {status}"

[message.cli]
binary_missing = "{path} पर बंडल की गई CLI नहीं मिली"
binary_missing = "{path} पर बंडल की गई CLI नहीं मिली"
9 changes: 8 additions & 1 deletion apps/desktop-gpui/locales/ja.toml
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,16 @@ description = "共有リンクをSlack、Discord、または独自のWebhookに
name = "共有したらSlackに知らせる"

[main]


delete_recording_confirm = "この録画を削除してもよろしいですか?"
delete_screenshot_confirm = "このスクリーンショットを削除してもよろしいですか?"

[main.network]
upload_check_failed = "アップロードチェックに失敗しました - サポートにお問い合わせください"
checking_upload = "アップロードを確認中..."
upload_speed = "{speed} Mbps アップロード"

[main.clean_capture]
title = "余計なものを映さずに録画"

Expand Down Expand Up @@ -3283,4 +3290,4 @@ no_resumable_state = "この録画には再開できるアップロード状態
verification_failed = "録画の確認に失敗しました:{status}"

[message.cli]
binary_missing = "{path}に同梱のCLIが見つかりません"
binary_missing = "{path}に同梱のCLIが見つかりません"
9 changes: 8 additions & 1 deletion apps/desktop-gpui/locales/zh-CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,16 @@ description = "将分享链接发送到 Slack、Discord 或你自己的 Webhook
name = "分享内容时通知 Slack"

[main]


delete_recording_confirm = "确定要删除这段录制吗?"
delete_screenshot_confirm = "确定要删除这张截图吗?"

[main.network]
upload_check_failed = "上传检查失败 - 请联系支持"
checking_upload = "正在检查上传..."
upload_speed = "{speed} Mbps 上传"

[main.clean_capture]
title = "保持画面整洁"

Expand Down Expand Up @@ -3283,4 +3290,4 @@ no_resumable_state = "此录制没有可继续的上传状态"
verification_failed = "录制验证失败:{status}"

[message.cli]
binary_missing = "未在 {path} 找到内置的 CLI 程序"
binary_missing = "未在 {path} 找到内置的 CLI 程序"
35 changes: 35 additions & 0 deletions apps/desktop-gpui/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,41 @@ pub async fn authed_request_with(
Ok(response)
}

pub async fn authed_raw_request(
method: reqwest::Method,
path: &str,
content_type: &str,
body: Vec<u8>,
) -> Result<reqwest::Response, AuthApiError> {
let client = shared_api_client()?;
let (server, token) = if let Ok(context) = UPLOAD_REQUEST.try_with(Clone::clone) {
let token = context.credentials()?;
(context.server_url, token)
} else {
let auth = store::auth_snapshot();
(
normalize_server_url(&auth.server_url),
auth.token.ok_or(AuthApiError::InvalidAuthentication)?,
)
};
let url = format!("{server}{path}");
let request = apply_desktop_headers(client.request(method, url))
.header("Content-Type", content_type)
.body(body)
.bearer_auth(token);
let response = request.send().await.map_err(|error| {
if error.is_timeout() {
AuthApiError::Timeout
} else {
AuthApiError::Other(error.to_string())
}
})?;
if response.status() == reqwest::StatusCode::UNAUTHORIZED {
return Err(AuthApiError::InvalidAuthentication);
}
Ok(response)
}

pub fn process_auth_data(params: AuthParams) -> Result<(), String> {
let (secret, user_id) = match params {
AuthParams::ApiKey { api_key, user_id } => (json!({ "api_key": api_key }), user_id),
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop-gpui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ mod power;
mod presets;
mod style_presets;
mod project_save;
mod network_status;
mod recording;
mod screenshot;
mod screenshot_annotations;
Expand Down Expand Up @@ -405,6 +406,7 @@ fn main() {
platform::follow_system_reduce_motion(cx);

let session = RecordingSession::init(cx);
crate::network_status::NetworkStatus::init(cx);
crate::sign_in::SignIn::init(cx);
crate::feeds::Feeds::init(cx);
crate::media_access::MediaAccess::init(cx);
Expand Down Expand Up @@ -512,6 +514,7 @@ fn main() {
app_windows::schedule_launch_render_warmup(cx);
upload::queue::init(cx);
upload::instant_cleanup::init(cx);
network_status::spawn_monitor(cx);

// The app menu (and with it ⌘W/⌘M/⌘Q) and the status-bar item. Both
// reach into the window registry, so they come after it -- and the menu
Expand Down
29 changes: 29 additions & 0 deletions apps/desktop-gpui/src/main_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use crate::{
feeds::{self, Feeds},
library::{self, RecordingItem, ScreenshotItem},
media_access::MediaAccess,
network_status::{HealthStatus, NetworkStatus},
permissions::OSPermission,
recording,
session::{Phase, RecordingSession},
Expand Down Expand Up @@ -1110,6 +1111,8 @@ impl MainWindow {
// Track the app-scoped feeds: the camera bubble's close button
// deselects the camera there, and this window's selection has to
// follow. Repaints are gated to what is actually visible.
cx.observe(&NetworkStatus::global(cx), |_, _, cx| cx.notify())
.detach();
let feeds = Feeds::global(cx);
let mic_level = feeds.read(cx).mic_level().clone();
let microphone_level = cx.new(|cx| {
Expand Down Expand Up @@ -3085,6 +3088,7 @@ impl Render for MainWindow {
.when_some(self.idle_error(cx), |this, error| {
this.child(self.render_idle_error(error, cx))
})
.child(self.render_network_status(cx))
.on_key_down(cx.listener(|this, event: &gpui::KeyDownEvent, _, cx| {
if event.keystroke.key == "escape" && this.dismiss_main(cx) {
cx.stop_propagation();
Expand Down Expand Up @@ -3970,6 +3974,31 @@ impl MainWindow {
});
}

fn render_network_status(&self, cx: &mut Context<Self>) -> impl IntoElement {
let theme = self.theme;
let status = NetworkStatus::global(cx).read(cx);
let failed = status.health == HealthStatus::Failed;
let label = if failed {
tr::main::network::upload_check_failed().to_string()
} else {
match status.upload_mbps {
Some(mbps) => tr::main::network::upload_speed(&format!("{mbps:.1}")).to_string(),
None => tr::main::network::checking_upload().to_string(),
}
};
div()
.absolute()
.bottom(px(8.))
.left(px(8.))
.px_2()
.py_0p5()
.rounded_md()
.text_xs()
.bg(if failed { theme.red_9 } else { theme.gray_3 })
.text_color(if failed { theme.red_2 } else { theme.text_2 })
.child(label)
}

fn render_idle_error(&self, error: String, cx: &mut Context<Self>) -> impl IntoElement {
let theme = self.theme;
let copied = self.copied_error.as_deref() == Some(error.as_str());
Expand Down
Loading