@maccesar/titools 4.1.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +30 -7
  2. package/bin/titools.js +4 -4
  3. package/commands/ti-audit.md +13 -0
  4. package/commands/ti-check.md +15 -0
  5. package/commands/ti-new-screen.md +18 -0
  6. package/lib/claude-plugin.js +105 -0
  7. package/lib/cleanup.js +18 -0
  8. package/lib/commands/doctor.js +75 -3
  9. package/lib/commands/skills.js +66 -6
  10. package/lib/commands/uninstall.js +32 -2
  11. package/lib/commands/update.js +15 -0
  12. package/lib/config.js +37 -0
  13. package/lib/installer.js +85 -1
  14. package/lib/symlink.js +40 -3
  15. package/package.json +2 -1
  16. package/skills/alloy-guides/references/MODELS.md +23 -0
  17. package/skills/alloy-guides/references/MODELS_ADVANCED.md +19 -0
  18. package/skills/alloy-guides/references/VIEWS_STYLES.md +12 -0
  19. package/skills/alloy-guides/references/VIEWS_XML.md +18 -0
  20. package/skills/purgetss/references/EXAMPLES.md +24 -0
  21. package/skills/purgetss/references/animation-advanced.md +12 -0
  22. package/skills/purgetss/references/animation-system.md +23 -0
  23. package/skills/purgetss/references/app-branding.md +23 -0
  24. package/skills/purgetss/references/apply-directive.md +17 -0
  25. package/skills/purgetss/references/arbitrary-values.md +13 -0
  26. package/skills/purgetss/references/class-index-properties.md +11 -0
  27. package/skills/purgetss/references/cli-commands.md +27 -0
  28. package/skills/purgetss/references/customization-deep-dive.md +15 -0
  29. package/skills/purgetss/references/dynamic-component-creation.md +16 -0
  30. package/skills/purgetss/references/migration-guide.md +20 -0
  31. package/skills/purgetss/references/multi-density-images.md +27 -0
  32. package/skills/purgetss/references/semantic-colors.md +15 -0
  33. package/skills/purgetss/references/tikit-components.md +17 -0
  34. package/skills/purgetss/references/titanium-resets.md +16 -0
  35. package/skills/purgetss/references/ui-ux-design.md +20 -0
  36. package/skills/ti-api/references/api-android.md +23 -0
  37. package/skills/ti-api/references/api-app-platform.md +24 -0
  38. package/skills/ti-api/references/api-core.md +24 -0
  39. package/skills/ti-api/references/api-data-network.md +21 -0
  40. package/skills/ti-api/references/api-media.md +15 -1
  41. package/skills/ti-api/references/api-modules-ble-bluetooth.md +26 -0
  42. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +18 -0
  43. package/skills/ti-api/references/api-modules-map.md +21 -2
  44. package/skills/ti-api/references/api-modules-nfc.md +34 -0
  45. package/skills/ti-api/references/api-modules-social-misc.md +22 -0
  46. package/skills/ti-api/references/api-services.md +21 -1
  47. package/skills/ti-api/references/api-ui-android.md +18 -0
  48. package/skills/ti-api/references/api-ui-extras.md +19 -1
  49. package/skills/ti-api/references/api-ui-ios-animator.md +14 -0
  50. package/skills/ti-api/references/api-ui-ios.md +42 -0
  51. package/skills/ti-api/references/api-ui-lists.md +14 -2
  52. package/skills/ti-api/references/api-ui-text-input.md +15 -0
  53. package/skills/ti-api/references/api-ui-views.md +19 -0
  54. package/skills/ti-api/references/api-ui-windows-navigation.md +13 -0
  55. package/skills/ti-api/references/api-xml-global.md +31 -0
  56. package/skills/ti-expert/SKILL.md +38 -5
  57. package/skills/ti-expert/references/adaptive-layouts.md +14 -0
  58. package/skills/ti-expert/references/alloy-builtins.md +26 -22
  59. package/skills/ti-expert/references/alloy-structure.md +57 -18
  60. package/skills/ti-expert/references/anti-patterns.md +13 -5
  61. package/skills/ti-expert/references/code-conventions.md +28 -3
  62. package/skills/ti-expert/references/controller-patterns.md +51 -26
  63. package/skills/ti-expert/references/error-handling.md +16 -0
  64. package/skills/ti-expert/references/examples.md +65 -21
  65. package/skills/ti-expert/references/feedback-migration.md +165 -0
  66. package/skills/ti-expert/references/feedback-surfaces.md +140 -0
  67. package/skills/ti-expert/references/feedback-widget-contracts.md +213 -0
  68. package/skills/ti-expert/references/migration-patterns.md +61 -24
  69. package/skills/ti-expert/references/patterns.md +16 -0
  70. package/skills/ti-expert/references/performance-optimization.md +17 -0
  71. package/skills/ti-expert/references/security-device.md +71 -56
  72. package/skills/ti-expert/references/state-management.md +21 -5
  73. package/skills/ti-expert/references/testing-e2e-ci.md +17 -0
  74. package/skills/ti-expert/references/testing-unit.md +20 -0
  75. package/skills/ti-expert/references/theming.md +135 -373
  76. package/skills/ti-guides/references/app-distribution.md +34 -0
  77. package/skills/ti-guides/references/application-frameworks.md +13 -0
  78. package/skills/ti-guides/references/cli-reference.md +16 -0
  79. package/skills/ti-guides/references/hyperloop-native-access.md +21 -0
  80. package/skills/ti-guides/references/javascript-primer.md +12 -0
  81. package/skills/ti-guides/references/tiapp-config.md +15 -0
  82. package/skills/ti-howtos/references/android-platform-deep-dives.md +15 -0
  83. package/skills/ti-howtos/references/cross-platform-development.md +16 -0
  84. package/skills/ti-howtos/references/debugging-profiling.md +15 -0
  85. package/skills/ti-howtos/references/extending-titanium.md +14 -0
  86. package/skills/ti-howtos/references/ios-platform-deep-dives.md +16 -0
  87. package/skills/ti-howtos/references/local-data-sources.md +32 -0
  88. package/skills/ti-howtos/references/notification-services.md +12 -0
  89. package/skills/ti-howtos/references/remote-data-sources.md +15 -0
  90. package/skills/ti-howtos/references/tutorials.md +13 -0
  91. package/skills/ti-ui/references/animation-and-matrices.md +17 -0
  92. package/skills/ti-ui/references/application-structures.md +19 -0
  93. package/skills/ti-ui/references/custom-fonts-styling.md +18 -0
  94. package/skills/ti-ui/references/event-handling.md +16 -0
  95. package/skills/ti-ui/references/gestures.md +17 -0
  96. package/skills/ti-ui/references/icons-and-splash-screens.md +17 -0
  97. package/skills/ti-ui/references/layouts-and-positioning.md +16 -0
  98. package/skills/ti-ui/references/listviews-and-performance.md +21 -0
  99. package/skills/ti-ui/references/orientation.md +20 -0
  100. package/skills/ti-ui/references/platform-ui-android.md +20 -0
  101. package/skills/ti-ui/references/platform-ui-ios.md +17 -0
  102. package/skills/ti-ui/references/tableviews.md +24 -0
@@ -1,5 +1,24 @@
1
1
  # Ti.UI Extras API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.Animation](#tiuianimation)
7
+ - [Ti.UI.Matrix2D](#tiuimatrix2d)
8
+ - [Ti.UI.Matrix3D](#tiuimatrix3d)
9
+ - [Ti.UI.WebView](#tiuiwebview)
10
+ - [Ti.UI.Toolbar](#tiuitoolbar)
11
+ - [Ti.UI.ButtonBar](#tiuibuttonbar)
12
+ - [Ti.UI.TabbedBar](#tiuitabbedbar)
13
+ - [Ti.UI.OptionBar](#tiuioptionbar)
14
+ - [Ti.UI.Shortcut](#tiuishortcut)
15
+ - [Ti.UI.ShortcutItem](#tiuishortcutitem)
16
+ - [Ti.UI.EmailDialog](#tiuiemaildialog)
17
+ - [Ti.UI.DashboardView](#tiuidashboardview)
18
+ - [Ti.UI.DashboardItem](#tiuidashboarditem)
19
+
20
+ <!-- TOC-END -->
21
+
3
22
  ## Ti.UI.Animation
4
23
  > The `Animation` object defines an animation that can be applied to a view.
5
24
  > Extends Ti.Proxy
@@ -523,7 +542,6 @@ Google documents how to add static shortcuts
523
542
  [here](https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts#static).
524
543
 
525
544
  In the `tiapp.xml` file, you will need to add a shortcuts `<meta-data/>` element to your main activity.
526
- ``` xml
527
545
 
528
546
  ### Properties (unique: 6/9)
529
547
  | Property | Type | Default | Platform | Description |
@@ -1,5 +1,19 @@
1
1
  # Ti.UI.iOS Animator & Physics API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.iOS.AnchorAttachmentBehavior](#tiuiiosanchorattachmentbehavior)
7
+ - [Ti.UI.iOS.Animator](#tiuiiosanimator)
8
+ - [Ti.UI.iOS.CollisionBehavior](#tiuiioscollisionbehavior)
9
+ - [Ti.UI.iOS.DynamicItemBehavior](#tiuiiosdynamicitembehavior)
10
+ - [Ti.UI.iOS.GravityBehavior](#tiuiiosgravitybehavior)
11
+ - [Ti.UI.iOS.PushBehavior](#tiuiiospushbehavior)
12
+ - [Ti.UI.iOS.SnapBehavior](#tiuiiossnapbehavior)
13
+ - [Ti.UI.iOS.ViewAttachmentBehavior](#tiuiiosviewattachmentbehavior)
14
+
15
+ <!-- TOC-END -->
16
+
3
17
  ## Ti.UI.iOS.AnchorAttachmentBehavior
4
18
  > Dynamic behavior to support connections between an anchor point and an item.
5
19
  > Extends Ti.Proxy
@@ -1,5 +1,47 @@
1
1
  # Ti.UI.iOS API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.iOS](#tiuiios)
7
+ - [Ti.UI.iOS.AlertDialogStyle](#tiuiiosalertdialogstyle)
8
+ - [Ti.UI.iOS.AnimationStyle](#tiuiiosanimationstyle)
9
+ - [Ti.UI.iOS.ApplicationShortcuts](#tiuiiosapplicationshortcuts)
10
+ - [Ti.UI.iOS.BlurView](#tiuiiosblurview)
11
+ - [Ti.UI.iOS.ButtonConfiguration](#tiuiiosbuttonconfiguration)
12
+ - [Ti.UI.iOS.CoverFlowView](#tiuiioscoverflowview)
13
+ - [Ti.UI.iOS.DocumentViewer](#tiuiiosdocumentviewer)
14
+ - [Ti.UI.iOS.FeedbackGenerator](#tiuiiosfeedbackgenerator)
15
+ - [Ti.UI.iOS.ListViewCellSelectionStyle](#tiuiioslistviewcellselectionstyle)
16
+ - [Ti.UI.iOS.ListViewScrollPosition](#tiuiioslistviewscrollposition)
17
+ - [Ti.UI.iOS.ListViewStyle](#tiuiioslistviewstyle)
18
+ - [Ti.UI.iOS.LivePhoto](#tiuiioslivephoto)
19
+ - [Ti.UI.iOS.LivePhotoView](#tiuiioslivephotoview)
20
+ - [Ti.UI.iOS.MenuPopup](#tiuiiosmenupopup)
21
+ - [Ti.UI.iOS.NavigationWindow](#tiuiiosnavigationwindow)
22
+ - [Ti.UI.iOS.PreviewAction](#tiuiiospreviewaction)
23
+ - [Ti.UI.iOS.PreviewActionGroup](#tiuiiospreviewactiongroup)
24
+ - [Ti.UI.iOS.PreviewContext](#tiuiiospreviewcontext)
25
+ - [Ti.UI.iOS.ProgressBarStyle](#tiuiiosprogressbarstyle)
26
+ - [Ti.UI.iOS.RowAnimationStyle](#tiuiiosrowanimationstyle)
27
+ - [Ti.UI.iOS.ScrollIndicatorStyle](#tiuiiosscrollindicatorstyle)
28
+ - [Ti.UI.iOS.SplitWindow](#tiuiiossplitwindow)
29
+ - [Ti.UI.iOS.StatusBar](#tiuiiosstatusbar)
30
+ - [Ti.UI.iOS.Stepper](#tiuiiosstepper)
31
+ - [Ti.UI.iOS.SystemButton](#tiuiiossystembutton)
32
+ - [Ti.UI.iOS.SystemIcon](#tiuiiossystemicon)
33
+ - [Ti.UI.iOS.TabbedBar](#tiuiiostabbedbar)
34
+ - [Ti.UI.iOS.TableViewCellSelectionStyle](#tiuiiostableviewcellselectionstyle)
35
+ - [Ti.UI.iOS.TableViewScrollPosition](#tiuiiostableviewscrollposition)
36
+ - [Ti.UI.iOS.TableViewStyle](#tiuiiostableviewstyle)
37
+ - [Ti.UI.iOS.Toolbar](#tiuiiostoolbar)
38
+ - [Ti.UI.iOS.TransitionAnimation](#tiuiiostransitionanimation)
39
+ - [Ti.UI.iOS.WebViewConfiguration](#tiuiioswebviewconfiguration)
40
+ - [Ti.UI.iOS.WebViewDecisionHandler](#tiuiioswebviewdecisionhandler)
41
+ - [Ti.UI.iOS.WebViewProcessPool](#tiuiioswebviewprocesspool)
42
+
43
+ <!-- TOC-END -->
44
+
3
45
  ## Ti.UI.iOS
4
46
  > Apple iOS specific UI capabilities. All properties, methods and events in this namespace will only work on Apple iOS devices.
5
47
  > Extends Ti.Module
@@ -1,5 +1,19 @@
1
1
  # Ti.UI Lists & Tables API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.ListView](#tiuilistview)
7
+ - [Ti.UI.ListItem](#tiuilistitem)
8
+ - [Ti.UI.ListSection](#tiuilistsection)
9
+ - [Ti.UI.ListViewScrollPosition](#tiuilistviewscrollposition)
10
+ - [Ti.UI.TableView](#tiuitableview)
11
+ - [Ti.UI.TableViewRow](#tiuitableviewrow)
12
+ - [Ti.UI.TableViewSection](#tiuitableviewsection)
13
+ - [Ti.UI.TableViewScrollPosition](#tiuitableviewscrollposition)
14
+
15
+ <!-- TOC-END -->
16
+
3
17
  ## Ti.UI.ListView
4
18
  > A list view is used to present information, organized in to sections and items, in a vertically-scrolling view.
5
19
  > Extends Ti.UI.View
@@ -15,7 +29,6 @@ A `ListView` object is a container for [ListSection](Titanium.UI.ListSection)
15
29
  objects that are, in turn, containers for [ListItem](Titanium.UI.ListItem) objects. This is
16
30
  easily visualized as an Alloy view:
17
31
 
18
- ``` xml
19
32
 
20
33
  ### Properties (unique: 54/122)
21
34
  | Property | Type | Default | Platform | Description |
@@ -155,7 +168,6 @@ Alloy applications can use **`<ListItem>`** elements to create `ListItem` object
155
168
  must be nested inside a **`<ListSection>`** element, which itself is nested in a `<ListView>` element,
156
169
  as shown below:
157
170
 
158
- ``` xml
159
171
 
160
172
  ### Properties (unique: 26/28)
161
173
  | Property | Type | Default | Platform | Description |
@@ -1,5 +1,20 @@
1
1
  # Ti.UI Text & Input API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.TextField](#tiuitextfield)
7
+ - [Ti.UI.TextArea](#tiuitextarea)
8
+ - [Ti.UI.SearchBar](#tiuisearchbar)
9
+ - [Ti.UI.AttributedString](#tiuiattributedstring)
10
+ - [Ti.UI.Color](#tiuicolor)
11
+ - [Ti.UI.Clipboard](#tiuiclipboard)
12
+ - [Ti.UI.Picker](#tiuipicker)
13
+ - [Ti.UI.PickerColumn](#tiuipickercolumn)
14
+ - [Ti.UI.PickerRow](#tiuipickerrow)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## Ti.UI.TextField
4
19
  > A single line text field.
5
20
  > Extends Ti.UI.View
@@ -1,5 +1,24 @@
1
1
  # Ti.UI Core Views API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.View](#tiuiview)
7
+ - [Ti.UI.Label](#tiuilabel)
8
+ - [Ti.UI.Button](#tiuibutton)
9
+ - [Ti.UI.ImageView](#tiuiimageview)
10
+ - [Ti.UI.ScrollView](#tiuiscrollview)
11
+ - [Ti.UI.ScrollableView](#tiuiscrollableview)
12
+ - [Ti.UI.ActivityIndicator](#tiuiactivityindicator)
13
+ - [Ti.UI.ActivityIndicatorStyle](#tiuiactivityindicatorstyle)
14
+ - [Ti.UI.ProgressBar](#tiuiprogressbar)
15
+ - [Ti.UI.Slider](#tiuislider)
16
+ - [Ti.UI.Switch](#tiuiswitch)
17
+ - [Ti.UI.MaskedImage](#tiuimaskedimage)
18
+ - [Ti.UI.RefreshControl](#tiuirefreshcontrol)
19
+
20
+ <!-- TOC-END -->
21
+
3
22
  ## Ti.UI.View
4
23
  > An empty drawing surface or container
5
24
  > Extends Ti.Proxy
@@ -1,5 +1,18 @@
1
1
  # Ti.UI Windows & Navigation API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.Window](#tiuiwindow)
7
+ - [Ti.UI.NavigationWindow](#tiuinavigationwindow)
8
+ - [Ti.UI.TabGroup](#tiuitabgroup)
9
+ - [Ti.UI.Tab](#tiuitab)
10
+ - [Ti.UI.AlertDialog](#tiuialertdialog)
11
+ - [Ti.UI.OptionDialog](#tiuioptiondialog)
12
+ - [Ti.UI.Notification](#tiuinotification)
13
+
14
+ <!-- TOC-END -->
15
+
3
16
  ## Ti.UI.Window
4
17
  > The Window is an empty drawing surface or container.
5
18
  > Extends Ti.UI.View
@@ -1,5 +1,36 @@
1
1
  # Ti.XML & Global API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.XML](#tixml)
7
+ - [Ti.XML.Attr](#tixmlattr)
8
+ - [Ti.XML.CDATASection](#tixmlcdatasection)
9
+ - [Ti.XML.CharacterData](#tixmlcharacterdata)
10
+ - [Ti.XML.Comment](#tixmlcomment)
11
+ - [Ti.XML.DOMImplementation](#tixmldomimplementation)
12
+ - [Ti.XML.Document](#tixmldocument)
13
+ - [Ti.XML.DocumentFragment](#tixmldocumentfragment)
14
+ - [Ti.XML.DocumentType](#tixmldocumenttype)
15
+ - [Ti.XML.Element](#tixmlelement)
16
+ - [Ti.XML.Entity](#tixmlentity)
17
+ - [Ti.XML.EntityReference](#tixmlentityreference)
18
+ - [Ti.XML.NamedNodeMap](#tixmlnamednodemap)
19
+ - [Ti.XML.Node](#tixmlnode)
20
+ - [Ti.XML.NodeList](#tixmlnodelist)
21
+ - [Ti.XML.Notation](#tixmlnotation)
22
+ - [Ti.XML.ProcessingInstruction](#tixmlprocessinginstruction)
23
+ - [Ti.XML.Text](#tixmltext)
24
+ - [Global](#global)
25
+ - [Global.Console](#globalconsole)
26
+ - [Global.Intl](#globalintl)
27
+ - [Global.Intl.Collator](#globalintlcollator)
28
+ - [Global.Intl.DateTimeFormat](#globalintldatetimeformat)
29
+ - [Global.Intl.NumberFormat](#globalintlnumberformat)
30
+ - [Global.String](#globalstring)
31
+
32
+ <!-- TOC-END -->
33
+
3
34
  ## Ti.XML
4
35
  > The top level XML module. The XML module is used for parsing and processing XML-based content.
5
36
  > Extends Ti.Module
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ti-expert
3
- description: "Use when designing, reviewing, analyzing, or examining Titanium SDK architecture and implementation (Alloy or Classic) — creating controllers/views/services, choosing models vs collections, implementing communication patterns, handling memory cleanup, testing, auditing code, migrating legacy apps, or building adaptive/responsive layouts for tablets, foldables, and large screens. AUTO-DETECT: If tiapp.xml exists, invoke BEFORE making architectural decisions, creating new controllers/views, or restructuring code. Titanium has its own patterns for navigation (NavigationWindow, TabGroup), memory management, and event handling that differ from web frameworks."
3
+ description: "Use when designing, reviewing, auditing, analyzing, or examining Titanium SDK architecture and implementation (Alloy or Classic) — creating controllers/views/services, choosing models vs collections, deciding between app-owned and system UI, designing reusable Widgets or feedback/modality patterns, hunting memory leaks and cleanup gaps, testing, migrating legacy apps, or building adaptive layouts for tablets, foldables, and large screens. AUTO-DETECT: If tiapp.xml exists, invoke BEFORE architectural decisions, new controllers/views, feedback components, or restructuring. Titanium navigation, memory, event, and modal patterns differ from web frameworks."
4
4
  argument-hint: "[architecture-topic]"
5
5
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash(git *), Bash(node *)
6
6
  ---
@@ -9,6 +9,26 @@ allowed-tools: Read, Grep, Glob, Edit, Write, Bash(git *), Bash(node *)
9
9
 
10
10
  Practical architecture and implementation guidance for Titanium SDK apps (Alloy and Classic). Focus on maintainability, clear boundaries, and low-friction testing.
11
11
 
12
+ ## Required workflow
13
+
14
+ This file is an index. Read the references that govern the task before making a
15
+ recommendation or changing code.
16
+
17
+ | Task | Required reading |
18
+ | --- | --- |
19
+ | Architecture tier, folders, or boundaries | [Architecture tiers](references/architecture-tiers.md), [Alloy structure](references/alloy-structure.md) |
20
+ | Feedback, alerts, choices, or app-owned versus system UI | [Feedback surfaces](references/feedback-surfaces.md) |
21
+ | Reusable Snackbar, Dialog, Bottom Sheet, Widget, or `<Require>` | [Feedback Widget contracts](references/feedback-widget-contracts.md), [Alloy structure](references/alloy-structure.md) |
22
+ | Migrating native dialogs, Toasts, or local overlays | [Feedback migration](references/feedback-migration.md), [Migration patterns](references/migration-patterns.md) |
23
+ | Theme or dark mode | [Theming](references/theming.md); if PurgeTSS is detected, invoke the `purgetss` skill before styling |
24
+ | Tablet, foldable, large screen, or responsive behavior | [Adaptive layouts](references/adaptive-layouts.md) |
25
+ | Security architecture | [Security fundamentals](references/security-fundamentals.md), [Device security](references/security-device.md) |
26
+ | Testing or performance | Load the matching guide under Quality & Performance below |
27
+
28
+ Support recommendations with `[source: references/<file>.md]`. If a claim cannot
29
+ be verified from the loaded references or inspected project, prefix it with
30
+ `FROM_MEMORY (unverified):` and do not present it as a settled project fact.
31
+
12
32
  ## Project detection
13
33
 
14
34
  > **️ℹ️ Auto-detects Alloy vs Classic projects**
@@ -33,9 +53,10 @@ Practical architecture and implementation guidance for Titanium SDK apps (Alloy
33
53
  1. Architecture: define structure by technical type with flat folders (`lib/api`, `lib/services`, `lib/actions`, `lib/repositories`, `lib/helpers`)
34
54
  2. Data strategy: choose Models (SQLite) or Collections (API)
35
55
  3. Contracts: define I/O specs between layers
36
- 4. Implementation: write XML views and ES6+ controllers
37
- 5. Quality: testing, error handling, logging, performance
38
- 6. Cleanup: implement a `cleanup()` pattern for memory management
56
+ 4. UI ownership: classify app-owned feedback, screen state, and system-owned flows
57
+ 5. Implementation: write XML views and ES6+ controllers
58
+ 6. Quality: testing, error handling, logging, performance
59
+ 7. Cleanup: implement a `cleanup()` pattern for memory management
39
60
 
40
61
  ## Architectural Maturity Tiers
41
62
 
@@ -84,6 +105,12 @@ Detailed examples and full implementation samples are available in: [Architectur
84
105
 
85
106
  ## Titanium style sheets rules (low freedom)
86
107
 
108
+ Before styling, detect `purgetss/` or `purgetss/config.cjs`. If present, invoke
109
+ the `purgetss` skill, verify every utility, and never edit the generated
110
+ `app/styles/app.tss`. Without PurgeTSS, use standard Alloy TSS files. In either
111
+ case, keep behavior in XML/controllers and use semantic colors for app-owned
112
+ surfaces when the project supports them.
113
+
87
114
  > **🚨 Critical: platform-specific properties require modifiers**
88
115
  > Using `Ti.UI.iOS.*` or `Ti.UI.Android.*` properties without platform modifiers breaks cross-platform builds.
89
116
  >
@@ -138,7 +165,10 @@ For the complete reference with examples, see [Alloy builtins and globals](refer
138
165
  | Models or Collections? | Collections for API data, Models for SQLite persistence |
139
166
  | Ti.App.fireEvent or EventBus? | Always EventBus (Backbone.Events) |
140
167
  | Direct navigation or service? | Always Navigation service (auto cleanup) |
141
- | Inline styles or TSS files? | Always TSS files (per-controller + `app.tss` for global) |
168
+ | Snackbar, Dialog, or Bottom Sheet? | Classify urgency, persistence, reversibility, and choice first |
169
+ | Widget or `<Require>`? | Widget for a self-contained API/lifecycle; `<Require>` for app composition |
170
+ | App-owned or native UI? | Keep OS trust/protected flows native; style app-owned feedback |
171
+ | Inline styles or style system? | PurgeTSS utilities when detected; otherwise Alloy TSS |
142
172
 
143
173
  ## Reference guides (progressive disclosure)
144
174
 
@@ -155,6 +185,9 @@ For the complete reference with examples, see [Alloy builtins and globals](refer
155
185
  - [Alloy Builtins & Globals](references/alloy-builtins.md)
156
186
  - [Code Conventions](references/code-conventions.md)
157
187
  - [Controller Patterns](references/controller-patterns.md)
188
+ - [Feedback Surfaces & App-Owned UI](references/feedback-surfaces.md)
189
+ - [Feedback Widget Contracts](references/feedback-widget-contracts.md)
190
+ - [Feedback Migration](references/feedback-migration.md)
158
191
  - [Theming & Dark Mode](references/theming.md)
159
192
  - [Migration Patterns](references/migration-patterns.md)
160
193
  - [Examples Collection](references/examples.md)
@@ -4,6 +4,20 @@ Patterns for building responsive Titanium apps that work across phones, tablets,
4
4
 
5
5
  This reference is NOT derived from official Titanium documentation. It addresses Google's Android 17 resizability requirements and provides reusable patterns for adaptive UI in Titanium/Alloy apps.
6
6
 
7
+ <!-- TOC-START -->
8
+ ## Contents
9
+
10
+ - [1. Context: Android 17 resizability requirements](#1-context-android-17-resizability-requirements)
11
+ - [2. Detecting window size](#2-detecting-window-size)
12
+ - [3. Layout strategy](#3-layout-strategy)
13
+ - [4. Controller pattern](#4-controller-pattern)
14
+ - [5. Grid simulation](#5-grid-simulation)
15
+ - [6. Anti-patterns](#6-anti-patterns)
16
+ - [7. tiapp.xml configuration](#7-tiappxml-configuration)
17
+ - [8. Quick reference](#8-quick-reference)
18
+
19
+ <!-- TOC-END -->
20
+
7
21
  ## 1. Context: Android 17 resizability requirements
8
22
 
9
23
  Starting with Android 17 (API 37), on devices with screens >= 600dp (tablets, foldables, desktop mode), Google ignores these manifest attributes:
@@ -1,5 +1,20 @@
1
1
  # Alloy builtins & globals
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Compiler directives](#compiler-directives)
7
+ - [Alloy.Globals](#alloyglobals)
8
+ - [Alloy.CFG](#alloycfg)
9
+ - [Alloy.isTablet / Alloy.isHandheld](#alloyistablet-alloyishandheld)
10
+ - [$.args , controller arguments](#args-controller-arguments)
11
+ - [Alloy.createController / Alloy.createWidget](#alloycreatecontroller-alloycreatewidget)
12
+ - [Alloy.createModel / Alloy.createCollection](#alloycreatemodel-alloycreatecollection)
13
+ - [Conditional code in XML](#conditional-code-in-xml)
14
+ - [Quick reference](#quick-reference)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## Compiler directives
4
19
 
5
20
  Alloy provides compile-time constants that are replaced with `true`/`false` during build. Use them for platform-specific code without runtime cost.
@@ -60,13 +75,6 @@ Shared state and utilities accessible from any controller or lib file. Set in `a
60
75
  // alloy.js
61
76
  const Backbone = require('alloy/backbone')
62
77
 
63
- // --- Theme / Design Tokens ---
64
- Alloy.Globals.theme = {
65
- primary: '#2563eb',
66
- bg: '#ffffff',
67
- text: '#111827'
68
- }
69
-
70
78
  // --- Device Info (cached once) ---
71
79
  Alloy.Globals.isTablet = Alloy.isTablet
72
80
  Alloy.Globals.screenWidth = Ti.Platform.displayCaps.platformWidth
@@ -85,27 +93,23 @@ Alloy.Collections.notifications = new Backbone.Collection()
85
93
  ### Access from anywhere
86
94
 
87
95
  ```javascript
88
- // In any controller
89
- const theme = Alloy.Globals.theme
90
- $.label.color = theme.primary
91
-
92
- // In TSS (evaluated at compile time for controller creation)
93
- "#header": {
94
- backgroundColor: Alloy.Globals.theme.primary
95
- }
96
-
97
96
  // In XML with conditional binding
98
97
  // <View if="Alloy.Globals.isLoggedIn">
99
98
  ```
100
99
 
100
+ Do not use `Alloy.Globals` as the default dark-mode palette. Prefer Titanium
101
+ semantic colors; when PurgeTSS is detected, use its semantic color and Appearance
102
+ workflow. Reserve a global runtime palette for custom theme requirements that
103
+ semantic light/dark/system roles cannot model. See [Theming](theming.md).
104
+
101
105
  ### Globals vs services
102
106
 
103
- | Use `Alloy.Globals` for | Use a Service for |
104
- | ---------------------------------- | ----------------------------- |
105
- | Static config (theme, device info) | Business logic |
106
- | Simple flags (isLoggedIn) | Complex state with listeners |
107
- | Values set once in `alloy.js` | Values that change frequently |
108
- | Read-only data | Data with side effects |
107
+ | Use `Alloy.Globals` for | Use a Service for |
108
+ | ------------------------------------- | ----------------------------- |
109
+ | Immutable device/build facts | Business logic |
110
+ | Framework-level shared registries | Complex state with listeners |
111
+ | Values initialized once in `alloy.js` | Values that change frequently |
112
+ | Read-only interoperability data | Data with side effects |
109
113
 
110
114
  ---
111
115
 
@@ -1,5 +1,20 @@
1
1
  # Alloy MVC structure reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Standard project structure](#standard-project-structure)
7
+ - [Organization strategy](#organization-strategy)
8
+ - [lib/ folder and module require paths](#lib-folder-and-module-require-paths)
9
+ - [Data layer: two approaches](#data-layer-two-approaches)
10
+ - [Controller rules](#controller-rules)
11
+ - [Navigation & cleanup pattern](#navigation-cleanup-pattern)
12
+ - [i18n and accessibility rules](#i18n-and-accessibility-rules)
13
+ - [Widget structure](#widget-structure)
14
+ - [config.json reference](#configjson-reference)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## Standard project structure
4
19
 
5
20
  ```
@@ -15,7 +30,7 @@ app/
15
30
  │ ├── home.xml
16
31
  │ └── userProfile.xml
17
32
  ├── styles/ # TSS styles (one per view + global)
18
- │ ├── app.tss # Global application styles
33
+ │ ├── app.tss # Standard Alloy global styles or PurgeTSS generated output
19
34
  │ ├── index.tss # Styles for index view
20
35
  │ ├── home.tss
21
36
  │ └── userProfile.tss
@@ -44,7 +59,7 @@ app/
44
59
  │ └── providers/
45
60
  │ ├── containerProvider.js
46
61
  │ └── loggerProvider.js
47
- ├── widgets/ # Truly reusable components (used in 3+ places)
62
+ ├── widgets/ # Self-contained components with an API/lifecycle boundary
48
63
  │ └── customButton/
49
64
  ├── config.json # Alloy configuration
50
65
  └── alloy.js # Collections & Global services
@@ -173,7 +188,8 @@ api.getFrames()
173
188
  ## Controller rules
174
189
 
175
190
  **DO:**
176
- - Define styles in TSS files (per-controller + `app.tss` for global).
191
+ - Use verified PurgeTSS utilities when detected; otherwise define styles in
192
+ per-controller TSS and manually maintained global TSS.
177
193
  - Orchestrate view and model/collection interactions.
178
194
  - Handle UI events and delegate to services.
179
195
  - Format data for display (simple cases).
@@ -181,7 +197,7 @@ api.getFrames()
181
197
  - Keep `lib` modules flat and easy to locate.
182
198
 
183
199
  **DON'T:**
184
- - Use inline style attributes in XML (define in TSS files).
200
+ - Scatter visual properties inline when the active style system can express them.
185
201
  - Make direct API calls (use lib/api/ or lib/services/).
186
202
  - Contain heavy business logic.
187
203
  - Call native modules directly (use a service wrapper).
@@ -230,7 +246,10 @@ See [ControllerAutoCleanup.js](../assets/ControllerAutoCleanup.js) for the compl
230
246
 
231
247
  ## Widget structure
232
248
 
233
- Widgets are self-contained, reusable components used in 3+ places across the app.
249
+ Widgets are self-contained components with their own public API, state, assets,
250
+ and lifecycle. Choose one for a portable boundary, not after an arbitrary number
251
+ of usages. A first-use component with timers, modal state, and cleanup can merit
252
+ a Widget; repeated static styling does not.
234
253
 
235
254
  ```
236
255
  app/widgets/
@@ -240,7 +259,7 @@ app/widgets/
240
259
  ├── views/
241
260
  │ └── widget.xml # Main widget view
242
261
  ├── styles/
243
- │ └── widget.tss # Widget-specific styles
262
+ │ └── widget.tss # Optional component-specific styles
244
263
  └── widget.json # Widget manifest
245
264
  ```
246
265
 
@@ -261,6 +280,17 @@ app/widgets/
261
280
  }
262
281
  ```
263
282
 
283
+ Register the Widget in the app's `app/config.json`; the dependency key must
284
+ match the manifest `id`:
285
+
286
+ ```json
287
+ {
288
+ "dependencies": {
289
+ "com.app.loadingOverlay": "1.0.0"
290
+ }
291
+ }
292
+ ```
293
+
264
294
  ### Widget view (widget.xml)
265
295
  ```xml
266
296
  <Alloy>
@@ -275,10 +305,10 @@ app/widgets/
275
305
 
276
306
  ```tss
277
307
  /* styles/widget.tss */
278
- "#container": { width: Ti.UI.FILL, height: Ti.UI.FILL, visible: false, backgroundColor: 'rgba(0,0,0,0.5)' }
279
- "#box": { width: 128, height: 128, layout: 'vertical', borderRadius: 16, backgroundColor: '#fff' }
308
+ "#container": { width: Ti.UI.FILL, height: Ti.UI.FILL, visible: false, backgroundColor: 'overlayColor' }
309
+ "#box": { width: 128, height: 128, layout: 'vertical', borderRadius: 16, backgroundColor: 'surfaceColor' }
280
310
  "#spinner": { top: 24 }
281
- "#messageLabel": { left: 16, right: 16, top: 16, font: { fontSize: 14 }, color: '#4b5563' }
311
+ "#messageLabel": { left: 16, right: 16, top: 16, font: { fontSize: 14 }, color: 'textColor' }
282
312
  ```
283
313
 
284
314
  ### Widget controller (widget.js)
@@ -337,8 +367,12 @@ const loadData = () => {
337
367
  }
338
368
  ```
339
369
 
340
- > **💡 Widget Styles**
341
- > Widgets have their own `styles/widget.tss` file. Define all widget-specific styles there to keep them self-contained and portable.
370
+ > **Widget styles**
371
+ > In a standard Alloy project, keep component-specific properties in
372
+ > `styles/widget.tss` and consume semantic colors. If PurgeTSS is detected, load
373
+ > its skill first, enable Widget scanning, place verified utilities in XML, and
374
+ > reserve `widget.tss` for properties with no utility. Never edit the generated
375
+ > `app/styles/app.tss`.
342
376
 
343
377
  ### Widget ↔ controller communication
344
378
 
@@ -449,13 +483,18 @@ render()
449
483
 
450
484
  ### When to use widget vs require
451
485
 
452
- | Use `<Widget>` when | Use `<Require>` when |
453
- | ------------------------------------- | ------------------------------- |
454
- | Component is used in 3+ places | Component is used in 1-2 places |
455
- | Needs its own self-contained styles | Shares styles with parent |
456
- | Has public API (show/hide/setValue) | Just renders, no API needed |
457
- | Could be extracted to another project | Specific to this app |
458
- | Needs its own `widget.json` manifest | Lightweight, no manifest needed |
486
+ | Use `<Widget>` when | Use `<Require>` when |
487
+ | ------------------------------------- | ------------------------------------ |
488
+ | Owns a stable public API | Composes an app-specific controller |
489
+ | Owns state, timers, listeners, or cleanup | Shares the host's lifecycle |
490
+ | Has a portable design-system boundary | Shares the host's domain and styling |
491
+ | Could be extracted to another project | Has no independent package contract |
492
+ | Needs its own `widget.json` manifest | Remains lightweight and app-local |
493
+
494
+ Usage count is supporting evidence only. Also consider a screen-local XML state
495
+ for loading/empty/error content, a style class for appearance without behavior,
496
+ or native UI when the operating system owns the workflow. See
497
+ [Feedback Widget Contracts](feedback-widget-contracts.md).
459
498
 
460
499
  ## config.json reference
461
500
 
@@ -67,14 +67,22 @@
67
67
  ## 13. Using `Ti.UI.createNotification`
68
68
  **Symptom:** `Ti.UI.createNotification({ message: 'Hi' }).show()`
69
69
  **Problem:** This API doesn't exist in Titanium. Causes "invalid method" error.
70
- **Solution:** Use `Ti.UI.createAlertDialog` for simple messages, or create custom toast views.
70
+ **Solution:** Classify the feedback before choosing UI. Use the app's Snackbar
71
+ Widget for transient foreground feedback, inline/Banner state for persistent
72
+ conditions, and an app-owned Dialog only for blocking or critical information.
73
+ Use the supported platform notification APIs only for actual OS notifications.
74
+ See [Feedback Surfaces](feedback-surfaces.md).
71
75
 
72
76
  ## 14. Using nonexistent iOS share APIs
73
77
  **Symptom:** `Ti.UI.iOS.createActivityPopover` or `alloy/social` with wrong methods.
74
78
  **Problem:** These APIs either don't exist or have changed. Causes runtime errors.
75
79
  **Solution:**
76
- - iOS: Use `Ti.UI.iOS.createDocumentViewer` for files, or simple `Ti.UI.createOptionDialog` + `Ti.UI.Clipboard` for links
77
- - Android: Use `Ti.Android.createIntent` with ACTION_SEND
80
+ - Keep sharing system-owned. Use the currently supported Titanium share/document
81
+ API or native module for the target platform and verify its current contract
82
+ with the `ti-api` skill.
83
+ - Do not imitate a share sheet with an app-owned `OptionDialog`. A Bottom Sheet
84
+ may choose an app action such as an export format, but the OS share surface
85
+ owns the final destination.
78
86
 
79
87
  ## Community-Discovered Patterns
80
88
 
@@ -117,8 +125,8 @@ This applies to Windows inside both standalone NavigationWindow and TabGroup (wh
117
125
  | ----------------------- | ------------------------ | --------------------- |
118
126
  | `padding` on View | No padding on containers | Margins on children |
119
127
  | `layout: 'composite'` | Already default | Omit it |
120
- | Inline style attributes | Scattered styling | Define in TSS files |
128
+ | Inline style attributes | Scattered styling | PurgeTSS utilities when detected; otherwise TSS |
121
129
  | `lib/` prefix | lib/ is flattened | Use path without lib/ |
122
130
  | `$.index.open()` | Wrong ID reference | Use actual Window ID |
123
- | `createNotification` | API doesn't exist | `createAlertDialog` |
131
+ | `createNotification` | API doesn't exist | Classify feedback; Snackbar is the transient default |
124
132
  | `extendEdges` alone | Content behind nav bar | Add `autoAdjustScrollViewInsets: true` |