Modify A Widget
When changing an existing widget, preserve the existing runtime shape unless the request requires a larger change.
Steps
- Read the target
index.tsx. - Identify imports, top-level
@panelconstants,widget, optionalwidgetTimeline, optional intent functions, andAwait.define. - Check the reference before adding components, props, modifiers, or bridge APIs.
- Make the smallest code change that satisfies the request.
- Run
npm testin the widget project.
Keep Stable
- Do not replace
Await.definewith a different registration style. - Do not introduce HTML, CSS, browser APIs, React hooks, or React state.
- Do not move
@panelcomments away from the top-level declaration they control. - Do not add compatibility layers unless explicitly requested.
Common Changes
- Visual tuning: adjust props and modifiers on existing nodes.
- Editable settings: add top-level
constdeclarations with@panel. - Refreshing data: add or update
widgetTimeline. - Tap actions: add an intent function, register it under
widgetIntents, and use the returned intent factory fromAwait.define.