Skills Plugins MCP Prompt Model 博客 我的中心

compose-focus-navigation

Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.

DeepseekModel 官方收录技能 质量 优秀 · 90 v1.0.0

获取

https://deepseekmodel.com/api/download.php?id=chrisbanes-skills-skills-compose-focus-navigation-skill-md&format=skill
下载 .skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用
.skill 文件中 system_prompt 字段的实际内容。
name compose-focus-navigation description Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior. Compose: focus navigation Core principle Focus is stateful UI behavior: make targets and exceptional edges explicit, then drive and verify it through the user's keyboard, D-pad, or remote input. Procedure Start with components that already participate in focus. Add a hook only for a requested behavior: Need Add Normal button/text field/clickable focus Nothing extra; use the focusable component Programmatic initial/restored focus FocusRequester + Modifier.focusRequester(...) Visual or state reaction to focus changes Modifier.onFocusChanged { ... } Custom interactive surface that is not already focusable Modifier.focusable() plus role/semantics as appropriate Request initial or restored focus from LaunchedEffect , keyed to the condition that makes the target present. For lazy content, keep requesters by stable item id and request only after the item is composed. Inside AnimatedContent , use the content lambda's target consistently for rendered identity, tags, requester ownership, and the effect key; captured outer state gives outgoing and incoming content the same identity. Keep default spatial search unless a concrete edge, jump, or trap is wrong. Encode only those exceptions with focusProperties . Handle keys only for behavior that is not normal click or traversal. Consume exactly the handled event; throttle rapid D-pad work at its expensive owner, not across the screen. Restore by semantic identity after refresh: retain the focused id when it exists, otherwise choose a deterministic fallback. Test with one concrete key/D-pad interaction and focused semantics. When the behavior under review is user-triggered, do not substitute direct state mutation or leave the input conditional. Use screenshots only for the focus appearance. Finish when all intentional targets and exceptional edges are encoded, loading/refresh behavior has a stable focus policy, and tests use the same input model as users. For example, request and observe focus only when both behaviors are required: val requester = remember { FocusRequester() } Button( onClick = onClick, modifier = Modifier .focusRequester(requester) .onFocusChanged { state -> isFocused = state.isFocused }, ) { Text( "Play" ) } Call focus requests from an effect, not the composable body: val initialFocus = remember { FocusRequester() } LaunchedEffect(initialFocus) { initialFocus.requestFocus() } If the target appears after loading, key the request to the condition: LaunchedEffect(items.isNotEmpty()) { if (items.isNotEmpty()) { firstItemRequester.requestFocus() } } Use focusProperties only when default spatial search is wrong: Modifier.focusProperties { up = headerRequester down = firstRowRequester left = FocusRequester.Cancel } Too many hard-coded links create stale focus graphs. For special key behavior, consume only the handled event: Modifier.onPreviewKeyEvent { event -> if (event.type == KeyEventType.KeyUp && event.key == Key.Back) { onBack() true } else { false } } Test focus through user input: composeTestRule.onNodeWithTag( "screen" ).performKeyInput { pressKey(Key.DirectionDown) } composeTestRule.onNodeWithTag( "play-button" ).assertIsFocused() Broader test-shape choices are in Compose UI testing patterns .
Agent 识别该技能的关键词,点击任意一个即可复制。

该技能未提供触发词。

下载的 .skill 包内含以下字段。
字段 说明
format格式标识(skill/v1)
skill_id技能唯一 ID
name技能名称
version版本号
description技能描述
category所属分类(数组)
trigger_words触发词列表
tags标签列表
source来源标识
source_url来源链接(本页地址)
exported_at导出时间(每次下载生成)
system_prompt系统提示词正文
model_config模型参数:provider / model / temperature / max_tokens / top_p
examples示例
install_guide各平台导入说明(Coze / Dify / Claude / 自定义框架)
同一份技能可按不同平台格式导出。
.skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用 下载
.skillpro 增强格式,额外含脚本 / 工具 / 依赖 / 钩子占位 下载
.json 纯 JSON 导出,只含 system_prompt 与模型参数 下载
Coze 带 frontmatter 的 Markdown,Coze 平台导入用 下载
Dify Dify DSL,创建应用后直接导入 下载

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

验证码 --

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。