Skip to content
Merged
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
12 changes: 8 additions & 4 deletions .agents/skills/kindle-drop-ui/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Use exactly one term per concept.
| Concept | Use | Never |
|---|---|---|
| The action | Send, Sending, Send to Kindle | Upload, Drop, Push, Deliver |
| Converting the EPUB | Converting | Processing, Building |
| Converting the EPUB or article | Converting | Processing, Building |
| Sending to the mailbox | Uploading, with a percentage | Syncing |
| In the mailbox, Kindle asleep | Waiting for Kindle | Queued, Pending |
| The Kindle took it | On Kindle | Delivered, Synced, Done |
Expand All @@ -55,17 +55,17 @@ The mockups are in [mockups.html](mockups.html). Open it in a browser.
- A status chip at the top shows "Kindle checked in 2 h ago" with a green dot. When the Kindle hasn't checked in for more than a day, the dot turns amber and the chip stays neutral.
- Under a "Sending" section, each row has a cover, title, author, and a status line. Converting shows an indeterminate bar. Uploading shows a determinate bar and "Uploading · 46%". Waiting shows "Waiting for Kindle".
- Under a "Recent" section, rows show "On Kindle · Yesterday" or, for failures, "Couldn't convert · Tap for details" in the danger color. Recent keeps books for 30 days, the mailbox's lifetime. A long-press clears a row.
- The empty state has the title "No books yet", the line "Share an EPUB, AZW3, PDF, or TXT file from any app. It arrives the next time your Kindle wakes", and a "Choose a file" button.
- The empty state has the title "No books yet", the line "Share an EPUB, AZW3, PDF, or TXT file, or a link to an article, from any app. It arrives the next time your Kindle wakes", and a "Choose a file" button.

**Share sheet.** The app opens as a bottom sheet over the app you shared from.
- It shows the cover, title, author, and "EPUB · 9.1 MB", with **Send to Kindle** as the primary action and **Cancel** as a text button.
- It shows the cover, title, author, and "EPUB · 9.1 MB" (or "Article · example.com" for a shared link), with **Send to Kindle** as the primary action and **Cancel** as a text button.
- Conversion starts the moment the file arrives, so tapping Send feels instant. Cancel discards the conversion's output.
- After Send, the sheet closes and the source app stays in front.
- "Confirm before sending" is on by default. When it's off, sharing sends at once and shows a brief "Sending to Kindle" confirmation.

**Book** (detail).
- The cover, title, and author are centered at the top.
- A four-step timeline follows: Converted (size and time), Uploaded (time), Waiting for Kindle ("Arrives the next time your Kindle wakes"), and On Kindle. Only an EPUB is converted, so an AZW3, PDF, or TXT file starts at Uploaded.
- A four-step timeline follows: Converted (size and time), Uploaded (time), Waiting for Kindle ("Arrives the next time your Kindle wakes"), and On Kindle. Only an EPUB or an article is converted, so an AZW3, PDF, or TXT file starts at Uploaded.
- The one action is "Cancel sending" while the book is waiting. For a failure, show the error copy and "Try again".

**First run** (Connect your Kindle).
Expand All @@ -87,6 +87,8 @@ At the bottom is "Disconnect Kindle" in the danger color, behind a confirmation
|---|---|
| Conversion failed | Couldn't convert this book. Try another copy of the file. |
| Unsupported file | Dropcap sends EPUB, AZW3, PDF, and TXT files. |
| Article failed, offline | Couldn't load this article. Sending resumes when you're back online. |
| Article failed, no article on the page | Couldn't find an article on this page. Try another link. |
| Upload failed, offline | Couldn't upload. Dropcap retries when you're back online. |
| Upload failed, server | Couldn't upload. Try again in a few minutes. |
| Pairing code unreadable | This isn't a Dropcap pairing code. |
Expand Down Expand Up @@ -114,6 +116,8 @@ At the bottom is "Disconnect Kindle" in the danger color, behind a confirmation
| Shared file unreadable | Couldn't open this file. Try sharing it again. |
| Share sheet, not connected | Title "Connect your Kindle", body "Scan the pairing code from your computer, then share the book again", actions **Connect Kindle** and **Cancel** |
| Share sheet, unsupported file | Title is the file's name, body is the unsupported file copy, action **Close** |
| Share sheet, text without a link | Title is the shared subject or "Shared text", body "This text has no link to an article. Share the page from your browser.", action **Close** |
| Share sheet, article offline | The article failed offline copy, with **Send to Kindle** still available |
| Book, timeline failure | "Couldn't convert" or "Couldn't upload" under the step that failed |
| Book, canceled | "Sending canceled · 28 Oct, 10:05 am" under Waiting for Kindle |
| Book, missing | Title "Book not found", body "It may have been cleared from Recent" |
Expand Down
36 changes: 36 additions & 0 deletions apps/mobile/modules/kindle-core/cpp/generated/kindle_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ extern "C" {
uint64_t callback_data,
UniffiForeignFutureResultVoid result
);
/*handle*/ uint64_t uniffi_kindle_core_fn_func_convert_article(
RustBuffer url,
RustBuffer out_dir
);
/*handle*/ uint64_t uniffi_kindle_core_fn_func_convert_epub(
RustBuffer epub_path,
RustBuffer out_dir
Expand Down Expand Up @@ -334,6 +338,8 @@ extern "C" {
/*handle*/ uint64_t handle,
RustCallStatus *uniffi_out_err
);
uint16_t uniffi_kindle_core_checksum_func_convert_article(
);
uint16_t uniffi_kindle_core_checksum_func_convert_epub(
);
uint16_t uniffi_kindle_core_checksum_func_device_thumbnail(
Expand Down Expand Up @@ -1838,6 +1844,14 @@ NativeKindleCore::NativeKindleCore(
return this->cpp_uniffi_internal_fn_func_ffi__read_string_from_buffer(rt, thisVal, args, count);
}
);
props["ubrn_uniffi_kindle_core_fn_func_convert_article"] = jsi::Function::createFromHostFunction(
rt,
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_kindle_core_fn_func_convert_article"),
2,
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
return this->cpp_uniffi_kindle_core_fn_func_convert_article(rt, thisVal, args, count);
}
);
props["ubrn_uniffi_kindle_core_fn_func_convert_epub"] = jsi::Function::createFromHostFunction(
rt,
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_kindle_core_fn_func_convert_epub"),
Expand Down Expand Up @@ -2238,6 +2252,14 @@ NativeKindleCore::NativeKindleCore(
return this->cpp_ffi_kindle_core_rust_future_complete_void(rt, thisVal, args, count);
}
);
props["ubrn_uniffi_kindle_core_checksum_func_convert_article"] = jsi::Function::createFromHostFunction(
rt,
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_kindle_core_checksum_func_convert_article"),
0,
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
return this->cpp_uniffi_kindle_core_checksum_func_convert_article(rt, thisVal, args, count);
}
);
props["ubrn_uniffi_kindle_core_checksum_func_convert_epub"] = jsi::Function::createFromHostFunction(
rt,
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_kindle_core_checksum_func_convert_epub"),
Expand Down Expand Up @@ -2418,6 +2440,13 @@ jsi::Value NativeKindleCore::cpp_uniffi_internal_fn_func_ffi__read_string_from_b
}

// Methods calling directly into the uniffi generated C API of the Rust crate.
jsi::Value NativeKindleCore::cpp_uniffi_kindle_core_fn_func_convert_article(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
auto value = uniffi_kindle_core_fn_func_convert_article(uniffi::kindle_core::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi::kindle_core::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1])
);


return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
}
jsi::Value NativeKindleCore::cpp_uniffi_kindle_core_fn_func_convert_epub(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
auto value = uniffi_kindle_core_fn_func_convert_epub(uniffi::kindle_core::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi::kindle_core::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1])
);
Expand Down Expand Up @@ -2804,6 +2833,13 @@ jsi::Value NativeKindleCore::cpp_ffi_kindle_core_rust_future_complete_void(jsi::

return jsi::Value::undefined();
}
jsi::Value NativeKindleCore::cpp_uniffi_kindle_core_checksum_func_convert_article(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
auto value = uniffi_kindle_core_checksum_func_convert_article(
);


return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
}
jsi::Value NativeKindleCore::cpp_uniffi_kindle_core_checksum_func_convert_epub(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
auto value = uniffi_kindle_core_checksum_func_convert_epub(
);
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/modules/kindle-core/cpp/generated/kindle_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class NativeKindleCore : public jsi::HostObject {
jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_buffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_internal_fn_func_ffi__string_from_buffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_internal_fn_func_ffi__read_string_from_buffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_kindle_core_fn_func_convert_article(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_kindle_core_fn_func_convert_epub(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_kindle_core_fn_func_device_thumbnail(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_ffi_kindle_core_rust_future_poll_u8(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
Expand Down Expand Up @@ -72,6 +73,7 @@ class NativeKindleCore : public jsi::HostObject {
jsi::Value cpp_ffi_kindle_core_rust_future_cancel_void(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_ffi_kindle_core_rust_future_free_void(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_ffi_kindle_core_rust_future_complete_void(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_kindle_core_checksum_func_convert_article(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_kindle_core_checksum_func_convert_epub(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_uniffi_kindle_core_checksum_func_device_thumbnail(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
jsi::Value cpp_ffi_kindle_core_uniffi_contract_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
Expand Down
Loading
Loading