mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-05 04:27:09 +00:00
Remove in-app SDK (#43)
* chore: delete internal/agent package
* chore(build): remove sdk-android from gradle settings
* chore(makefile): remove sdk-android targets
* chore(ci): remove release-android job from release workflow
* chore(folio): remove sdk-android dependency
* chore(folio): remove SDK initialization from FolioApplication
* chore(folio): delete snapshot extractor files
* feat(folio): add balance to account card content description
* feat(folio): add hierarchy content descriptions to LedgerScreen
* refactor(folio): rewrite spec.ts to use ax extractors
* docs: remove in-app SDK from README
* feat(folio): add focused_input indicator to App
* docs: remove in-app SDK from index
* refactor(runner): remove agent SDK connection and snapshot step
* test(runner): update tests for SDK removal
* docs: remove Android SDK section from getting-started
* refactor(testrun): remove agent SDK connection setup
* docs: remove snapshots from writing-specs
* docs: remove in-app SDK from architecture doc
* docs(folio): update README for SDK removal
* docs: update per-step cycle diagram in architecture doc
* fix(folio): detect screens from unique element presence, not id: selectors
testTag() in Compose is not exposed as resource-id without testTagsAsResourceId.
Use desc: selectors for elements unique to each screen instead of id: path queries.
* feat(folio): add screen root contentDescription for scoped ax selection
Each screen root gets semantics { contentDescription = "ScreenName" } so
sanderling specs can scope element lookups through the screen: desc:LoginScreen > desc:login_submit.
* fix(folio): scope all ax selectors through screen root nodes
Use desc:ScreenName > desc:element path queries so every selector is
rooted at the screen level. focusedInput stays unscoped since it lives
in the app root, outside any screen.
* fix(folio): guard newAccountBalanceIsZero against navigation false positives
Scoped selectors return [] when not on HomeScreen so accounts vanish and
reappear as apparently-new on each visit. Skip the check when prev was empty.
* chore(folio): link @sanderling/spec to local pkg/spec for IDE type checking
* feat(spec): add desc, class, clickable, enabled, checked, focused, selected to AccessibilityElement
Runtime fields set by the verifier were missing from the TypeScript type,
causing linting errors on el.desc and related accesses in specs.
* chore(folio): switch to bun, add tsconfig.json for IDE type checking
- Remove package-lock.json, add bun.lock
- Add tsconfig.json so VSCode resolves @sanderling/spec types
- Fix parseAccount/parseLedgerRow to accept string | undefined
This commit is contained in:
60 files changed
+298
-3354
No files matched your search
@@ -3,21 +3,11 @@ package app.folio
|
||||
import android.app.Application
|
||||
import app.folio.data.AndroidLedgerContext
|
||||
import app.folio.data.Repository
|
||||
import app.folio.sanderling.AccountSnapshots
|
||||
import app.folio.sanderling.AuthSnapshots
|
||||
import app.folio.sanderling.LedgerSnapshots
|
||||
import app.folio.sanderling.NavigationSnapshots
|
||||
import dev.sanderling.sdk.Sanderling
|
||||
|
||||
class FolioApplication : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
AndroidLedgerContext.context = applicationContext
|
||||
Repository.init()
|
||||
Sanderling.start(this)
|
||||
AuthSnapshots
|
||||
AccountSnapshots
|
||||
LedgerSnapshots
|
||||
NavigationSnapshots
|
||||
}
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package app.folio.sanderling
|
||||
|
||||
import app.folio.data.Repository
|
||||
import app.folio.feature.account.AddAccountUiState
|
||||
import app.folio.platform.balanceOf
|
||||
import dev.sanderling.sdk.Sanderling
|
||||
|
||||
object AccountSnapshots {
|
||||
val accountCount by Sanderling.snapshot { Repository.accounts.value.size }
|
||||
val totalBalance by Sanderling.snapshot { balanceOf(Repository.transactions.value) }
|
||||
val accounts by Sanderling.snapshot {
|
||||
val txns = Repository.transactions.value
|
||||
Repository.accounts.value.map { a ->
|
||||
val rows = txns.filter { it.accountId == a.id }
|
||||
mapOf("id" to a.id, "name" to a.name, "balance" to balanceOf(rows), "txnCount" to rows.size)
|
||||
}
|
||||
}
|
||||
val addAccountError by Sanderling.snapshot { AddAccountUiState.addAccountError.value }
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package app.folio.sanderling
|
||||
|
||||
import app.folio.data.Repository
|
||||
import app.folio.feature.auth.LoginUiState
|
||||
import dev.sanderling.sdk.Sanderling
|
||||
|
||||
object AuthSnapshots {
|
||||
val loggedIn by Sanderling.snapshot { Repository.session.value != null }
|
||||
val authStatus by Sanderling.snapshot { if (Repository.session.value != null) "logged-in" else "logged-out" }
|
||||
val loginError by Sanderling.snapshot { LoginUiState.loginError.value }
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
package app.folio.sanderling
|
||||
|
||||
import app.folio.FocusTracker
|
||||
import app.folio.data.Repository
|
||||
import app.folio.data.TxnType
|
||||
import app.folio.feature.ledger.AddTransactionUiState
|
||||
import app.folio.navigation.Navigator
|
||||
import app.folio.navigation.Route
|
||||
import app.folio.platform.balanceOf
|
||||
import app.folio.platform.signedAmount
|
||||
import dev.sanderling.sdk.Sanderling
|
||||
|
||||
object LedgerSnapshots {
|
||||
private val activeId
|
||||
get() = when (val r = Navigator.current.value) {
|
||||
is Route.Ledger -> r.accountId
|
||||
is Route.AddTransaction -> r.accountId
|
||||
else -> null
|
||||
}
|
||||
|
||||
val activeAccountId by Sanderling.snapshot { activeId }
|
||||
val ledgerRows by Sanderling.snapshot {
|
||||
val active = activeId ?: return@snapshot emptyList<Any>()
|
||||
Repository.transactions.value.filter { it.accountId == active }.map {
|
||||
mapOf(
|
||||
"id" to it.id,
|
||||
"accountId" to it.accountId,
|
||||
"type" to if (it.type == TxnType.credit) "credit" else "debit",
|
||||
"amount" to it.amount,
|
||||
"signed" to signedAmount(it),
|
||||
)
|
||||
}
|
||||
}
|
||||
val ledgerBalance by Sanderling.snapshot {
|
||||
val active = activeId ?: return@snapshot 0L
|
||||
balanceOf(Repository.transactions.value.filter { it.accountId == active })
|
||||
}
|
||||
val focusedInput by Sanderling.snapshot { FocusTracker.current.value }
|
||||
val txnFormType by Sanderling.snapshot { AddTransactionUiState.txnFormType.value }
|
||||
val txnFormAccountId by Sanderling.snapshot { (Navigator.current.value as? Route.AddTransaction)?.accountId }
|
||||
val txnError by Sanderling.snapshot { AddTransactionUiState.txnError.value }
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package app.folio.sanderling
|
||||
|
||||
import app.folio.navigation.Navigator
|
||||
import app.folio.navigation.Route
|
||||
import dev.sanderling.sdk.Sanderling
|
||||
|
||||
object NavigationSnapshots {
|
||||
val screen by Sanderling.snapshot {
|
||||
when (Navigator.current.value) {
|
||||
Route.Login -> "login"
|
||||
Route.Home -> "home"
|
||||
Route.AddAccount -> "add-account"
|
||||
is Route.Ledger -> "ledger"
|
||||
is Route.AddTransaction -> "add-transaction"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user