Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / ui / AGENTS.md
| 1 | # AGENTS.md — library/ui/ (':library:ui') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/ui/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | <!-- last-reviewed: 2026-10-16 --> |
| 6 | - Gradle: :library:ui / dir: library/ui/ |
| 7 | - Package roots present: ui |
| 8 | - Entry files: MaActivity.kt, AppScaffold.kt, Icons.kt (no app MainActivity/Route — this is the shared shell) |
| 9 | - Deps: :library |
| 10 | - Network: none — offline-banner connectivity UI lives in `:library:network` |
| 11 | (`util/ConnectivityCompose.kt`); network apps depend on it directly (#884) |
| 12 | - Metadata: metadata_data/library-ui.md (absent — libraries have none by design) |
| 13 | - Rust: no / screenshotTest: no |
| 14 | |
| 15 | ## Overview |
| 16 | **Purpose:** All shared Compose chrome for every app — activity shells, scaffolds, theme, icons, messenger, editors, motion. If it renders in more than one app, it lives here. |
| 17 | **How to use (must-rules, enforced by lint):** |
| 18 | - Activities extend `MaActivity` (or `MaFragmentActivity` for biometric-gated apps) — override `Content()` + `onCreateBeforeContent()`, never repeat the edge-to-edge/theme shell |
| 19 | - Screens use the `AppScaffold` family (never raw `Scaffold`); icons via `IconXxx()` in `Icons.kt` (never `Icon()`/`painterResource()`/`material.icons.*` in apps); messages via `rememberMessenger()`/`AppMessages` (never `Toast`); motion via the `Motion*` helpers (never raw `animation` at call sites) |
| 20 | **Areas:** activity shells (`MaActivity.kt`) · scaffolds (`AppScaffold`, `Detail`/`LazyList`/`TabbedPager`/`Setup`, `ListPage`) · theme + tokens (`DynamicTheme`, `Material*`, `Spacing`, `Modifier`, `Motion*`) · `Icons.kt` · messenger (`Messages.kt`) · editors (Html/Markdown/Odf + controllers) · pickers + dialogs (`dialog/`) · game chrome (`game/`) · ODF/doc export (`odf/`) · panorama · permissions + special-access · adaptive/wide layouts (`AdaptiveGrid`, `DesktopMaxWidth`, `PaneMargins`) · connectivity banner (`util/ConnectivityCompose.kt`). |
| 21 | **Entry points + reading order:** `MaActivity.kt` → `AppScaffold.kt` → `Icons.kt` → `Messages.kt` → `DynamicTheme.kt`, then the area you need. |
| 22 | **Gotchas:** |
| 23 | - One public `@Composable` per file, named as the file; closed package roots still apply inside this library |
| 24 | - Never `imePadding()`/`navigationBarsPadding()`/`systemBarsPadding()` in this library |
| 25 | - Connectivity UI (`OfflineAware`/`rememberIsOnline`) lives in `:library:network`, not here (#884) |
| 26 | - `MaFragmentActivity(autoSetContent=false)` + `showContent()` is the biometric-gate pattern (passwords, photos) |
| 27 | |
| 28 | ## Key files |
| 29 | ### Shell + scaffolds — start here |
| 30 | - com/vayunmathur/library/ui/MaActivity.kt — shared activity shell (incl. `MaFragmentActivity`) |
| 31 | - com/vayunmathur/library/ui/AppScaffold.kt |
| 32 | - com/vayunmathur/library/ui/DetailScaffold.kt |
| 33 | - com/vayunmathur/library/ui/LazyListScaffold.kt |
| 34 | - com/vayunmathur/library/ui/TabbedPagerScaffold.kt |
| 35 | - com/vayunmathur/library/ui/SetupScaffold.kt |
| 36 | - com/vayunmathur/library/ui/ListPage.kt |
| 37 | ### Theme + tokens |
| 38 | - com/vayunmathur/library/ui/DynamicTheme.kt |
| 39 | - com/vayunmathur/library/ui/Icons.kt — ONLY place allowed `Icon()`/`painterResource()` |
| 40 | - com/vayunmathur/library/ui/Messages.kt — messenger + `AppMessages` |
| 41 | - com/vayunmathur/library/ui/MaterialAliases.kt |
| 42 | - com/vayunmathur/library/ui/MaterialComponents.kt |
| 43 | - com/vayunmathur/library/ui/MaterialComponentsExtra.kt |
| 44 | - com/vayunmathur/library/ui/MaterialFunctions.kt |
| 45 | - com/vayunmathur/library/ui/Motion.kt — motion helpers (use these, not raw animation) |
| 46 | - com/vayunmathur/library/ui/MotionValues.kt |
| 47 | - com/vayunmathur/library/ui/Spacing.kt |
| 48 | - com/vayunmathur/library/ui/Modifier.kt |
| 49 | - com/vayunmathur/library/ui/ContentColorOn.kt |
| 50 | - com/vayunmathur/library/ui/VerticalShape.kt |
| 51 | - com/vayunmathur/library/ui/DateString.kt |
| 52 | - com/vayunmathur/library/ui/RememberClock.kt |
| 53 | ### Adaptive + wide layouts |
| 54 | - com/vayunmathur/library/ui/AdaptiveGrid.kt |
| 55 | - com/vayunmathur/library/ui/AdaptiveWindow.kt |
| 56 | - com/vayunmathur/library/ui/DesktopMaxWidth.kt |
| 57 | - com/vayunmathur/library/ui/PaneMargins.kt |
| 58 | - com/vayunmathur/library/ui/SwappedContent.kt |
| 59 | - com/vayunmathur/library/ui/SwappedTopBar.kt |
| 60 | - com/vayunmathur/library/ui/TopAppBarOverlay.kt |
| 61 | - com/vayunmathur/library/ui/SafeListItemLayout.kt |
| 62 | ### Common screens + state |
| 63 | - com/vayunmathur/library/ui/StateScreens.kt |
| 64 | - com/vayunmathur/library/ui/NoPermissionsScreen.kt |
| 65 | - com/vayunmathur/library/ui/DashboardSection.kt |
| 66 | - com/vayunmathur/library/ui/GameCenterScreen.kt |
| 67 | - com/vayunmathur/library/ui/AchievementNotification.kt |
| 68 | - com/vayunmathur/library/ui/HistoryScrubber.kt |
| 69 | - com/vayunmathur/library/ui/SelectionMode.kt |
| 70 | - com/vayunmathur/library/ui/SwipeActionsBox.kt |
| 71 | - com/vayunmathur/library/ui/CommonSearchBar.kt |
| 72 | - com/vayunmathur/library/ui/OverflowMenu.kt |
| 73 | - com/vayunmathur/library/ui/ConfirmDialog.kt |
| 74 | - com/vayunmathur/library/ui/AddToListDialog.kt |
| 75 | - com/vayunmathur/library/ui/BannerVisibility.kt |
| 76 | - com/vayunmathur/library/ui/ExpandVisibility.kt |
| 77 | - com/vayunmathur/library/ui/FadeVisibility.kt |
| 78 | - com/vayunmathur/library/ui/PopVisibility.kt |
| 79 | - com/vayunmathur/library/ui/FreeHeightBottomSheet.kt |
| 80 | - com/vayunmathur/library/ui/FreeHeightSheetState.kt |
| 81 | ### Forms + settings |
| 82 | - com/vayunmathur/library/ui/FormComponents.kt |
| 83 | - com/vayunmathur/library/ui/FormSection.kt |
| 84 | - com/vayunmathur/library/ui/SettingsComponents.kt |
| 85 | - com/vayunmathur/library/ui/DailyReminderSettingsSection.kt |
| 86 | - com/vayunmathur/library/ui/MultiCategoryPicker.kt |
| 87 | - com/vayunmathur/library/ui/RingtonePicker.kt |
| 88 | - com/vayunmathur/library/ui/BackupButtons.kt — shared backup destination picker buttons |
| 89 | - com/vayunmathur/library/ui/ShareVaultDialog.kt — everysync vault share dialog |
| 90 | ### Reorderable grids |
| 91 | - com/vayunmathur/library/ui/ReorderableGrid.kt |
| 92 | - com/vayunmathur/library/ui/ReorderableGridGestures.kt |
| 93 | - com/vayunmathur/library/ui/ReorderableUtil.kt |
| 94 | ### Permissions + system access |
| 95 | - com/vayunmathur/library/ui/AppPermissionsGate.kt |
| 96 | - com/vayunmathur/library/ui/PermissionRequest.kt |
| 97 | - com/vayunmathur/library/ui/PermissionRequirement.kt |
| 98 | - com/vayunmathur/library/ui/SpecialAccess.kt |
| 99 | - com/vayunmathur/library/ui/ExternalIntents.kt |
| 100 | - com/vayunmathur/library/ui/AppPullToRefreshBox.kt |
| 101 | ### Maps + sensors |
| 102 | - com/vayunmathur/library/ui/MapsPoiVectors.kt |
| 103 | - com/vayunmathur/library/ui/MapUnavailableMessage.kt |
| 104 | - com/vayunmathur/library/ui/CompassCalibrationBanner.kt |
| 105 | - com/vayunmathur/library/ui/CompassCalibrationHint.kt |
| 106 | ### Panorama |
| 107 | - com/vayunmathur/library/ui/PanoramaCameraState.kt |
| 108 | - com/vayunmathur/library/ui/PanoramaCrop.kt |
| 109 | - com/vayunmathur/library/ui/PanoramaSphere.kt |
| 110 | - com/vayunmathur/library/ui/PanoramaSphereView.kt |
| 111 | ### Editors — Html |
| 112 | - com/vayunmathur/library/ui/HtmlEditor.kt |
| 113 | - com/vayunmathur/library/ui/HtmlEditorController.kt |
| 114 | - com/vayunmathur/library/ui/HtmlEditorControllerCore.kt |
| 115 | - com/vayunmathur/library/ui/HtmlEditorSpans.kt |
| 116 | - com/vayunmathur/library/ui/HtmlSerialize.kt |
| 117 | - com/vayunmathur/library/ui/HtmlText.kt |
| 118 | - com/vayunmathur/library/ui/RichEmailSpans.kt |
| 119 | - com/vayunmathur/library/ui/EditorFormatter.kt |
| 120 | - com/vayunmathur/library/ui/EditorLink.kt |
| 121 | ### Editors — Markdown |
| 122 | - com/vayunmathur/library/ui/MarkdownEditor.kt |
| 123 | - com/vayunmathur/library/ui/MarkdownEditOps.kt |
| 124 | - com/vayunmathur/library/ui/MarkdownToHtml.kt |
| 125 | - com/vayunmathur/library/ui/OdfMarkdownEditor.kt |
| 126 | ### dialog/ — date/time pickers |
| 127 | - com/vayunmathur/library/ui/dialog/DatePickerDialog.kt |
| 128 | - com/vayunmathur/library/ui/dialog/TimePickerDialog.kt |
| 129 | ### game/ — shared game chrome |
| 130 | - com/vayunmathur/library/ui/game/GameModeChooser.kt |
| 131 | - com/vayunmathur/library/ui/game/GameResultOverlay.kt |
| 132 | - com/vayunmathur/library/ui/game/GameTopBarActions.kt |
| 133 | - com/vayunmathur/library/ui/game/GameInfoBox.kt |
| 134 | - com/vayunmathur/library/ui/game/GameInfoBoxes.kt |
| 135 | - com/vayunmathur/library/ui/game/DailyChallengeCard.kt |
| 136 | - com/vayunmathur/library/ui/game/DailyStreakText.kt |
| 137 | - com/vayunmathur/library/ui/game/HeartsRow.kt |
| 138 | - com/vayunmathur/library/ui/game/FormatDuration.kt |
| 139 | ### odf/ — document model + exporters |
| 140 | - com/vayunmathur/library/ui/odf/OdfDocument.kt |
| 141 | - com/vayunmathur/library/ui/odf/OdfText.kt |
| 142 | - com/vayunmathur/library/ui/odf/OdfTextEditorState.kt |
| 143 | - com/vayunmathur/library/ui/odf/OdfTextEditorView.kt |
| 144 | - com/vayunmathur/library/ui/odf/OdfTextHelpers.kt |
| 145 | - com/vayunmathur/library/ui/odf/OdfParagraphOps.kt |
| 146 | - com/vayunmathur/library/ui/odf/OdfRunEdits.kt |
| 147 | - com/vayunmathur/library/ui/odf/OdfDocTransform.kt |
| 148 | - com/vayunmathur/library/ui/odf/OdfListPrefixes.kt |
| 149 | - com/vayunmathur/library/ui/odf/OdfMetadata.kt |
| 150 | - com/vayunmathur/library/ui/odf/OdfTables.kt |
| 151 | - com/vayunmathur/library/ui/odf/OdfSlides.kt |
| 152 | - com/vayunmathur/library/ui/odf/OdfSerializer.kt |
| 153 | - com/vayunmathur/library/ui/odf/HtmlOdfConverter.kt |
| 154 | - com/vayunmathur/library/ui/odf/HtmlOdfExport.kt |
| 155 | - com/vayunmathur/library/ui/odf/MarkdownOdfConverter.kt |
| 156 | - com/vayunmathur/library/ui/odf/RtfOdfConverter.kt |
| 157 | - com/vayunmathur/library/ui/odf/EpubExporter.kt |
| 158 | - com/vayunmathur/library/ui/odf/OoxmlExporter.kt |
| 159 | - com/vayunmathur/library/ui/odf/PdfExporter.kt |
| 160 | - com/vayunmathur/library/ui/odf/LatexExporter.kt |
| 161 | ### Connectivity |
| 162 | - com/vayunmathur/library/util/ConnectivityCompose.kt — offline banner (`OfflineAware`); `util` package but owned by this module |
| 163 | - com/vayunmathur/library/ui/Haptics.kt |
| 164 | |
| 165 | ## Verify (this module only) |
| 166 | ``` |
| 167 | ./gradlew :library:ui:compileDevKotlin |
| 168 | ./gradlew :library:ui:lint |
| 169 | ``` |