diff --git a/agent_sdks/python/src/a2ui/a2a.py b/agent_sdks/python/src/a2ui/a2a.py index 4ba3e3530..7e1059612 100644 --- a/agent_sdks/python/src/a2ui/a2a.py +++ b/agent_sdks/python/src/a2ui/a2a.py @@ -13,8 +13,10 @@ # limitations under the License. import logging -from typing import Any, Optional, List +from typing import Any, Optional, List, AsyncIterable, TYPE_CHECKING +if TYPE_CHECKING: + from a2ui.core.parser.streaming import A2uiStreamParser from a2a.server.agent_execution import RequestContext from a2a.types import ( AgentExtension, @@ -247,3 +249,39 @@ def try_activate_a2ui_extension( return selected_uri.replace(f"{A2UI_EXTENSION_BASE_URI}/v", "") return None + + +async def stream_response_to_parts( + parser: "A2uiStreamParser", + token_stream: AsyncIterable[str], +) -> AsyncIterable[Part]: + """Helper to parse a stream of LLM tokens into A2A Parts incrementally. + + Args: + parser: A2uiStreamParser instance to process the stream. + token_stream: An async iterable of strings (tokens). + + Yields: + A2A Part objects as they are discovered in the stream. + """ + async for token in token_stream: + logger.info("-----------------------------") + logger.info(f"--- AGENT: Received token:\n{token}") + response_parts = parser.process_chunk(token) + logger.info( + f"--- AGENT: Response parts:\n{[part.a2ui_json for part in response_parts]}\n" + ) + logger.info("-----------------------------") + + for part in response_parts: + if part.text: + yield Part(root=TextPart(text=part.text)) + + if part.a2ui_json: + json_data = part.a2ui_json + + if isinstance(json_data, list): + for message in json_data: + yield create_a2ui_part(message) + else: + yield create_a2ui_part(json_data) diff --git a/agent_sdks/python/src/a2ui/core/schema/constants.py b/agent_sdks/python/src/a2ui/core/schema/constants.py index e1df873e3..dbbc11498 100644 --- a/agent_sdks/python/src/a2ui/core/schema/constants.py +++ b/agent_sdks/python/src/a2ui/core/schema/constants.py @@ -52,8 +52,12 @@ DEFAULT_WORKFLOW_RULES = f""" The generated response MUST follow these rules: -1. The response can contain one or more A2UI JSON blocks. -2. Each A2UI JSON block MUST be wrapped in `{A2UI_OPEN_TAG}` and `{A2UI_CLOSE_TAG}` tags. -3. Between or around these blocks, you can provide conversational text. -4. The JSON part MUST be a single, raw JSON object (usually a list of A2UI messages) and MUST validate against the provided A2UI JSON SCHEMA. +- The response can contain one or more A2UI JSON blocks. +- Each A2UI JSON block MUST be wrapped in `{A2UI_OPEN_TAG}` and `{A2UI_CLOSE_TAG}` tags. +- Between or around these blocks, you can provide conversational text. +- The JSON part MUST be a single, raw JSON object (usually a list of A2UI messages) and MUST validate against the provided A2UI JSON SCHEMA. +- Top-Down Component Ordering: Within the `components` list of a message: + - The 'root' component MUST be the FIRST element. + - Parent components MUST appear before their child components. + This specific ordering allows the streaming parser to yield and render the UI incrementally as it arrives. """ diff --git a/samples/agent/adk/contact_lookup/agent.py b/samples/agent/adk/contact_lookup/agent.py index a34d3a977..a68c020b4 100644 --- a/samples/agent/adk/contact_lookup/agent.py +++ b/samples/agent/adk/contact_lookup/agent.py @@ -21,6 +21,7 @@ import jsonschema +from google.adk.agents import run_config from google.adk.agents.llm_agent import LlmAgent from google.adk.artifacts import InMemoryArtifactService from google.adk.memory.in_memory_memory_service import InMemoryMemoryService @@ -43,7 +44,11 @@ from a2ui.core.schema.manager import A2uiSchemaManager from a2ui.core.parser.parser import parse_response, ResponsePart from a2ui.basic_catalog.provider import BasicCatalog -from a2ui.a2a import create_a2ui_part, get_a2ui_agent_extension, parse_response_to_parts +from a2ui.a2a import ( + get_a2ui_agent_extension, + parse_response_to_parts, + stream_response_to_parts, +) logger = logging.getLogger(__name__) @@ -61,6 +66,7 @@ def __init__(self, base_url: str): self._schema_managers: Dict[str, A2uiSchemaManager] = {} self._ui_runners: Dict[str, Runner] = {} + self._parsers: Dict[str, A2uiStreamParser] = {} for version in [VERSION_0_8, VERSION_0_9]: schema_manager = self._build_schema_manager(version) @@ -233,27 +239,46 @@ async def stream( current_message = types.Content( role="user", parts=[types.Part.from_text(text=current_query_text)] ) - final_response_content = None - async for event in runner.run_async( - user_id=self._user_id, - session_id=session.id, - new_message=current_message, - ): - logger.info(f"Event from runner: {event}") - if event.is_final_response(): - if event.content and event.content.parts and event.content.parts[0].text: - final_response_content = "\n".join( - [p.text for p in event.content.parts if p.text] - ) - break # Got the final response, stop consuming events - else: - logger.info(f"Intermediate event: {event}") - # Yield intermediate updates on every attempt + full_content_list = [] + + async def token_stream(): + async for event in runner.run_async( + user_id=self._user_id, + session_id=session.id, + run_config=run_config.RunConfig( + streaming_mode=run_config.StreamingMode.SSE + ), + new_message=current_message, + ): + if event.content and event.content.parts: + for p in event.content.parts: + if p.text: + full_content_list.append(p.text) + yield p.text + + if selected_catalog: + from a2ui.core.parser.streaming import A2uiStreamParser + + if session_id not in self._parsers: + self._parsers[session_id] = A2uiStreamParser(catalog=selected_catalog) + + async for part in stream_response_to_parts( + self._parsers[session_id], + token_stream(), + ): yield { "is_task_complete": False, - "updates": self.get_processing_message(), + "parts": [part], } + else: + async for token in token_stream(): + yield { + "is_task_complete": False, + "updates": token, + } + + final_response_content = "".join(full_content_list) if final_response_content is None: logger.warning( @@ -265,8 +290,10 @@ async def stream( "I received no response. Please try again." f"Please retry the original request: '{query}'" ) + logger.info(f"Retrying with query: {current_query_text}") continue # Go to next retry else: + logger.info("Retries exhausted on no-response") # Retries exhausted on no-response final_response_content = ( "I'm sorry, I encountered an error and couldn't process your request." diff --git a/samples/agent/adk/contact_lookup/agent_executor.py b/samples/agent/adk/contact_lookup/agent_executor.py index f83df30fa..abf2c7abd 100644 --- a/samples/agent/adk/contact_lookup/agent_executor.py +++ b/samples/agent/adk/contact_lookup/agent_executor.py @@ -33,6 +33,7 @@ from a2a.utils.errors import ServerError from agent import ContactAgent from a2ui.a2a import try_activate_a2ui_extension +from a2ui.a2a import create_a2ui_part logger = logging.getLogger(__name__) @@ -127,26 +128,24 @@ async def execute( async for item in self._agent.stream(query, task.context_id, active_ui_version): is_task_complete = item["is_task_complete"] if not is_task_complete: - await updater.update_status( - TaskState.working, - new_agent_text_message(item["updates"], task.context_id, task.id), - ) + message = None + if "parts" in item: + message = new_agent_parts_message(item["parts"], task.context_id, task.id) + elif "updates" in item: + message = new_agent_text_message(item["updates"], task.context_id, task.id) + + if message: + await updater.update_status(TaskState.working, message) continue - final_state = TaskState.input_required # Default + final_state = TaskState.input_required if action in ["send_email", "send_message", "view_full_profile"]: final_state = TaskState.completed final_parts = item["parts"] logger.info("--- FINAL PARTS TO BE SENT ---") - for i, part in enumerate(final_parts): - logger.info(f" - Part {i}: Type = {type(part.root)}") - if isinstance(part.root, TextPart): - logger.info(f" - Text: {part.root.text[:200]}...") - elif isinstance(part.root, DataPart): - logger.info(f" - Data: {str(part.root.data)[:200]}...") - logger.info("-----------------------------") + self._log_parts(final_parts) await updater.update_status( final_state, @@ -159,3 +158,13 @@ async def cancel( self, request: RequestContext, event_queue: EventQueue ) -> Task | None: raise ServerError(error=UnsupportedOperationError()) + + def _log_parts(self, parts: list[Part]): + logger.info("--- PARTS TO BE SENT ---") + for i, part in enumerate(parts): + logger.info(f" - Part {i}: Type = {type(part.root)}") + if isinstance(part.root, TextPart): + logger.info(f" - Text: {part.root.text[:200]}...") + elif isinstance(part.root, DataPart): + logger.info(f" - Data: {str(part.root.data)[:200]}...") + logger.info("-----------------------------") diff --git a/samples/agent/adk/contact_lookup/examples/0.8/contact_card.json b/samples/agent/adk/contact_lookup/examples/0.8/contact_card.json index 384b2626c..c605d6bf4 100644 --- a/samples/agent/adk/contact_lookup/examples/0.8/contact_card.json +++ b/samples/agent/adk/contact_lookup/examples/0.8/contact_card.json @@ -9,6 +9,32 @@ "surfaceUpdate": { "surfaceId": "contact-card", "components": [ + { + "id": "main_card", + "component": { + "Card": { + "child": "main_column" + } + } + }, + { + "id": "main_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "profile_image", + "description_column", + "div", + "info_rows_column", + "action_buttons_row", + "link_text_wrapper" + ] + }, + "alignment": "stretch" + } + } + }, { "id": "profile_image", "component": { @@ -21,6 +47,21 @@ } } }, + { + "id": "description_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "user_heading", + "description_text_1", + "description_text_2" + ] + }, + "alignment": "center" + } + } + }, { "id": "user_heading", "weight": 1, @@ -54,17 +95,40 @@ } }, { - "id": "description_column", + "id": "div", + "component": { + "Divider": {} + } + }, + { + "id": "info_rows_column", + "weight": 1, "component": { "Column": { "children": { "explicitList": [ - "user_heading", - "description_text_1", - "description_text_2" + "info_row_1", + "info_row_2", + "info_row_3", + "info_row_4" ] }, - "alignment": "center" + "alignment": "stretch" + } + } + }, + { + "id": "info_row_1", + "component": { + "Row": { + "children": { + "explicitList": [ + "calendar_icon", + "calendar_text_column" + ] + }, + "distribution": "start", + "alignment": "start" } } }, @@ -73,11 +137,26 @@ "component": { "Icon": { "name": { - "literalString": "calendar_today" + "literalString": "calendarToday" } } } }, + { + "id": "calendar_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "calendar_primary_text", + "calendar_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "calendar_primary_text", "component": { @@ -100,13 +179,13 @@ } }, { - "id": "calendar_text_column", + "id": "info_row_2", "component": { - "Column": { + "Row": { "children": { "explicitList": [ - "calendar_primary_text", - "calendar_secondary_text" + "location_icon", + "location_text_column" ] }, "distribution": "start", @@ -115,13 +194,23 @@ } }, { - "id": "info_row_1", + "id": "location_icon", "component": { - "Row": { + "Icon": { + "name": { + "literalString": "locationOn" + } + } + } + }, + { + "id": "location_text_column", + "component": { + "Column": { "children": { "explicitList": [ - "calendar_icon", - "calendar_text_column" + "location_primary_text", + "location_secondary_text" ] }, "distribution": "start", @@ -129,16 +218,6 @@ } } }, - { - "id": "location_icon", - "component": { - "Icon": { - "name": { - "literalString": "location_on" - } - } - } - }, { "id": "location_primary_text", "component": { @@ -161,28 +240,13 @@ } }, { - "id": "location_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "location_primary_text", - "location_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_2", + "id": "info_row_3", "component": { "Row": { "children": { "explicitList": [ - "location_icon", - "location_text_column" + "mail_icon", + "mail_text_column" ] }, "distribution": "start", @@ -200,6 +264,21 @@ } } }, + { + "id": "mail_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "mail_primary_text", + "mail_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "mail_primary_text", "component": { @@ -222,28 +301,13 @@ } }, { - "id": "mail_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "mail_primary_text", - "mail_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_3", + "id": "info_row_4", "component": { "Row": { "children": { "explicitList": [ - "mail_icon", - "mail_text_column" + "call_icon", + "call_text_column" ] }, "distribution": "start", @@ -251,12 +315,6 @@ } } }, - { - "id": "div", - "component": { - "Divider": {} - } - }, { "id": "call_icon", "component": { @@ -267,6 +325,21 @@ } } }, + { + "id": "call_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "call_primary_text", + "call_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "call_primary_text", "component": { @@ -289,59 +362,17 @@ } }, { - "id": "call_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "call_primary_text", - "call_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_4", + "id": "action_buttons_row", "component": { "Row": { "children": { "explicitList": [ - "call_icon", - "call_text_column" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_rows_column", - "weight": 1, - "component": { - "Column": { - "children": { - "explicitList": [ - "info_row_1", - "info_row_2", - "info_row_3", - "info_row_4" + "button_1", + "button_2" ] }, - "alignment": "stretch" - } - } - }, - { - "id": "button_1_text", - "component": { - "Text": { - "text": { - "literalString": "Follow" - } + "distribution": "center", + "alignment": "center" } } }, @@ -358,11 +389,11 @@ } }, { - "id": "button_2_text", + "id": "button_1_text", "component": { "Text": { "text": { - "literalString": "Message" + "literalString": "Follow" } } } @@ -380,26 +411,11 @@ } }, { - "id": "action_buttons_row", - "component": { - "Row": { - "children": { - "explicitList": [ - "button_1", - "button_2" - ] - }, - "distribution": "center", - "alignment": "center" - } - } - }, - { - "id": "link_text", + "id": "button_2_text", "component": { "Text": { "text": { - "literalString": "[View Full Profile](/profile)" + "literalString": "Message" } } } @@ -419,28 +435,12 @@ } }, { - "id": "main_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "profile_image", - "description_column", - "div", - "info_rows_column", - "action_buttons_row", - "link_text_wrapper" - ] - }, - "alignment": "stretch" - } - } - }, - { - "id": "main_card", + "id": "link_text", "component": { - "Card": { - "child": "main_column" + "Text": { + "text": { + "literalString": "[View Full Profile](/profile)" + } } } } diff --git a/samples/agent/adk/contact_lookup/examples/0.8/follow_success.json b/samples/agent/adk/contact_lookup/examples/0.8/follow_success.json index 212b39203..bfc866e91 100644 --- a/samples/agent/adk/contact_lookup/examples/0.8/follow_success.json +++ b/samples/agent/adk/contact_lookup/examples/0.8/follow_success.json @@ -10,23 +10,10 @@ "surfaceId": "contact-card", "components": [ { - "id": "success_icon", - "component": { - "Icon": { - "name": { - "literalString": "check" - } - } - } - }, - { - "id": "success_text", + "id": "success_card", "component": { - "Text": { - "text": { - "literalString": "Successfully Followed" - }, - "usageHint": "h2" + "Card": { + "child": "success_column" } } }, @@ -45,10 +32,23 @@ } }, { - "id": "success_card", + "id": "success_icon", "component": { - "Card": { - "child": "success_column" + "Icon": { + "name": { + "literalString": "check" + } + } + } + }, + { + "id": "success_text", + "component": { + "Text": { + "text": { + "literalString": "Successfully Followed" + }, + "usageHint": "h2" } } } diff --git a/samples/agent/adk/contact_lookup/examples/0.9/contact_card.json b/samples/agent/adk/contact_lookup/examples/0.9/contact_card.json index aebfa3366..b7b53e11d 100644 --- a/samples/agent/adk/contact_lookup/examples/0.9/contact_card.json +++ b/samples/agent/adk/contact_lookup/examples/0.9/contact_card.json @@ -11,6 +11,24 @@ "updateComponents": { "surfaceId": "contact-card", "components": [ + { + "id": "root", + "component": "Card", + "child": "main_column" + }, + { + "id": "main_column", + "component": "Column", + "children": [ + "profile_image", + "description_column", + "div", + "info_rows_column", + "action_buttons_row", + "link_text_wrapper" + ], + "align": "stretch" + }, { "id": "profile_image", "component": "Image", @@ -20,6 +38,16 @@ "variant": "avatar", "fit": "cover" }, + { + "id": "description_column", + "component": "Column", + "children": [ + "user_heading", + "description_text_1", + "description_text_2" + ], + "align": "center" + }, { "id": "user_heading", "component": "Text", @@ -44,20 +72,46 @@ } }, { - "id": "description_column", + "id": "div", + "component": "Divider" + }, + { + "id": "info_rows_column", "component": "Column", + "weight": 1, "children": [ - "user_heading", - "description_text_1", - "description_text_2" + "info_row_1", + "info_row_2", + "info_row_3", + "info_row_4" ], - "align": "center" + "align": "stretch" + }, + { + "id": "info_row_1", + "component": "Row", + "children": [ + "calendar_icon", + "calendar_text_column" + ], + "justify": "start", + "align": "start" }, { "id": "calendar_icon", "component": "Icon", "name": "calendar_today" }, + { + "id": "calendar_text_column", + "component": "Column", + "children": [ + "calendar_primary_text", + "calendar_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "calendar_primary_text", "component": "Text", @@ -72,21 +126,11 @@ "text": "Calendar" }, { - "id": "calendar_text_column", - "component": "Column", - "children": [ - "calendar_primary_text", - "calendar_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_1", + "id": "info_row_2", "component": "Row", "children": [ - "calendar_icon", - "calendar_text_column" + "location_icon", + "location_text_column" ], "justify": "start", "align": "start" @@ -96,6 +140,16 @@ "component": "Icon", "name": "location_on" }, + { + "id": "location_text_column", + "component": "Column", + "children": [ + "location_primary_text", + "location_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "location_primary_text", "component": "Text", @@ -110,21 +164,11 @@ "text": "Location" }, { - "id": "location_text_column", - "component": "Column", - "children": [ - "location_primary_text", - "location_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_2", + "id": "info_row_3", "component": "Row", "children": [ - "location_icon", - "location_text_column" + "mail_icon", + "mail_text_column" ], "justify": "start", "align": "start" @@ -134,6 +178,16 @@ "component": "Icon", "name": "mail" }, + { + "id": "mail_text_column", + "component": "Column", + "children": [ + "mail_primary_text", + "mail_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "mail_primary_text", "component": "Text", @@ -148,34 +202,30 @@ "text": "Email" }, { - "id": "mail_text_column", - "component": "Column", - "children": [ - "mail_primary_text", - "mail_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_3", + "id": "info_row_4", "component": "Row", "children": [ - "mail_icon", - "mail_text_column" + "call_icon", + "call_text_column" ], "justify": "start", "align": "start" }, - { - "id": "div", - "component": "Divider" - }, { "id": "call_icon", "component": "Icon", "name": "call" }, + { + "id": "call_text_column", + "component": "Column", + "children": [ + "call_primary_text", + "call_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "call_primary_text", "component": "Text", @@ -190,41 +240,14 @@ "text": "Mobile" }, { - "id": "call_text_column", - "component": "Column", - "children": [ - "call_primary_text", - "call_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_4", + "id": "action_buttons_row", "component": "Row", "children": [ - "call_icon", - "call_text_column" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_rows_column", - "component": "Column", - "weight": 1, - "children": [ - "info_row_1", - "info_row_2", - "info_row_3", - "info_row_4" + "button_1", + "button_2" ], - "align": "stretch" - }, - { - "id": "button_1_text", - "component": "Text", - "text": "Follow" + "justify": "center", + "align": "center" }, { "id": "button_1", @@ -238,9 +261,9 @@ } }, { - "id": "button_2_text", + "id": "button_1_text", "component": "Text", - "text": "Message" + "text": "Follow" }, { "id": "button_2", @@ -254,19 +277,9 @@ } }, { - "id": "action_buttons_row", - "component": "Row", - "children": [ - "button_1", - "button_2" - ], - "justify": "center", - "align": "center" - }, - { - "id": "link_text", + "id": "button_2_text", "component": "Text", - "text": "[View Full Profile](/profile)" + "text": "Message" }, { "id": "link_text_wrapper", @@ -278,22 +291,9 @@ "align": "center" }, { - "id": "main_column", - "component": "Column", - "children": [ - "profile_image", - "description_column", - "div", - "info_rows_column", - "action_buttons_row", - "link_text_wrapper" - ], - "align": "stretch" - }, - { - "id": "root", - "component": "Card", - "child": "main_column" + "id": "link_text", + "component": "Text", + "text": "[View Full Profile](/profile)" } ] } diff --git a/samples/agent/adk/contact_lookup/examples/0.9/follow_success.json b/samples/agent/adk/contact_lookup/examples/0.9/follow_success.json index 631404ebe..58a0cc4bc 100644 --- a/samples/agent/adk/contact_lookup/examples/0.9/follow_success.json +++ b/samples/agent/adk/contact_lookup/examples/0.9/follow_success.json @@ -12,15 +12,9 @@ "surfaceId": "contact-card", "components": [ { - "id": "success_icon", - "component": "Icon", - "name": "check" - }, - { - "id": "success_text", - "component": "Text", - "text": "Successfully Followed", - "variant": "h2" + "id": "root", + "component": "Card", + "child": "success_column" }, { "id": "success_column", @@ -32,9 +26,15 @@ "align": "center" }, { - "id": "root", - "component": "Card", - "child": "success_column" + "id": "success_icon", + "component": "Icon", + "name": "check" + }, + { + "id": "success_text", + "component": "Text", + "text": "Successfully Followed", + "variant": "h2" } ] } diff --git a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/action_confirmation.json b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/action_confirmation.json index 74a665a04..e5fac8417 100644 --- a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/action_confirmation.json +++ b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/action_confirmation.json @@ -68,16 +68,6 @@ } } }, - { - "id": "dismiss-button-text", - "component": { - "Text": { - "text": { - "literalString": "Dismiss" - } - } - } - }, { "id": "dismiss-button", "component": { @@ -89,6 +79,16 @@ } } } + }, + { + "id": "dismiss-button-text", + "component": { + "Text": { + "text": { + "literalString": "Dismiss" + } + } + } } ] } diff --git a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_card.json b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_card.json index 979515425..164f49f55 100644 --- a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_card.json +++ b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_card.json @@ -9,6 +9,32 @@ "surfaceUpdate": { "surfaceId": "contact-card", "components": [ + { + "id": "main_card", + "component": { + "Card": { + "child": "main_column" + } + } + }, + { + "id": "main_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "profile_image", + "description_column", + "div", + "info_rows_column", + "action_buttons_row", + "link_text_wrapper" + ] + }, + "alignment": "stretch" + } + } + }, { "id": "profile_image", "component": { @@ -21,6 +47,21 @@ } } }, + { + "id": "description_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "user_heading", + "description_text_1", + "description_text_2" + ] + }, + "alignment": "center" + } + } + }, { "id": "user_heading", "weight": 1, @@ -54,17 +95,40 @@ } }, { - "id": "description_column", + "id": "div", + "component": { + "Divider": {} + } + }, + { + "id": "info_rows_column", + "weight": 1, "component": { "Column": { "children": { "explicitList": [ - "user_heading", - "description_text_1", - "description_text_2" + "info_row_1", + "info_row_2", + "info_row_3", + "info_row_4" ] }, - "alignment": "center" + "alignment": "stretch" + } + } + }, + { + "id": "info_row_1", + "component": { + "Row": { + "children": { + "explicitList": [ + "calendar_icon", + "calendar_text_column" + ] + }, + "distribution": "start", + "alignment": "start" } } }, @@ -78,6 +142,21 @@ } } }, + { + "id": "calendar_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "calendar_primary_text", + "calendar_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "calendar_primary_text", "component": { @@ -100,28 +179,13 @@ } }, { - "id": "calendar_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "calendar_primary_text", - "calendar_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_1", + "id": "info_row_2", "component": { "Row": { "children": { "explicitList": [ - "calendar_icon", - "calendar_text_column" + "location_icon", + "location_text_column" ] }, "distribution": "start", @@ -139,6 +203,21 @@ } } }, + { + "id": "location_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "location_primary_text", + "location_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "location_primary_text", "component": { @@ -161,28 +240,13 @@ } }, { - "id": "location_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "location_primary_text", - "location_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_2", + "id": "info_row_3", "component": { "Row": { "children": { "explicitList": [ - "location_icon", - "location_text_column" + "mail_icon", + "mail_text_column" ] }, "distribution": "start", @@ -200,6 +264,21 @@ } } }, + { + "id": "mail_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "mail_primary_text", + "mail_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "mail_primary_text", "component": { @@ -222,28 +301,13 @@ } }, { - "id": "mail_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "mail_primary_text", - "mail_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_3", + "id": "info_row_4", "component": { "Row": { "children": { "explicitList": [ - "mail_icon", - "mail_text_column" + "call_icon", + "call_text_column" ] }, "distribution": "start", @@ -251,12 +315,6 @@ } } }, - { - "id": "div", - "component": { - "Divider": {} - } - }, { "id": "call_icon", "component": { @@ -267,6 +325,21 @@ } } }, + { + "id": "call_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "call_primary_text", + "call_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "call_primary_text", "component": { @@ -289,118 +362,71 @@ } }, { - "id": "call_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "call_primary_text", - "call_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_4", + "id": "action_buttons_row", "component": { "Row": { "children": { "explicitList": [ - "call_icon", - "call_text_column" + "button_1", + "button_2" ] }, - "distribution": "start", - "alignment": "start" + "distribution": "center", + "alignment": "center" } } }, { - "id": "info_rows_column", - "weight": 1, + "id": "button_1", "component": { - "Column": { - "children": { - "explicitList": [ - "info_row_1", - "info_row_2", - "info_row_3", - "info_row_4" - ] - }, - "alignment": "stretch" + "Button": { + "child": "button_1_text", + "primary": true, + "action": { + "name": "follow_contact" + } } } }, { - "id": "message-button-text", + "id": "button_1_text", "component": { "Text": { "text": { - "literalString": "Message" + "literalString": "Follow" } } } }, { - "id": "message-button", + "id": "button_2", "component": { "Button": { - "child": "message-button-text", + "child": "button_2_text", + "primary": false, "action": { - "name": "send_message", - "context": [ - { - "key": "contactName", - "value": { - "path": "/name" - } - } - ] + "name": "send_message" } } } }, { - "id": "location-button-text", + "id": "button_2_text", "component": { "Text": { "text": { - "literalString": "Location" - } - } - } - }, - { - "id": "location-button", - "component": { - "Button": { - "child": "location-button-text", - "action": { - "name": "view_location", - "context": [ - { - "key": "contactId", - "value": { - "path": "/id" - } - } - ] + "literalString": "Message" } } } }, { - "id": "action_buttons_row", + "id": "link_text_wrapper", "component": { "Row": { "children": { "explicitList": [ - "message-button", - "location-button" + "link_text" ] }, "distribution": "center", @@ -409,27 +435,12 @@ } }, { - "id": "main_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "profile_image", - "description_column", - "div", - "info_rows_column", - "action_buttons_row" - ] - }, - "alignment": "stretch" - } - } - }, - { - "id": "main_card", + "id": "link_text", "component": { - "Card": { - "child": "main_column" + "Text": { + "text": { + "literalString": "[View Full Profile](/profile)" + } } } } diff --git a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_list.json b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_list.json index 2cf52bede..e82450d10 100644 --- a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_list.json +++ b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/contact_list.json @@ -119,16 +119,6 @@ } } }, - { - "id": "view-button-text", - "component": { - "Text": { - "text": { - "literalString": "View" - } - } - } - }, { "id": "view-button", "component": { @@ -154,6 +144,16 @@ } } } + }, + { + "id": "view-button-text", + "component": { + "Text": { + "text": { + "literalString": "View" + } + } + } } ] } diff --git a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/multi_surface.json b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/multi_surface.json index 638d58334..49685d324 100644 --- a/samples/agent/adk/contact_multiple_surfaces/examples/0.8/multi_surface.json +++ b/samples/agent/adk/contact_multiple_surfaces/examples/0.8/multi_surface.json @@ -15,6 +15,31 @@ "surfaceUpdate": { "surfaceId": "contact-card", "components": [ + { + "id": "main_card", + "component": { + "Card": { + "child": "main_column" + } + } + }, + { + "id": "main_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "profile_image", + "description_column", + "div", + "info_rows_column", + "action_buttons_row" + ] + }, + "alignment": "stretch" + } + } + }, { "id": "profile_image", "component": { @@ -27,6 +52,21 @@ } } }, + { + "id": "description_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "user_heading", + "description_text_1", + "description_text_2" + ] + }, + "alignment": "center" + } + } + }, { "id": "user_heading", "weight": 1, @@ -60,17 +100,40 @@ } }, { - "id": "description_column", + "id": "div", + "component": { + "Divider": {} + } + }, + { + "id": "info_rows_column", + "weight": 1, "component": { "Column": { "children": { "explicitList": [ - "user_heading", - "description_text_1", - "description_text_2" + "info_row_1", + "info_row_2", + "info_row_3", + "info_row_4" ] }, - "alignment": "center" + "alignment": "stretch" + } + } + }, + { + "id": "info_row_1", + "component": { + "Row": { + "children": { + "explicitList": [ + "calendar_icon", + "calendar_text_column" + ] + }, + "distribution": "start", + "alignment": "start" } } }, @@ -84,6 +147,21 @@ } } }, + { + "id": "calendar_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "calendar_primary_text", + "calendar_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "calendar_primary_text", "component": { @@ -106,28 +184,13 @@ } }, { - "id": "calendar_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "calendar_primary_text", - "calendar_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_1", + "id": "info_row_2", "component": { "Row": { "children": { "explicitList": [ - "calendar_icon", - "calendar_text_column" + "location_icon", + "location_text_column" ] }, "distribution": "start", @@ -145,6 +208,21 @@ } } }, + { + "id": "location_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "location_primary_text", + "location_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "location_primary_text", "component": { @@ -167,28 +245,13 @@ } }, { - "id": "location_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "location_primary_text", - "location_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_2", + "id": "info_row_3", "component": { "Row": { "children": { "explicitList": [ - "location_icon", - "location_text_column" + "mail_icon", + "mail_text_column" ] }, "distribution": "start", @@ -206,6 +269,21 @@ } } }, + { + "id": "mail_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "mail_primary_text", + "mail_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "mail_primary_text", "component": { @@ -228,28 +306,13 @@ } }, { - "id": "mail_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "mail_primary_text", - "mail_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_3", + "id": "info_row_4", "component": { "Row": { "children": { "explicitList": [ - "mail_icon", - "mail_text_column" + "call_icon", + "call_text_column" ] }, "distribution": "start", @@ -257,12 +320,6 @@ } } }, - { - "id": "div", - "component": { - "Divider": {} - } - }, { "id": "call_icon", "component": { @@ -273,6 +330,21 @@ } } }, + { + "id": "call_text_column", + "component": { + "Column": { + "children": { + "explicitList": [ + "call_primary_text", + "call_secondary_text" + ] + }, + "distribution": "start", + "alignment": "start" + } + } + }, { "id": "call_primary_text", "component": { @@ -295,59 +367,17 @@ } }, { - "id": "call_text_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "call_primary_text", - "call_secondary_text" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_row_4", + "id": "action_buttons_row", "component": { "Row": { "children": { "explicitList": [ - "call_icon", - "call_text_column" - ] - }, - "distribution": "start", - "alignment": "start" - } - } - }, - { - "id": "info_rows_column", - "weight": 1, - "component": { - "Column": { - "children": { - "explicitList": [ - "info_row_1", - "info_row_2", - "info_row_3", - "info_row_4" + "message-button", + "location-button" ] }, - "alignment": "stretch" - } - } - }, - { - "id": "message-button-text", - "component": { - "Text": { - "text": { - "literalString": "Message" - } + "distribution": "center", + "alignment": "center" } } }, @@ -371,11 +401,11 @@ } }, { - "id": "location-button-text", + "id": "message-button-text", "component": { "Text": { "text": { - "literalString": "Location" + "literalString": "Message" } } } @@ -400,42 +430,12 @@ } }, { - "id": "action_buttons_row", - "component": { - "Row": { - "children": { - "explicitList": [ - "message-button", - "location-button" - ] - }, - "distribution": "center", - "alignment": "center" - } - } - }, - { - "id": "main_column", - "component": { - "Column": { - "children": { - "explicitList": [ - "profile_image", - "description_column", - "div", - "info_rows_column", - "action_buttons_row" - ] - }, - "alignment": "stretch" - } - } - }, - { - "id": "main_card", + "id": "location-button-text", "component": { - "Card": { - "child": "main_column" + "Text": { + "text": { + "literalString": "Location" + } } } } diff --git a/samples/agent/adk/contact_multiple_surfaces/examples/0.9/chart_node_click.json b/samples/agent/adk/contact_multiple_surfaces/examples/0.9/chart_node_click.json index e3784e20f..b7c9dd3c5 100644 --- a/samples/agent/adk/contact_multiple_surfaces/examples/0.9/chart_node_click.json +++ b/samples/agent/adk/contact_multiple_surfaces/examples/0.9/chart_node_click.json @@ -4,6 +4,23 @@ "updateComponents": { "surfaceId": "contact-card", "components": [ + { + "id": "root", + "component": "Card", + "child": "main_column" + }, + { + "id": "main_column", + "component": "Column", + "children": [ + "profile_image", + "description_column", + "div", + "info_rows_column", + "action_buttons_row" + ], + "align": "stretch" + }, { "id": "profile_image", "component": "Image", @@ -13,6 +30,16 @@ "variant": "avatar", "fit": "cover" }, + { + "id": "description_column", + "component": "Column", + "children": [ + "user_heading", + "description_text_1", + "description_text_2" + ], + "align": "center" + }, { "id": "user_heading", "component": "Text", @@ -37,20 +64,46 @@ } }, { - "id": "description_column", + "id": "div", + "component": "Divider" + }, + { + "id": "info_rows_column", "component": "Column", + "weight": 1, "children": [ - "user_heading", - "description_text_1", - "description_text_2" + "info_row_1", + "info_row_2", + "info_row_3", + "info_row_4" ], - "align": "center" + "align": "stretch" + }, + { + "id": "info_row_1", + "component": "Row", + "children": [ + "calendar_icon", + "calendar_text_column" + ], + "justify": "start", + "align": "start" }, { "id": "calendar_icon", "component": "Icon", "name": "calendarToday" }, + { + "id": "calendar_text_column", + "component": "Column", + "children": [ + "calendar_primary_text", + "calendar_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "calendar_primary_text", "component": "Text", @@ -65,21 +118,11 @@ "text": "Calendar" }, { - "id": "calendar_text_column", - "component": "Column", - "children": [ - "calendar_primary_text", - "calendar_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_1", + "id": "info_row_2", "component": "Row", "children": [ - "calendar_icon", - "calendar_text_column" + "location_icon", + "location_text_column" ], "justify": "start", "align": "start" @@ -89,6 +132,16 @@ "component": "Icon", "name": "locationOn" }, + { + "id": "location_text_column", + "component": "Column", + "children": [ + "location_primary_text", + "location_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "location_primary_text", "component": "Text", @@ -103,21 +156,11 @@ "text": "Location" }, { - "id": "location_text_column", - "component": "Column", - "children": [ - "location_primary_text", - "location_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_2", + "id": "info_row_3", "component": "Row", "children": [ - "location_icon", - "location_text_column" + "mail_icon", + "mail_text_column" ], "justify": "start", "align": "start" @@ -127,6 +170,16 @@ "component": "Icon", "name": "mail" }, + { + "id": "mail_text_column", + "component": "Column", + "children": [ + "mail_primary_text", + "mail_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "mail_primary_text", "component": "Text", @@ -141,34 +194,30 @@ "text": "Email" }, { - "id": "mail_text_column", - "component": "Column", - "children": [ - "mail_primary_text", - "mail_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_3", + "id": "info_row_4", "component": "Row", "children": [ - "mail_icon", - "mail_text_column" + "call_icon", + "call_text_column" ], "justify": "start", "align": "start" }, - { - "id": "div", - "component": "Divider" - }, { "id": "call_icon", "component": "Icon", "name": "call" }, + { + "id": "call_text_column", + "component": "Column", + "children": [ + "call_primary_text", + "call_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "call_primary_text", "component": "Text", @@ -183,41 +232,14 @@ "text": "Mobile" }, { - "id": "call_text_column", - "component": "Column", - "children": [ - "call_primary_text", - "call_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_4", + "id": "action_buttons_row", "component": "Row", "children": [ - "call_icon", - "call_text_column" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_rows_column", - "component": "Column", - "weight": 1, - "children": [ - "info_row_1", - "info_row_2", - "info_row_3", - "info_row_4" + "message-button", + "location-button" ], - "align": "stretch" - }, - { - "id": "message-button-text", - "component": "Text", - "text": "Message" + "justify": "center", + "align": "center" }, { "id": "message-button", @@ -235,9 +257,9 @@ } }, { - "id": "location-button-text", + "id": "message-button-text", "component": "Text", - "text": "Location" + "text": "Message" }, { "id": "location-button", @@ -255,31 +277,9 @@ } }, { - "id": "action_buttons_row", - "component": "Row", - "children": [ - "message-button", - "location-button" - ], - "justify": "center", - "align": "center" - }, - { - "id": "main_column", - "component": "Column", - "children": [ - "profile_image", - "description_column", - "div", - "info_rows_column", - "action_buttons_row" - ], - "align": "stretch" - }, - { - "id": "root", - "component": "Card", - "child": "main_column" + "id": "location-button-text", + "component": "Text", + "text": "Location" } ] } diff --git a/samples/agent/adk/contact_multiple_surfaces/examples/0.9/contact_card.json b/samples/agent/adk/contact_multiple_surfaces/examples/0.9/contact_card.json index 07f4c2626..6d3d3aaf4 100644 --- a/samples/agent/adk/contact_multiple_surfaces/examples/0.9/contact_card.json +++ b/samples/agent/adk/contact_multiple_surfaces/examples/0.9/contact_card.json @@ -11,6 +11,23 @@ "updateComponents": { "surfaceId": "contact-card", "components": [ + { + "id": "root", + "component": "Card", + "child": "main_column" + }, + { + "id": "main_column", + "component": "Column", + "children": [ + "profile_image", + "description_column", + "div", + "info_rows_column", + "action_buttons_row" + ], + "align": "stretch" + }, { "id": "profile_image", "component": "Image", @@ -20,6 +37,16 @@ "variant": "avatar", "fit": "cover" }, + { + "id": "description_column", + "component": "Column", + "children": [ + "user_heading", + "description_text_1", + "description_text_2" + ], + "align": "center" + }, { "id": "user_heading", "component": "Text", @@ -44,20 +71,46 @@ } }, { - "id": "description_column", + "id": "div", + "component": "Divider" + }, + { + "id": "info_rows_column", "component": "Column", + "weight": 1, "children": [ - "user_heading", - "description_text_1", - "description_text_2" + "info_row_1", + "info_row_2", + "info_row_3", + "info_row_4" ], - "align": "center" + "align": "stretch" + }, + { + "id": "info_row_1", + "component": "Row", + "children": [ + "calendar_icon", + "calendar_text_column" + ], + "justify": "start", + "align": "start" }, { "id": "calendar_icon", "component": "Icon", "name": "calendarToday" }, + { + "id": "calendar_text_column", + "component": "Column", + "children": [ + "calendar_primary_text", + "calendar_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "calendar_primary_text", "component": "Text", @@ -72,21 +125,11 @@ "text": "Calendar" }, { - "id": "calendar_text_column", - "component": "Column", - "children": [ - "calendar_primary_text", - "calendar_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_1", + "id": "info_row_2", "component": "Row", "children": [ - "calendar_icon", - "calendar_text_column" + "location_icon", + "location_text_column" ], "justify": "start", "align": "start" @@ -96,6 +139,16 @@ "component": "Icon", "name": "locationOn" }, + { + "id": "location_text_column", + "component": "Column", + "children": [ + "location_primary_text", + "location_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "location_primary_text", "component": "Text", @@ -110,21 +163,11 @@ "text": "Location" }, { - "id": "location_text_column", - "component": "Column", - "children": [ - "location_primary_text", - "location_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_2", + "id": "info_row_3", "component": "Row", "children": [ - "location_icon", - "location_text_column" + "mail_icon", + "mail_text_column" ], "justify": "start", "align": "start" @@ -134,6 +177,16 @@ "component": "Icon", "name": "mail" }, + { + "id": "mail_text_column", + "component": "Column", + "children": [ + "mail_primary_text", + "mail_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "mail_primary_text", "component": "Text", @@ -148,34 +201,30 @@ "text": "Email" }, { - "id": "mail_text_column", - "component": "Column", - "children": [ - "mail_primary_text", - "mail_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_3", + "id": "info_row_4", "component": "Row", "children": [ - "mail_icon", - "mail_text_column" + "call_icon", + "call_text_column" ], "justify": "start", "align": "start" }, - { - "id": "div", - "component": "Divider" - }, { "id": "call_icon", "component": "Icon", "name": "call" }, + { + "id": "call_text_column", + "component": "Column", + "children": [ + "call_primary_text", + "call_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "call_primary_text", "component": "Text", @@ -190,41 +239,14 @@ "text": "Mobile" }, { - "id": "call_text_column", - "component": "Column", - "children": [ - "call_primary_text", - "call_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_4", + "id": "action_buttons_row", "component": "Row", "children": [ - "call_icon", - "call_text_column" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_rows_column", - "component": "Column", - "weight": 1, - "children": [ - "info_row_1", - "info_row_2", - "info_row_3", - "info_row_4" + "message-button", + "location-button" ], - "align": "stretch" - }, - { - "id": "message-button-text", - "component": "Text", - "text": "Message" + "justify": "center", + "align": "center" }, { "id": "message-button", @@ -242,9 +264,9 @@ } }, { - "id": "location-button-text", + "id": "message-button-text", "component": "Text", - "text": "Location" + "text": "Message" }, { "id": "location-button", @@ -262,31 +284,9 @@ } }, { - "id": "action_buttons_row", - "component": "Row", - "children": [ - "message-button", - "location-button" - ], - "justify": "center", - "align": "center" - }, - { - "id": "main_column", - "component": "Column", - "children": [ - "profile_image", - "description_column", - "div", - "info_rows_column", - "action_buttons_row" - ], - "align": "stretch" - }, - { - "id": "root", - "component": "Card", - "child": "main_column" + "id": "location-button-text", + "component": "Text", + "text": "Location" } ] } diff --git a/samples/agent/adk/contact_multiple_surfaces/examples/0.9/multi_surface.json b/samples/agent/adk/contact_multiple_surfaces/examples/0.9/multi_surface.json index ccaa04f80..f35fed05e 100644 --- a/samples/agent/adk/contact_multiple_surfaces/examples/0.9/multi_surface.json +++ b/samples/agent/adk/contact_multiple_surfaces/examples/0.9/multi_surface.json @@ -18,6 +18,23 @@ "updateComponents": { "surfaceId": "contact-card", "components": [ + { + "id": "root", + "component": "Card", + "child": "main_column" + }, + { + "id": "main_column", + "component": "Column", + "children": [ + "profile_image", + "description_column", + "div", + "info_rows_column", + "action_buttons_row" + ], + "align": "stretch" + }, { "id": "profile_image", "component": "Image", @@ -27,6 +44,16 @@ "variant": "avatar", "fit": "cover" }, + { + "id": "description_column", + "component": "Column", + "children": [ + "user_heading", + "description_text_1", + "description_text_2" + ], + "align": "center" + }, { "id": "user_heading", "component": "Text", @@ -51,20 +78,46 @@ } }, { - "id": "description_column", + "id": "div", + "component": "Divider" + }, + { + "id": "info_rows_column", "component": "Column", + "weight": 1, "children": [ - "user_heading", - "description_text_1", - "description_text_2" + "info_row_1", + "info_row_2", + "info_row_3", + "info_row_4" ], - "align": "center" + "align": "stretch" + }, + { + "id": "info_row_1", + "component": "Row", + "children": [ + "calendar_icon", + "calendar_text_column" + ], + "justify": "start", + "align": "start" }, { "id": "calendar_icon", "component": "Icon", "name": "calendarToday" }, + { + "id": "calendar_text_column", + "component": "Column", + "children": [ + "calendar_primary_text", + "calendar_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "calendar_primary_text", "component": "Text", @@ -79,21 +132,11 @@ "text": "Calendar" }, { - "id": "calendar_text_column", - "component": "Column", - "children": [ - "calendar_primary_text", - "calendar_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_1", + "id": "info_row_2", "component": "Row", "children": [ - "calendar_icon", - "calendar_text_column" + "location_icon", + "location_text_column" ], "justify": "start", "align": "start" @@ -103,6 +146,16 @@ "component": "Icon", "name": "locationOn" }, + { + "id": "location_text_column", + "component": "Column", + "children": [ + "location_primary_text", + "location_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "location_primary_text", "component": "Text", @@ -117,21 +170,11 @@ "text": "Location" }, { - "id": "location_text_column", - "component": "Column", - "children": [ - "location_primary_text", - "location_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_2", + "id": "info_row_3", "component": "Row", "children": [ - "location_icon", - "location_text_column" + "mail_icon", + "mail_text_column" ], "justify": "start", "align": "start" @@ -141,6 +184,16 @@ "component": "Icon", "name": "mail" }, + { + "id": "mail_text_column", + "component": "Column", + "children": [ + "mail_primary_text", + "mail_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "mail_primary_text", "component": "Text", @@ -155,34 +208,30 @@ "text": "Email" }, { - "id": "mail_text_column", - "component": "Column", - "children": [ - "mail_primary_text", - "mail_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_3", + "id": "info_row_4", "component": "Row", "children": [ - "mail_icon", - "mail_text_column" + "call_icon", + "call_text_column" ], "justify": "start", "align": "start" }, - { - "id": "div", - "component": "Divider" - }, { "id": "call_icon", "component": "Icon", "name": "call" }, + { + "id": "call_text_column", + "component": "Column", + "children": [ + "call_primary_text", + "call_secondary_text" + ], + "justify": "start", + "align": "start" + }, { "id": "call_primary_text", "component": "Text", @@ -197,41 +246,14 @@ "text": "Mobile" }, { - "id": "call_text_column", - "component": "Column", - "children": [ - "call_primary_text", - "call_secondary_text" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_row_4", + "id": "action_buttons_row", "component": "Row", "children": [ - "call_icon", - "call_text_column" - ], - "justify": "start", - "align": "start" - }, - { - "id": "info_rows_column", - "component": "Column", - "weight": 1, - "children": [ - "info_row_1", - "info_row_2", - "info_row_3", - "info_row_4" + "message-button", + "location-button" ], - "align": "stretch" - }, - { - "id": "message-button-text", - "component": "Text", - "text": "Message" + "justify": "center", + "align": "center" }, { "id": "message-button", @@ -249,9 +271,9 @@ } }, { - "id": "location-button-text", + "id": "message-button-text", "component": "Text", - "text": "Location" + "text": "Message" }, { "id": "location-button", @@ -269,31 +291,9 @@ } }, { - "id": "action_buttons_row", - "component": "Row", - "children": [ - "message-button", - "location-button" - ], - "justify": "center", - "align": "center" - }, - { - "id": "main_column", - "component": "Column", - "children": [ - "profile_image", - "description_column", - "div", - "info_rows_column", - "action_buttons_row" - ], - "align": "stretch" - }, - { - "id": "root", - "component": "Card", - "child": "main_column" + "id": "location-button-text", + "component": "Text", + "text": "Location" } ] }