@@ -27,13 +27,14 @@ type ConfigFormProps = {
2727 activeSubsection ?: string | null ;
2828 showAdvanced ?: boolean ;
2929 forceAdvancedSection ?: string | null ;
30- /** Required: the collapsed- advanced ghost row 's only action. Optional would
31- * permit an inert "Show advanced" control that strands hidden settings. */
30+ /** Required: the collapsed advanced disclosure 's only action. Optional would
31+ * permit an inert control that strands hidden settings. */
3232 onShowAdvanced : ( ) => void ;
3333 /** Paired expanded-state action. Omit when search or a forced route owns the reveal. */
3434 onHideAdvanced ?: ( ) => void ;
3535 /** Inline actions rendered next to the active section heading (e.g. env peek). */
3636 sectionActions ?: TemplateResult ;
37+ showSectionDocs ?: boolean ;
3738 /** A Control UI-owned row rendered before common schema rows in the active section. */
3839 sectionPrelude ?: TemplateResult ;
3940 /** Composite pages render custom rows above the form; an empty schema
@@ -46,32 +47,15 @@ type ConfigFormProps = {
4647 onRemove ?: ( path : Array < string | number > ) => void ;
4748} ;
4849
49- function renderAdvancedDivider ( onHideAdvanced : ( ( ) => void ) | undefined ) {
50- return html `< div class ="config-advanced-divider ">
51- < span > ${ t ( "configForm.advancedDivider" ) } </ span >
52- ${ onHideAdvanced
53- ? html `< button
54- type ="button "
55- class ="config-advanced-divider__toggle config-show-advanced active "
56- aria-pressed ="true "
57- @click =${ ( ) => onHideAdvanced ( ) }
58- >
59- ${ t ( "common.hideAdvanced" ) }
60- </ button > `
61- : nothing }
62- </ div > ` ;
63- }
64-
6550/** Common/advanced split body shared by the config page and channel forms so
66- * every schema surface hides advanced settings behind the same ghost row . */
51+ * every schema surface uses the same native disclosure . */
6752export function renderConfigTierGroups ( params : {
6853 schema : JsonSchema ;
6954 path : Array < string | number > ;
7055 hints : ConfigUiHints ;
7156 revealAdvanced : boolean ;
7257 onShowAdvanced : ( ) => void ;
73- /** Surfaces with collapsible advanced fields pass this so the expanded
74- * divider remains the single inverse of the collapsed ghost action. */
58+ /** Surfaces with collapsible advanced fields pass this as the inverse action. */
7559 onHideAdvanced ?: ( ) => void ;
7660 renderTier : ( node : JsonSchema ) => TemplateResult | typeof nothing ;
7761 commonPrelude ?: TemplateResult ;
@@ -81,9 +65,6 @@ export function renderConfigTierGroups(params: {
8165 path : params . path . map ( String ) ,
8266 hints : params . hints ,
8367 } ) ;
84- // An advanced-only schema needs no separator, but a surface whose only
85- // collapse control lives on the divider would otherwise strand the tier open.
86- const showDivider = Boolean ( split . common ) || Boolean ( params . onHideAdvanced ) ;
8768 // The wrapper owns tier spacing so embedders without a settings-section
8869 // parent (the channel forms) do not render the tiers flush against each other.
8970 return html `
@@ -96,29 +77,33 @@ export function renderConfigTierGroups(params: {
9677 </ div > `
9778 : nothing }
9879 ${ split . advanced && split . advancedLeafCount > 0
99- ? params . revealAdvanced
100- ? html `
101- ${ showDivider ? renderAdvancedDivider ( params . onHideAdvanced ) : nothing }
102- < div class ="settings-group "> ${ params . renderTier ( split . advanced ) } </ div >
103- `
104- : html `
105- < button
106- type ="button "
107- class ="config-advanced-ghost config-show-advanced "
108- aria-pressed ="false "
109- @click =${ ( ) => params . onShowAdvanced ( ) }
110- >
111- < span class ="config-advanced-ghost__count ">
112- ${ t (
113- split . advancedLeafCount === 1
114- ? "configForm.advancedHidden"
115- : "configForm.advancedHiddenPlural" ,
116- { count : String ( split . advancedLeafCount ) } ,
117- ) }
118- </ span >
119- < span class ="config-advanced-ghost__action "> ${ t ( "configForm.showAdvanced" ) } </ span >
120- </ button >
121- `
80+ ? html `< details
81+ class ="config-advanced-disclosure "
82+ ?open =${ params . revealAdvanced }
83+ @toggle =${ ( event : Event ) => {
84+ const disclosure = event . currentTarget ;
85+ if ( ! ( disclosure instanceof HTMLDetailsElement ) ) {
86+ return ;
87+ }
88+ if ( disclosure . open === params . revealAdvanced ) {
89+ return ;
90+ }
91+ if ( disclosure . open ) {
92+ params . onShowAdvanced ( ) ;
93+ } else if ( params . onHideAdvanced ) {
94+ params . onHideAdvanced ( ) ;
95+ } else {
96+ disclosure . open = true ;
97+ }
98+ } }
99+ >
100+ < summary class ="settings-section__heading config-advanced-disclosure__summary ">
101+ ${ t ( "configForm.advancedSettings" ) }
102+ </ summary >
103+ ${ params . revealAdvanced
104+ ? html `< div class ="settings-group "> ${ params . renderTier ( split . advanced ) } </ div > `
105+ : nothing }
106+ </ details > `
122107 : nothing }
123108 </ div >
124109 ` ;
@@ -227,7 +212,7 @@ export function renderConfigForm(props: ConfigFormProps) {
227212 path : Array < string | number > ;
228213 } ) => {
229214 const sectionHint = hintForPath ( params . path . slice ( 0 , 1 ) , props . uiHints ) ;
230- const docsUrl = sectionHint ?. docsUrl ;
215+ const docsUrl = props . showSectionDocs === false ? undefined : sectionHint ?. docsUrl ;
231216 const docsTriggerId = `settings-section-help-${ params . id } ` ;
232217 const revealAdvanced =
233218 props . showAdvanced === true ||
0 commit comments