mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* make the labs card copy plain Rewrite the Labs card titles and lines in words a regular user understands: YOLO mode says the message sends itself, Live text and Failure notices name the small recording indicator, Vocabulary help says which speech models it affects, and the key-side cards name Option, Command, Shift, and Control. Audit every other card, updating the CLI descriptions, all nine translated languages, the website lab catalog, the feature docs, and the render goldens. * fix labs copy review findings Restore the ISO qualifier on the section-key card, spell out that double-tap and hold-through shortcuts contain no letter or number key, cover all Global mode stages in the API text card, and name the print command in the print-start copy. Restore the developer API card titles, fix the Annotate capture wording, and retranslate the affected strings. Remove every replaced translation key and stale lab-name reference. * fix second labs copy review Update the live typing test and YOLO goldens. Add a Windows variant of the hold-through-keys copy naming Ctrl, Alt, Shift, and the Windows key. Remove the last unused rewrite-by-voice translation key, keep Annotate untranslated in the replay title, and clean the remaining old lab-name comments. * use the Polish Annotate pane name in its replay title Polish calls the Annotate pane Adnotacje, so the Annotate last 15 seconds title says Ostatnie 15 sekund w Adnotacjach again. Other languages keep Annotate because their pane name is Annotate.
35 lines
1.3 KiB
Rust
35 lines
1.3 KiB
Rust
//! Labs › Copy a capture as one file: a written Annotate capture goes on the
|
||
//! clipboard as one light zip file instead of its image and summary, so it
|
||
//! attaches anywhere, including agent apps whose server runs elsewhere.
|
||
|
||
use std::path::Path;
|
||
|
||
/// Copies `bundle` as `<folder name>.scrawl.slim.zip` while the lab is on;
|
||
/// false leaves the caller to copy it as before. A failed build or clipboard
|
||
/// write is logged and reads false too, so the normal copy still happens.
|
||
pub(crate) fn copy_as_zip(bundle: &Path) -> bool {
|
||
if cfg!(test) || !crate::labs::copy_capture_zip() {
|
||
return false;
|
||
}
|
||
match write_and_copy(bundle) {
|
||
Ok(()) => true,
|
||
Err(error) => {
|
||
tracing::warn!(
|
||
error = format!("{error:#}"),
|
||
"could not copy the capture as a zip"
|
||
);
|
||
false
|
||
}
|
||
}
|
||
}
|
||
|
||
fn write_and_copy(bundle: &Path) -> anyhow::Result<()> {
|
||
let zip = scrawl_capture::slim_zip::write(bundle)?;
|
||
#[cfg(target_os = "macos")]
|
||
scrawl_capture::handoff::copy_file_to_clipboard(&zip)?;
|
||
#[cfg(target_os = "windows")]
|
||
scrawl_capture::win::clipboard::set_file(&zip)?;
|
||
#[cfg(target_os = "linux")]
|
||
crate::capture_host::with_linux_paster(|paster| paster.copy_file_uri(&zip))?;
|
||
Ok(())
|
||
}
|