I have been making suggestions for improvements to Glide as I encounter problems either in functionality or usability. This suggestion is in the usability category.
In Glide, a Template is a sequence of Components which represent different types of data or combinations of data. Examples include various styles of formatted text, images, audio, video, numbers, etc., as well as various kinds of controls such as buttons, choices, pickers,. etc.
After building Glide apps for a while, I notice that I repeat a common way of performing certain repeated Patterns. For example, with generous help from the Glide Community, I implement a careful delete: a delete button which if tapped asks you if you really want to delete something. This response shows two buttons, “Yes, Delete” and “No, Cancel”. Implementing this common pattern requires 4 separate components each with specific settings and references to the source sheets of data.
Once I worked out this solution, I wanted to use it in the template for another type of item in my app and discovered that it was very hard to copy the components of the define a pattern into the template for this new type of item. What I really needed was a way to define a pattern as a named sequence of components that I could use elsewhere.
Sooo, I’d like to propose an addition to Glide to change the definition of a Template from:
A Template is a sequence of Components.
A Pattern is a named sequence of Components with Arguments.
A Template is a sequence of Components and/or Patterns with Arguments
A pattern is like a function call in that different arguments change the behavior of the pattern. Unlike a function call, arguments are strings that replace identifiers in the pattern when the pattern is expanded to commands. The expansion of a pattern results in just a sequence of components with various settings from arguments to the pattern.
Another term for a Pattern is a Macro.
I believe allowing Glide developers to define and use Patterns would be a mechanism that will increase implementation speed as well as satisfy the need for app-specific improvements.