Skip to content

Commit bae60c1

Browse files
authored
Global SDAI app refactor to KMP / iOS Release preparation (#638)
* Global SDAI app refactor to KMP * Update README.md * Fix server setup UI, Update README.md * Update README.md * Update README.md * Implement dokka documentation generation * Fix minor regression issues * Update * Update PR template * Update img2img hint * Fix SwarmUI embedding names * Update models hosting metadata * Fix status bar on home screen, update docs * Fix iOS archive AppStoreConnect compliance
1 parent b719882 commit bae60c1

9,367 files changed

Lines changed: 1688276 additions & 53515 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ liberapay: # Replace with a single Liberapay username
88
issuehunt: # Replace with a single IssueHunt username
99
otechie: # Replace with a single Otechie username
1010
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
11-
custom: ['https://www.buymeacoffee.com/shifthackz', 'https://send.monobank.ua/jar/3n2Aj3Hv3g']
11+
custom: ['https://sdai.moroz.cc/donate.html']

.github/pull_request_template.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
### Screenshots / Video (Optional)
55

66
### Checklist
7-
- [ ] I have ensured this PR does not contain any breaking changes for existing functionality;
8-
- [ ] I have added automated tests that cover the new behavior and removed obsolete tests and code;
7+
- [ ] I have ensured this PR does not contain any breaking changes for existing functionality
8+
- [ ] I have added automated tests that cover the new behavior and removed obsolete tests and code
9+
- [ ] I have added documentation for any new public APIs and update existing documentation for any changes to public APIs, generated dokka documentation
910

1011
### Tested On
11-
- [ ] Emulator
12-
- [ ] Real device
12+
- [ ] Android: Emulator
13+
- [ ] Android: Real device
14+
- [ ] iOS: Simulator
15+
- [ ] iOS: Real iPhone device

.github/workflows/android_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
run: chmod +x ./gradlew
2222

2323
- name: Run Tests with Gradle
24-
run: ./gradlew clean testDebugUnitTest
24+
run: ./gradlew clean testDebugUnitTest

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ captures/
6262

6363
# Signing files
6464
.signing/
65+
/.gradle-docker-cache/
66+
qa/mobile/.env
67+
qa/mobile/.env.*
68+
!qa/mobile/.env.example
69+
scripts/*.local
6570

6671
# Local configuration file (sdk path, etc)
6772

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DOCUMENTATION.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Documentation Workflow
2+
3+
This project uses KDoc as the source of truth and Dokka as the API reference
4+
generator. Treat documentation changes as part of the code change: when a class,
5+
method, constructor, property, or behavior contract changes, update the KDoc in
6+
the same commit.
7+
8+
## What To Document
9+
10+
Document declarations that explain module boundaries, public contracts, shared
11+
KMP behavior, platform-specific `actual` behavior, side effects, and non-obvious
12+
state transitions.
13+
14+
Use KDoc for:
15+
16+
- Classes, interfaces, objects, and data classes that are part of a module API.
17+
- ViewModels, routers, interactors, gateways, repositories, data sources, and
18+
platform services.
19+
- Top-level composables and helpers that are reused across screens.
20+
- `expect` declarations in `commonMain` and `actual` declarations when Android
21+
and iOS behavior differs.
22+
- Parameters or return values that are not obvious from the type.
23+
- Error, cancellation, threading, persistence, or network behavior that callers
24+
must know about.
25+
26+
Avoid noisy KDoc for trivial private code whose behavior is already obvious from
27+
the implementation. Prefer a short implementation comment inside the function
28+
when the explanation is local and not part of the API reference.
29+
30+
## File-Level Guidance
31+
32+
Dokka renders declaration pages, not arbitrary file headers. When a file needs a
33+
high-level explanation, document the main declaration that represents the file:
34+
35+
- A screen file should document the screen composable or screen state holder.
36+
- A DI file should document the module/register function.
37+
- A mapper file should document the mapper functions when they encode API
38+
quirks or compatibility rules.
39+
- A platform file should document the `actual` implementation or factory.
40+
41+
If a file contains only private helpers, add KDoc only to the helpers whose
42+
behavior would otherwise be hard to recover from the code.
43+
44+
## KDoc Style
45+
46+
Keep the first sentence short and useful. It becomes the summary in generated
47+
Dokka pages.
48+
49+
Recommended shape:
50+
51+
```kotlin
52+
/**
53+
* Loads generation history items for the gallery flow.
54+
*
55+
* The returned page is sorted from newest to oldest and contains only records
56+
* that have a persisted image reference.
57+
*
58+
* @param limit maximum number of records to load.
59+
* @param offset number of newest records to skip.
60+
* @return a page of gallery-ready generation results.
61+
*
62+
* @author Dmitriy Moroz
63+
*/
64+
class LoadGalleryPageUseCase(...)
65+
```
66+
67+
Use links when the related declaration is in the codebase:
68+
69+
```kotlin
70+
/**
71+
* Saves generated images and notifies [GalleryRouter] when the operation
72+
* should open gallery details.
73+
*/
74+
```
75+
76+
For KMP code:
77+
78+
```kotlin
79+
/**
80+
* Opens an external URL using the current platform browser integration.
81+
*
82+
* Android uses an `Intent`; iOS uses the UIKit application URL opener.
83+
*/
84+
expect class ExternalUrlRouter
85+
```
86+
87+
## Before Changing Signatures
88+
89+
When changing a signature or class shape:
90+
91+
1. Update the declaration KDoc.
92+
2. Update `@param`, `@property`, and `@return` tags.
93+
3. Remove documentation for deleted parameters or obsolete behavior.
94+
4. Add platform notes when an `expect` or shared API gains different Android or
95+
iOS semantics.
96+
5. Regenerate Dokka before publishing or merging release work.
97+
98+
## Generating API Documentation
99+
100+
Run Dokka from the repository root:
101+
102+
```bash
103+
./gradlew dokkaGeneratePublicationHtml
104+
```
105+
106+
The root Gradle build aggregates these documented modules:
107+
108+
- `:app`
109+
- `:core:common`
110+
- `:core:imageprocessing`
111+
- `:core:localization`
112+
- `:core:notification`
113+
- `:core:ui`
114+
- `:core:validation`
115+
- `:data`
116+
- `:demo`
117+
- `:domain`
118+
- `:feature:auth`
119+
- `:feature:onnx`
120+
- `:feature:mediapipe`
121+
- `:feature:work`
122+
- `:network`
123+
- `:presentation`
124+
- `:storage`
125+
126+
The generated HTML is written to:
127+
128+
```text
129+
docs/docs/
130+
```
131+
132+
The `decorateDokkaHtml` Gradle task runs automatically after
133+
`dokkaGeneratePublicationHtml`. It adds SDAI navigation links, SEO metadata, and
134+
canonical URLs to the generated pages.
135+
136+
Open the generated index locally from:
137+
138+
```text
139+
docs/docs/index.html
140+
```
141+
142+
## Publishing Notes
143+
144+
The `docs/` directory is the static website root. The generated API reference is
145+
served below `/docs/`, so `docs/docs/index.html` becomes:
146+
147+
```text
148+
https://sdai.moroz.cc/docs/
149+
```
150+
151+
Do not hand-edit generated files under `docs/docs/` for API text changes. Update
152+
KDoc in source code and regenerate Dokka instead. Hand edits in generated HTML
153+
will be overwritten by the next Dokka run.
154+
155+
When adding a new Gradle module that should appear in the API reference, add it
156+
to `documentedProjects` in the root `build.gradle.kts`.
157+
158+
## Pre-Release Checklist
159+
160+
Before a release or store upload:
161+
162+
- Run Optimize Imports in Android Studio:
163+
`Project right click -> Refactor -> Optimize Imports`.
164+
- Run `./gradlew dokkaGeneratePublicationHtml` after KDoc changes.
165+
- Review `git diff -- docs/docs` to make sure generated documentation reflects
166+
the intended API changes.
167+
- Keep unrelated generated website or screenshot changes out of documentation
168+
commits unless they are intentional.

0 commit comments

Comments
 (0)