Android comments describe the code to a stranger (#6223)
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 3s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Skipped
Desktop (Tauri) / Tauri desktop (Linux) (push) Skipped
Desktop (Tauri) / Windows installer (cross-compiled) (push) Skipped
Desktop (Tauri) / Update manifest (push) Skipped
CI & Build / Web typecheck and unit tests (push) Successful in 9s
CI & Build / Python tests (push) Successful in 15s
Android / Core and FFI clippy and tests (push) Successful in 27s
CI & Build / integration (push) Successful in 1m39s
CI & Build / Build & push image (push) Skipped
Android / Kotlin + Rust (APK) (push) Successful in 7m55s
Android / Build the server image (push) Successful in 6s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 3s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Skipped
Desktop (Tauri) / Tauri desktop (Linux) (push) Skipped
Desktop (Tauri) / Windows installer (cross-compiled) (push) Skipped
Desktop (Tauri) / Update manifest (push) Skipped
CI & Build / Web typecheck and unit tests (push) Successful in 9s
CI & Build / Python tests (push) Successful in 15s
Android / Core and FFI clippy and tests (push) Successful in 27s
CI & Build / integration (push) Successful in 1m39s
CI & Build / Build & push image (push) Skipped
Android / Kotlin + Rust (APK) (push) Successful in 7m55s
Android / Build the server image (push) Successful in 6s
Milestone 546 "Bring the repo to the comment standard (rule 32) and compose defaults (rule 198)", step #6223 "Comment standard sweep: Android client". KDoc, comments, manifest and resource notes, Gradle and TOML comments and the ffi crate's docs now state what the code does and the non-obvious why in the present tense. Issue, Scribe-note, milestone (M13, M304, M315, M12) and family-idea references are gone, as are comparisons to Minstrel and the narration of what used to be: the capture sheet the editor replaced, the per-note colour story, the operator's device-pass feedback, the bindgen-as-[[bin]] failure, the 0.60 edge alpha before it was re-solved, and the checker bugs behind check-strings/check-symbols. Hazards stay as facts: the signing key that can't be rotated, the alias that keeps the earlier name, PKCS12's single password, unwind over abort, the UTC date-picker read, the DerivedTint/colors.ts mirror. One stale claim is gone: DerivedTint said the web had no test runner, but notes/grammar.test.ts runs the same tint cases. detekt.yml said "these two places" over a list of five. 49 files, comments only: a comment-stripping diff of every changed file against HEAD is identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+16
-21
@@ -3,7 +3,7 @@
|
||||
//! This crate is to Android what `desktop/src-tauri/src/commands/` is to the desktop
|
||||
//! — a thin shim over the shared core, holding no logic of its own. If something here
|
||||
//! starts making decisions about notes or sync, it belongs in the core where the
|
||||
//! desktop gets it too (Scribe note 2730).
|
||||
//! desktop gets it too.
|
||||
//!
|
||||
//! ## Shape
|
||||
//!
|
||||
@@ -30,9 +30,7 @@
|
||||
//! The Android build overrides it back to `unwind` (`CargoNdkBuild` in
|
||||
//! `app/build.gradle.kts`), so uniffi catches a panic crossing the FFI boundary and
|
||||
//! raises it in Kotlin as an exception, which the board shows as an error. Under
|
||||
//! `abort` the same panic would end the app. Every phone build had unwind before
|
||||
//! the release profile was used (debug unwinds), so keeping it changes nothing a
|
||||
//! phone does. The cost is library size (Scribe #2810).
|
||||
//! `abort` the same panic would end the app. The cost is library size.
|
||||
|
||||
pub mod models;
|
||||
|
||||
@@ -105,7 +103,7 @@ impl CoreError {
|
||||
}
|
||||
|
||||
/// Seals the device token before it is stored, and opens it when it is read: Kotlin's
|
||||
/// half of [`state::TokenSeal`] (family idea #5105, practice 12).
|
||||
/// half of [`state::TokenSeal`].
|
||||
///
|
||||
/// Implemented with a key in the Android Keystore. The key never leaves the phone,
|
||||
/// so a copy of the app's files carries a token nothing else can open. That includes
|
||||
@@ -255,7 +253,7 @@ impl Inkwell {
|
||||
///
|
||||
/// Returns nothing, as the board reloads its list afterwards anyway. The core marks
|
||||
/// each note dirty so the new positions sync, and a note shared with this account
|
||||
/// moves on this board only (#5176).
|
||||
/// moves on this board only.
|
||||
pub fn reorder_notes(&self, ordered_ids: Vec<String>) -> Result<(), CoreError> {
|
||||
let conn = self.db.conn().map_err(CoreError::store)?;
|
||||
local::store::reorder(&conn, &ordered_ids).map_err(CoreError::store)
|
||||
@@ -600,11 +598,11 @@ impl Inkwell {
|
||||
|
||||
// ────────────────────────────── sharing ──────────────────────────────
|
||||
//
|
||||
// The Share dialog asks the server directly (#5175). Unlinked, each answers
|
||||
// The Share dialog asks the server directly. Unlinked, each answers
|
||||
// `NotLinked`, which the dialog turns into "sharing needs a server".
|
||||
//
|
||||
// Each passes the token `credentials()` OPENED. The stored one is sealed, and the
|
||||
// server refuses `sealed:…` (#5381).
|
||||
// server refuses `sealed:…`.
|
||||
|
||||
/// Everyone on the instance a note can be shared with, and every group.
|
||||
pub async fn share_directory(&self) -> Result<Directory, CoreError> {
|
||||
@@ -682,10 +680,8 @@ pub fn checklist_render(text: String, checked: bool) -> String {
|
||||
/// Tell the core which app it is running inside, and which build of it.
|
||||
///
|
||||
/// Android has to say so because the core cannot: the same crate is compiled into
|
||||
/// the desktop app, and it used to announce every phone in the field as
|
||||
/// `inkwell-desktop` carrying the CORE crate's version — a number no build
|
||||
/// stamps and nobody has seen. The honest value is the installed package's own
|
||||
/// `versionName`, which is what Kotlin passes here.
|
||||
/// the desktop app. The honest value is the installed package's own `versionName`,
|
||||
/// which is what Kotlin passes here.
|
||||
///
|
||||
/// Called once from `InkwellApplication.onCreate`, before anything can sync.
|
||||
#[uniffi::export]
|
||||
@@ -820,7 +816,7 @@ mod tests {
|
||||
.get_note(created.id.clone())
|
||||
.expect("get should succeed");
|
||||
assert_eq!(fetched.id, created.id);
|
||||
// The NAME is the first line — there is no title field to have set (M13 step 3).
|
||||
// The NAME is the first line — there is no title field to have set.
|
||||
assert_eq!(fetched.display_title, "Groceries");
|
||||
|
||||
std::fs::remove_dir_all(&dir).ok();
|
||||
@@ -1041,9 +1037,8 @@ mod tests {
|
||||
|
||||
/// The path the notification's Done button takes.
|
||||
///
|
||||
/// Completing a RECURRING reminder must move it, not end it — this is the
|
||||
/// behaviour the web has had all along and the clients did not, which made
|
||||
/// "Done" on a daily reminder quietly the last time it ever fired.
|
||||
/// Completing a RECURRING reminder must move it, not end it, as on the web;
|
||||
/// otherwise "Done" on a daily reminder would be the last time it ever fired.
|
||||
#[test]
|
||||
fn completing_a_recurring_reminder_moves_it_rather_than_ending_it() {
|
||||
let dir = scratch_dir();
|
||||
@@ -1103,9 +1098,9 @@ mod tests {
|
||||
/// Renaming a tag onto a name another tag already holds MERGES the two, and the
|
||||
/// OLDER row is the survivor.
|
||||
///
|
||||
/// Before this, the bare UPDATE met `idx_labels_name` — unique on `lower(name)` —
|
||||
/// and the user got a raw "UNIQUE constraint failed" from SQLite. Merging is what
|
||||
/// a person means by typing an existing tag's name onto this one.
|
||||
/// A bare UPDATE would meet `idx_labels_name` (unique on `lower(name)`) and hand
|
||||
/// the user a raw "UNIQUE constraint failed"; merging is what a person means by
|
||||
/// typing an existing tag's name onto this one.
|
||||
#[test]
|
||||
fn renaming_onto_an_existing_tag_merges_into_the_older_one() {
|
||||
let dir = scratch_dir();
|
||||
@@ -1215,8 +1210,8 @@ mod tests {
|
||||
(url, handle)
|
||||
}
|
||||
|
||||
/// #5381: the token is stored sealed, so a share call has to send the OPENED one.
|
||||
/// It used to read the store itself and send `sealed:…`, which the server refused.
|
||||
/// The token is stored sealed, so a share call has to send the OPENED one; the
|
||||
/// server refuses `sealed:…`.
|
||||
#[test]
|
||||
fn sharing_sends_the_opened_token_not_the_stored_one() {
|
||||
let (url, server) = one_reply(r#"{"members":[],"groups":[]}"#);
|
||||
|
||||
@@ -46,7 +46,7 @@ pub struct Note {
|
||||
pub previews: Vec<LinkPreview>,
|
||||
pub created_at: Option<String>,
|
||||
pub updated_at: Option<String>,
|
||||
/// How this account holds the note (#5175): "owner", or "edit"/"view" for one
|
||||
/// How this account holds the note: "owner", or "edit"/"view" for one
|
||||
/// someone shared with it.
|
||||
pub permission: String,
|
||||
/// Whether the owner has shared it with anyone.
|
||||
@@ -335,7 +335,7 @@ pub struct Label {
|
||||
/// matching the REST single-label responses.
|
||||
pub count: Option<i64>,
|
||||
/// The newest edit among the untrashed notes carrying it, as the store writes
|
||||
/// timestamps; None when nothing does. Ranks the drawer's recent tags (#5931).
|
||||
/// timestamps; None when nothing does. Ranks the drawer's recent tags.
|
||||
pub last_used: Option<String>,
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ impl From<NoteFacets> for core_models::Facets {
|
||||
#[derive(Debug, Clone, uniffi::Record)]
|
||||
pub struct NoteDraft {
|
||||
pub body: String,
|
||||
/// Checklist lines. A note can carry both a body and items (M13 step 2), so this
|
||||
/// Checklist lines. A note can carry both a body and items, so this
|
||||
/// is not an alternative to `body` — it is an addition to it.
|
||||
pub items: Option<Vec<String>>,
|
||||
}
|
||||
@@ -616,7 +616,7 @@ impl From<core_client::Identity> for Identity {
|
||||
}
|
||||
}
|
||||
|
||||
/// Someone on the instance a note can be shared with (#5175).
|
||||
/// Someone on the instance a note can be shared with.
|
||||
#[derive(Debug, Clone, uniffi::Record)]
|
||||
pub struct Member {
|
||||
pub id: String,
|
||||
@@ -639,7 +639,7 @@ impl From<core_client::Member> for Member {
|
||||
}
|
||||
}
|
||||
|
||||
/// A group the admin made, which a note can be shared with (#5177).
|
||||
/// A group the admin made, which a note can be shared with.
|
||||
#[derive(Debug, Clone, uniffi::Record)]
|
||||
pub struct ShareGroup {
|
||||
pub id: String,
|
||||
|
||||
Reference in New Issue
Block a user