# AGENTS.md — library/ui/ (':library:ui') > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/ui/` + allowed shared modules. Do not root-scan. - Gradle: :library:ui / dir: library/ui/ - Package roots present: ui - Entry files: MaActivity.kt, AppScaffold.kt, Icons.kt + icons.tsv (no app MainActivity/Route — this is the shared shell) - Deps: :library - Network: none — offline-banner connectivity UI lives in `:library:network` (`util/ConnectivityCompose.kt`); network apps depend on it directly - Metadata: metadata_data/library-ui.md (absent — libraries have none by design) - Rust: no / screenshotTest: no ## Overview **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. **How to use (must-rules, enforced by lint):** - Activities extend `MaActivity` (or `MaFragmentActivity` for biometric-gated apps) — override `Content()` + `onCreateBeforeContent()`, never repeat the edge-to-edge/theme shell - Screens use the `AppScaffold` family (never raw `Scaffold`); icons via the generated `IconXxx()` wrappers (manifest `icons.tsv`, generated at build time by `GenerateIconsTask`; never `Icon()`/`painterResource()`/`material.icons.*` in apps, never hand-edit the generated file — add one manifest line and rebuild); messages via `rememberMessenger()`/`AppMessages` (never `Toast`); motion via the `Motion*` helpers (never raw `animation` at call sites) **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`). **Entry points + reading order:** `MaActivity.kt` → `AppScaffold.kt` → `Icons.kt` → `Messages.kt` → `DynamicTheme.kt`, then the area you need. **Gotchas:** - One public `@Composable` per file, named as the file; closed package roots still apply inside this library - Never `imePadding()`/`navigationBarsPadding()`/`systemBarsPadding()` in this library's reusable components: the shared `Scaffold` wrapper owns IME (unconditional `contentWindowInsets ∪ ime`, consumed as `navigationBars ∪ ime` for content, so a stray inset modifier under an AppScaffold-family screen is a no-op). Exceptions that still own their insets: `bottomBar`-slot bars (`EditorBottomBar`, `BottomAppBar` — outside consumed content) and non-Scaffold overlays (`HistoryScrubberCard` — nav-bars only, suppressed with justification) - Connectivity UI (`OfflineAware`/`rememberIsOnline`) lives in `:library:network`, not here - `MaFragmentActivity(autoSetContent=false)` + `showContent()` is the biometric-gate pattern (passwords, photos) ## Key files ### Shell + scaffolds — start here - com/vayunmathur/library/ui/MaActivity.kt — shared activity shell (incl. `MaFragmentActivity`) - com/vayunmathur/library/ui/AppScaffold.kt - com/vayunmathur/library/ui/DetailScaffold.kt - com/vayunmathur/library/ui/LazyListScaffold.kt - com/vayunmathur/library/ui/TabbedPagerScaffold.kt - com/vayunmathur/library/ui/SetupScaffold.kt - com/vayunmathur/library/ui/ListPage.kt ### Theme + tokens - com/vayunmathur/library/ui/DynamicTheme.kt - com/vayunmathur/library/ui/Icons.kt — hand-written `AppIcon` + `IconNavigation` back buttons; ONLY place (with the generated wrappers) allowed `Icon()`/`painterResource()` - com/vayunmathur/library/ui/icons.tsv — icon manifest, the source of truth for every generated `IconXxx()` wrapper (name, kind, Material/drawable/vector source, content description, KDoc) - com/vayunmathur/library/ui/IconsCustom.kt — hand-authored `ImageVector`s (`Book2`, lane-guidance vectors, `HelpOutlineVector`) the manifest references as `vector:` - com/vayunmathur/library/ui/Messages.kt — messenger + `AppMessages` - com/vayunmathur/library/ui/MaterialAliases.kt - com/vayunmathur/library/ui/MaterialComponents.kt - com/vayunmathur/library/ui/MaterialComponentsExtra.kt - com/vayunmathur/library/ui/MaterialFunctions.kt - com/vayunmathur/library/ui/Motion.kt — motion helpers (use these, not raw animation) - com/vayunmathur/library/ui/MotionValues.kt - com/vayunmathur/library/ui/Spacing.kt - com/vayunmathur/library/ui/Modifier.kt - com/vayunmathur/library/ui/ContentColorOn.kt - com/vayunmathur/library/ui/VerticalShape.kt - com/vayunmathur/library/ui/DateString.kt - com/vayunmathur/library/ui/RememberClock.kt ### Adaptive + wide layouts - com/vayunmathur/library/ui/AdaptiveGrid.kt - com/vayunmathur/library/ui/AdaptiveWindow.kt - com/vayunmathur/library/ui/DesktopMaxWidth.kt - com/vayunmathur/library/ui/PaneMargins.kt - com/vayunmathur/library/ui/SwappedContent.kt - com/vayunmathur/library/ui/SwappedTopBar.kt - com/vayunmathur/library/ui/TopAppBarOverlay.kt - com/vayunmathur/library/ui/SafeListItemLayout.kt ### Common screens + state - com/vayunmathur/library/ui/StateScreens.kt - com/vayunmathur/library/ui/NoPermissionsScreen.kt - com/vayunmathur/library/ui/DashboardSection.kt - com/vayunmathur/library/ui/GameCenterScreen.kt - com/vayunmathur/library/ui/AchievementNotification.kt - com/vayunmathur/library/ui/HistoryScrubber.kt - com/vayunmathur/library/ui/SelectionMode.kt - com/vayunmathur/library/ui/SwipeActionsBox.kt - com/vayunmathur/library/ui/CommonSearchBar.kt - com/vayunmathur/library/ui/ScaffoldSearch.kt — scaffold `search` parameter value (screen-level search is declared here, never by placing CommonSearchBar in app content; fatal `ScaffoldSearch` lint) - com/vayunmathur/library/ui/OverflowMenu.kt - com/vayunmathur/library/ui/ConfirmDialog.kt - com/vayunmathur/library/ui/SingleChoiceDialog.kt - com/vayunmathur/library/ui/TextInputDialog.kt - com/vayunmathur/library/ui/AddToListDialog.kt - com/vayunmathur/library/ui/BannerVisibility.kt - com/vayunmathur/library/ui/ExpandVisibility.kt - com/vayunmathur/library/ui/FadeVisibility.kt - com/vayunmathur/library/ui/PopVisibility.kt - com/vayunmathur/library/ui/FreeHeightBottomSheet.kt - com/vayunmathur/library/ui/FreeHeightSheetState.kt ### Media viewer - com/vayunmathur/library/ui/ZoomState.kt — pure zoom/pan value + anchored pinch, clamp, double-tap math - com/vayunmathur/library/ui/ZoomGestures.kt — `zoomGestures()` pinch/pan/double-tap modifier, pager-friendly (photos viewer, appstore screenshots) ### Forms + settings - com/vayunmathur/library/ui/FormComponents.kt - com/vayunmathur/library/ui/FormSection.kt - com/vayunmathur/library/ui/SettingsComponents.kt - com/vayunmathur/library/ui/SettingsSliderRow.kt - com/vayunmathur/library/ui/SettingsRadioRow.kt - com/vayunmathur/library/ui/SettingsFooter.kt - com/vayunmathur/library/ui/DailyReminderSettingsSection.kt - com/vayunmathur/library/ui/MultiCategoryPicker.kt - com/vayunmathur/library/ui/RingtonePicker.kt - com/vayunmathur/library/ui/BackupButtons.kt — shared backup destination picker buttons - com/vayunmathur/library/ui/ShareVaultDialog.kt — everysync vault share dialog ### Reorderable grids - com/vayunmathur/library/ui/ReorderableGrid.kt - com/vayunmathur/library/ui/ReorderableGridGestures.kt - com/vayunmathur/library/ui/ReorderableUtil.kt ### Permissions + system access - com/vayunmathur/library/ui/AppPermissionsGate.kt - com/vayunmathur/library/ui/PermissionRequest.kt - com/vayunmathur/library/ui/PermissionRequirement.kt - com/vayunmathur/library/ui/SpecialAccess.kt - com/vayunmathur/library/ui/ExternalIntents.kt - com/vayunmathur/library/ui/AppPullToRefreshBox.kt ### Maps + sensors - com/vayunmathur/library/ui/MapsPoiVectors.kt - com/vayunmathur/library/ui/MapUnavailableMessage.kt - com/vayunmathur/library/ui/CompassCalibrationBanner.kt - com/vayunmathur/library/ui/CompassCalibrationHint.kt ### Panorama - com/vayunmathur/library/ui/PanoramaCameraState.kt - com/vayunmathur/library/ui/PanoramaCrop.kt - com/vayunmathur/library/ui/PanoramaSphere.kt - com/vayunmathur/library/ui/PanoramaSphereView.kt ### Editors — Html - com/vayunmathur/library/ui/HtmlEditor.kt - com/vayunmathur/library/ui/HtmlEditorController.kt - com/vayunmathur/library/ui/HtmlEditorControllerCore.kt - com/vayunmathur/library/ui/HtmlEditorSpans.kt - com/vayunmathur/library/ui/HtmlSerialize.kt - com/vayunmathur/library/ui/HtmlText.kt — `scrollInternally`/`fitContentToWidth` for long untrusted mail - com/vayunmathur/library/ui/HtmlTextDocument.kt — pure document wrapper (viewport, CSP, fit CSS) - com/vayunmathur/library/ui/RichEmailSpans.kt - com/vayunmathur/library/ui/EditorFormatter.kt - com/vayunmathur/library/ui/EditorLink.kt ### Editors — Markdown - com/vayunmathur/library/ui/MarkdownEditor.kt - com/vayunmathur/library/ui/MarkdownEditOps.kt - com/vayunmathur/library/ui/MarkdownToHtml.kt - com/vayunmathur/library/ui/OdfMarkdownEditor.kt ### dialog/ — date/time pickers - com/vayunmathur/library/ui/dialog/DatePickerDialog.kt - com/vayunmathur/library/ui/dialog/TimePickerDialog.kt ### game/ — shared game chrome - com/vayunmathur/library/ui/game/GameModeChooser.kt - com/vayunmathur/library/ui/game/GameResultOverlay.kt - com/vayunmathur/library/ui/game/GameTopBarActions.kt - com/vayunmathur/library/ui/game/GameInfoBox.kt - com/vayunmathur/library/ui/game/GameInfoBoxes.kt - com/vayunmathur/library/ui/game/DailyChallengeCard.kt - com/vayunmathur/library/ui/game/DailyStreakText.kt - com/vayunmathur/library/ui/game/HeartsRow.kt - com/vayunmathur/library/ui/game/FormatDuration.kt ### odf/ — document model + exporters - com/vayunmathur/library/ui/odf/OdfDocument.kt - com/vayunmathur/library/ui/odf/OdfText.kt - com/vayunmathur/library/ui/odf/OdfTextEditorState.kt - com/vayunmathur/library/ui/odf/OdfTextEditorView.kt - com/vayunmathur/library/ui/odf/OdfTextHelpers.kt - com/vayunmathur/library/ui/odf/OdfParagraphOps.kt - com/vayunmathur/library/ui/odf/OdfRunEdits.kt - com/vayunmathur/library/ui/odf/OdfDocTransform.kt - com/vayunmathur/library/ui/odf/OdfListPrefixes.kt - com/vayunmathur/library/ui/odf/OdfMetadata.kt - com/vayunmathur/library/ui/odf/OdfTables.kt - com/vayunmathur/library/ui/odf/OdfSlides.kt - com/vayunmathur/library/ui/odf/OdfSerializer.kt - com/vayunmathur/library/ui/odf/HtmlOdfConverter.kt - com/vayunmathur/library/ui/odf/HtmlOdfExport.kt - com/vayunmathur/library/ui/odf/MarkdownOdfConverter.kt - com/vayunmathur/library/ui/odf/RtfOdfConverter.kt - com/vayunmathur/library/ui/odf/EpubExporter.kt - com/vayunmathur/library/ui/odf/OoxmlExporter.kt - com/vayunmathur/library/ui/odf/PdfExporter.kt - com/vayunmathur/library/ui/odf/LatexExporter.kt ### Connectivity - com/vayunmathur/library/util/ConnectivityCompose.kt — offline banner (`OfflineAware`); lives in `:library:network`, not this module - com/vayunmathur/library/ui/Haptics.kt ## Verify (this module only) ``` ./gradlew :library:ui:compileDevKotlin ./gradlew :library:ui:lint python3 scripts/check_icons_parity.py library/ui/src/main/java/com/vayunmathur/library/ui/Icons.kt library/ui/build/generated/kotlin/generateDebugIcons/IconsGenerated.kt ```