-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inlineAction on text boxes #147
Comments
This is achievable with a ColumnSet with 2 columns; the left one contains the input and has its size property set to stretch, the right one has size = auto and contains the image with its selectAction set. |
Good point. I'll close this, thanks! |
(nvm, will open new issue on ability to associate input with text box for Ctrl+Enter) |
Actually we do have to re-open this. Using two columns with a size = auto on the image column doesn't work, as seen below There's no way to force the image to match the height of the text box. The airplane seen there displays taller than the text box itself. Maybe we need a size property on the image itself that is "button" or something? Or even better, "squareButton". |
Would the ability to vertically center content in both columns solve the problem? |
Vertically center wouldn't force the image to match the height of the text box. If the image is 200 px tall and the text box is only 80 px tall, you're still going to have 60 px of blank space above and below the text box |
Why not use an image that's as tall as the input then? You control the input's height. Plus you probably don't want a stretched or downsized image anyway? |
How does the card author control the input height? Each card host might have different input heights. We don't want devs needing to provide different images for each host. Plus, what happens in a future release when a card host decides "My input text boxes are now going to be 90px tall instead of 80px", all existing cards being sent will look incorrect. Guidance would definitely be "Provide the correct resolution image", but the reality is, that can't be the only solution due to its drawbacks (future app-compat issues being the key drawback). |
The host controls the height of the inputs and the available image sizes. It could be a convention that the "small" image size is the same height as an input, but there is no guarantee. |
I think a new image size, {
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "stretch",
"items": [
{
"type": "Input.Text",
"id": "textInput",
"placeholder": "reply"
}
]
},
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "Image",
"url": "Assets/Icons/send.png",
"size": "squareImageButton",
"selectAction": {
"type": "Action.Submit",
"title": "Send"
}
}
]
}
]
} Adding the new size allows hosts to still keep |
@Anbare would you consider this necessary for v1 to ship notifications? |
Without this that would mean the story is: "If you want to make a quick reply message toast, you have to use legacy XML" Maybe that's an ok story, most of the scenarios that require new Card features like ShowCard and hit targets are all using normal buttons rather than quick reply buttons. But it's definitely not a perfect story. |
What if we add something semantic like We would also need to get in #389 Action/Image support {
"type": "Input.Text",
"id": "comment",
"placeholder": "enter comment",
"maxLength": 500,
"isMultiline": false,
"speak": "What comments do you have?",
"value": "This is a pre-filled value",
"defaultAction": {
"showButton": false,
"action": {
"type": "Action.Submit"
}
}
} |
Proposal approved. Open question around vertical alignment as the input grows. Align to the bottom? That's what Windows does. |
I think that we'll need an iconSize property as we have in the Icons in Actions fir the renderers that cannot easily calculate the height of the text box (HTML and Typescript). |
* Create Image.md * Update Image.md * Update Image.md * More specs * Media element * Trying to get auto generate working * Closer! * [Schema] Document data URI Feature spec #628 * [Schema] Introduce inlineAction Original spec #147 * Specs auto-generated! * [Schema] Add ActionSet Spec #877 * Include marked-schema locally * Improve formatting of markdown table * [Schema] Update version description Make description for version attribute a little more clear about being required for toplevel cards. Fixes #2958 * [Schema] Add fontType to TextBlock Spec #1078 * [Schema] Add wrap to ChoiceSet and Toggle Spec #1887 * Move spec generation to separate module * Standalone spec generator script * Auto-update specs on save * Add some readme's * Spec updating readme * Point people to the readme * 1.2 features * Move Adaptive Card rendering into the actual spec file * Started adding action specs * Generate host config * More action info * More ActionSet details * Mock renderer statuses * Finished with actions * Columns * Start adding backgroundImage * Started working on schema-with-types * Testing infrastructure * Add URI support * Add required support * Refactor to class * Add type references * Add extending classes * Add inehritance with referencing base class * Support multiple types for single property * Add arrays * Add tests for arrays of base types * Add dictionary support * Generate typed schema schema from typed schema itself * Add typed schema schema * Add booleans * Disallow additional properties * Add extends and schema to json schema * Started updating some of the schema * Support multiple top-level types and other fixes * Fix not being able to add properties to extended classes * Add ability to change property name of type property * Support having a default type that doesn't need type specified * New classType schema * Add ContainerStyle enum * Add VerticalContentAlignment * Support default and required in schema * Support any object type * Update schemas * Add nullable * Add any arrays * Update schemas * Add shorthands * Start writing more schema * Allow type to not be specified at top level * Infer type names from file name * Add more schema * Add marker interfaces * More elements * Support recursive directories * Rename to typed-schema * Report more useful errors * Start generating Adaptive Card schema * Support enums * Schema starting to work! * Fix incorrect container property * Fix extended classes not allowing extended properties * Rename to src folder * Adding columns * Closer to multiple tiers of extending * Support multiple inheritance * Throw errors on unknown types * Rename to BlockElement * Add FactSet * Add ImageSet * Add Input.Text * Added all inputs * Add typed classes for the parser * Create overall Schema type object * Support loading schema from folder * Almost got spec generation working with new format! * Add ActionSet * Markdown generation is getting there! * Markdown generation almost done * Generate enum specs * Add enum value description support * Add shorthand property to classes * Update schema to support shorthand * Update schema file * Include lib * Updated schema * Add RichTextBlock * Re-organize * Change image uris to strings for relative urls * Add Style property to Card * Add Action.ToggleVisibility * Add style to actions * Remove duplicative BlockElement properties * Add fallback * Update wrap property on inputs * Generated * Update Input.Text selectAction * Generate * Add some versions * Fix blank allOf * Added a test that tests our samples * Add horizontalAlignment to richtextblock * Add minHeight * Add minHeight to AdaptiveCard * Add isVisible * Update package-lock.json * Add verticalContentAlignment to Adaptive Card * Add height to container and columnset * Add height to Column * Add height to all elements * Support overriding properties * Fix image height property * Fix overriding of inherited properties * Update adaptive-card-new.json * Make Column.items not required * All samples valid * Use uri-reference * Support allowAdditionalProperties * Allow custom enums * card.style version = 1.2 * Include build-model * Correctly display version number in markdown * Support shorthands in markdown and fix background image version * Remove generate-specs from website * Generating site from new schema partially working * Site generating properties * Fix schema literals in website properties * Make inherited detailed properties appear, and fix examples for properties * Make type appear correctly on markdown tables * Update toc * Add new elements * Re-order version property * Show type type in type * Support displaying enum value versions * Style the default value correctly * Indicate that type on inlines is required * Support inline shorthand * Improve image size documentation * Fix inlineAction description * Surface required properties at top of table * Remove local marked-schema * Rename BlockElement to Element * Dispaly uri-reference as uri * Rename fonttype sample * Add expense report example * Update schema file in sample * Update ExpenseReport to use Submit * Support case insensitive enums * Remove generated adaptive card schema * Make release build schema * Remove compiled typed-script schema * Add instruction for generating Adaptive schema * Remove spec-generator * Update samples schema test to use correct payload * Remove specs * Support multiple schema versions * UWP test updates for renamed FontType test * Typo in UWP test app * Update UWP tests after sample payloads changed * Add FontType expected tests * Add readme for schema * Update Visualizer to reference new schema file and all samples * Fix iOS referencing old FontTypes payload
✔️ Android (#1285)
✔️ iOS (#1284)
✔️ TS (#1360)
✔️ UWP (#1283)
✔️ Designer (#2674)
Solves requests
Example Comps
Notice how Android notifications choose to display the button as part of the text input. The payload should allow this flexibility for the host to display the button however makes sense.
Spec
Schema Changes
On only Input.Text (since that seems to be the only place a quick action would be desired on an input), the following property would be added...
Schema example
Host Config
Renderer Requirements
Android might display like the following...
Inline expansion of Action.ShowCard is NOT supported (since we don't support inline showcards within the body right now). If a show card is present and the host is configured for inline show cards the action will be dropped and a warning will be returned.
A renderer must invoke the inlineAction when the user performs the native platform action for submitting a text field...
Renderers must assign a style of
InlineAction
(or whatever the renderer standard for style names is) to the button so that hosts can natively style the button as they wishDownlevel Impact
High
This will not be able to render properly, and the card will be unfunctional.
Host impact: Medium. Hosts need to update their native styling to include this new InlineAction button.
Related features
Auto-generated task status
The text was updated successfully, but these errors were encountered: