Skip to content

Commit 9c72f53

Browse files
arraypressclaude
andcommitted
Draw the tooltip beside the heading this class draws
Same reasoning as the badge: where a screen writes its own header cell, the kit is told to draw no label, so it draws no help icon either — and the icon belongs beside the heading rather than against the side of the control. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tk8y5eZa3CHVVSM6nVxsJw
1 parent 5a33f50 commit 9c72f53

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/SettingFields.php‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use ArrayPress\FieldKit\Field;
2222
use ArrayPress\FieldKit\FieldSet;
2323
use ArrayPress\FieldKit\Support\Badge;
24+
use ArrayPress\FieldKit\Support\Tooltip;
2425
use ArrayPress\FieldKit\Support\PageHeader;
2526

2627
/**
@@ -690,17 +691,20 @@ private function render_table( FieldSet $set, array $fields ): void {
690691
// the renderer is told to draw none, so it draws no badge either.
691692
$badge = Badge::for_field( $field );
692693

694+
// Beside the heading, which this class draws rather than the kit.
695+
$tooltip = Tooltip::for_field( $field );
696+
693697
$header = $type->is_self_labelling() || $type->is_grouped()
694698
? sprintf(
695699
'<span class="field-kit__row-label">%s%s</span>',
696700
esc_html( $field->label() ),
697-
$badge // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped as it is built.
701+
$badge . $tooltip // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped as it is built.
698702
)
699703
: sprintf(
700704
'<label for="%s">%s</label>%s',
701705
esc_attr( $field->input_id() ),
702706
esc_html( $field->label() ),
703-
$badge // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped as it is built.
707+
$badge . $tooltip // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped as it is built.
704708
);
705709

706710
printf(

0 commit comments

Comments
 (0)