Skip to content

Settings redesign, first-open setup and Wi-Fi-only downloads - #26

Merged
smnexstudio merged 6 commits into
mainfrom
feature/settings-redesign
Nov 14, 2026
Merged

smnexstudio merged 6 commits into
mainfrom
feature/settings-redesign

Conversation

@smnexstudio

Copy link
Copy Markdown
Owner

Settings becomes a searchable hub of eight pages. First open now explains what the app will download and asks
which network to use.

Stacked on the Custom AI PR#25.

Settings

  • Hub and pages (SettingsHub, SettingsPages):
    • each hub row says what its page holds;
    • search covers every label (searchSettings);
  • Privacy policy and licences in the app: PRIVACY.md and LICENSES.md are copied into the APK at build time
    (copyLegalDocs) and rendered by LegalPage / MarkdownLite, with a View on GitHub link. Same files as on
    GitHub.
  • Engine rows: only the check disc selects an engine. A cloud engine's name opens its setup inline (address,
    model, key).
  • Custom AI providers: the key sheet offers DeepSeek, Grok, GPT, Claude, OpenRouter or Custom.
    • A preset fills in and locks its address.
    • The provider is read back from the saved address (CustomProvider.of), so nothing new is stored.
    • Gemini's model list no longer appears in the Custom AI sheet.
  • Studio › Default folder: Downloads or a folder you pick, used by every manga without its own folder. The
    export screen offers "Default: …", Download/Panelglass (the way out if the default folder is gone) and Choose
    folder.

First open and downloads

  • Notification permission is asked for once at first open (Android 13+). That covers the case where the app's
    per-app language recreates the screen straight away.
  • Setup dialog: lists what's missing with sizes (manga-ocr 140 MB, LaMa 208 MB where it fits, Japanese, Korean
    and Chinese packs 31 MB each) and asks Wi-Fi only (default) or Wi-Fi or mobile data. Nothing downloads
    before an answer; Later asks again at the next open.
  • Download over Wi-Fi only (Models & downloads, on by default) covers every model and language-pack download
    (DownloadNetwork → DownloadManager setAllowedOverMetered, ML Kit requireWifi).
    • Changing it re-queues downloads still at 0 bytes.
    • ML Kit's waiting pack requests are removed and asked for again, because ML Kit would otherwise join the old
      Wi-Fi-only request.
    • Rows say "waiting for Wi-Fi".
    • When the reader needs a pack on the spot, it still uses any network, otherwise translation would hang.
  • Download fixes:
    • a finished download the system saved as name-1.part is found through COLUMN_LOCAL_URI, and stray copies
      are deleted;
    • startup counts a model as queued only when it really is.

Small Fixes

  • Block-list Update during a running refresh joins it instead of reporting "failed".
  • The storage summary follows model and pack states live, one Studio and cache measurement runs at a time, and
    the Models page bar no longer goes stale.
  • From/To picks are saved in a single step (two quick picks can't undo each other). From then To within a minute
    records one recent pair.
  • Folder names and the Downloads path come from one shared helper (ExportFolders). Dead code is removed.

marufmoinuddin and others added 6 commits November 13, 2026 08:50
The user names the server's base address and the model in Settings and pastes
their key; the app sends a plain text Chat Completions request to
<base>/chat/completions and reads the text on the device, so no image ever
leaves the phone.

- EngineId.CUSTOM (offered, user key, no default model): the user must name
  both the model and the address.
- CustomEndpoint (core:model) reduces an address to its base: a pasted
  …/chat/completions is stripped, the path the user wrote is kept, no version
  segment is ever appended, and HTTPS is required.
- CustomOpenAiEngine (core:engine) is a standalone LlmEngine: text only, and a
  server that refuses the optional temperature is asked once more without it.
- The base URL lives in DataStore (an address, not a secret); the key stays in
  the existing SecureKeyStore.
- The key sheet gains an address field for this engine only, and one save
  callback carries the key, the model and the address through a single
  ViewModel coroutine.

Existing engines are untouched.
…ry, warn about tiny models

A server at home is not a hosted provider. It may answer with a bare
object instead of an array, with the array inside a code fence, wrapped in
a "translations" key, or with the translation under "english" or
"translation". It may also put brackets inside the text of a bubble, which
a naive cut would mistake for the array. The parser now tries the reply as
a whole, then as the outermost array, then as the outermost object, and
takes the first that yields a usable list of items.

What the reply must still carry is unchanged: every requested id exactly
once, nothing invented, nothing reordered. A wrong type anywhere makes
the reply unusable rather than throwing, so a bad reply can no longer
crash the app with a serialization error instead of saying "malformed".

The retry no longer depends on the conversation. Some local servers
rewrite a multi-turn history — the original input dropped, the order
reversed — so a retry that said "your previous reply was wrong" could
never work. The Custom AI engine now sends one fresh request that carries
the input and the correction together, and the system prompt shows what a
reply looks like when there is a single item. The hosted providers keep
the three-turn retry they had.

A reply whose content is a list of parts is read, and a reply with empty
model/created/usage fields is accepted.

The sheet warns when the model name gives away a model of about a billion
parameters or less, which usually cannot follow the translation format.
The warning does not stop the save.
@github-actions

Copy link
Copy Markdown

✅ Unit tests: PASS

848 of 848 passed · line coverage 59.6% (logic 68.5%, Compose UI 46.6%) · branch coverage 43.9%

Full HTML report (expected vs actual for every test) · Workflow run

Module Tests Passed Failed Skipped Lines Logic UI Branches
app 21 21 0 0 13.7% 5.1% 19.9% 14.3%
core/data 91 91 0 0 84.3% 84.3% – 63.8%
core/engine 151 151 0 0 78.3% 78.3% – 64.2%
core/model 73 73 0 0 92.0% 92.0% – 47.8%
core/ocr 45 45 0 0 45.8% 45.8% – 41.4%
core/pipeline 27 27 0 0 69.5% 69.5% – 47.3%
core/render 62 62 0 0 85.9% 85.9% – 67.8%
core/ui 18 18 0 0 42.2% 73.9% 39.1% 38.9%
feature/browser 50 50 0 0 20.6% 29.3% 0.0% 19.2%
feature/library 16 16 0 0 89.4% 100.0% 88.2% 68.2%
feature/settings 53 53 0 0 85.5% 75.9% 88.1% 56.4%
feature/studio 241 241 0 0 50.6% 68.0% 35.9% 36.6%

JVM unit tests (testDebugUnitTest, :core:model:test). Instrumented tests need a device and are not run in CI. Compose UI = files declaring @Composable functions; the rest, view models included, is logic.
Commit 2d6fb80.

@smnexstudio
smnexstudio merged commit cccb61d into main Nov 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants