Skip to content

feat(inspection): add callout banner form field type - #1255

Merged
kyasbal merged 2 commits into
mainfrom
push-orqusuuytlvu
Nov 11, 2026
Merged

kyasbal merged 2 commits into
mainfrom
push-orqusuuytlvu

Conversation

@kyasbal

@kyasbal kyasbal commented Nov 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds a read-only Callout Banner (callout) parameter form field type across the dynamic inspection parameter form stack so inspection tasks can display contextual notices, prerequisite advisories, quota warnings, and blocking error banners without rendering an input control (<mat-form-field> / <input>) or validation checkmark (check_circle).

Key Changes

  • Protobuf (proto/api/v1/inspection.proto):
    • Defined CalloutFormField and added CalloutFormField callout = 12 to FormField.kind.
    • Regenerated Go (pkg/generated/api/v1/inspection.pb.go) and TypeScript (web/src/app/generated/api/v1/inspection_pb.{js,d.ts}) bindings.
  • Go Metadata & Declarative Task Builder (pkg/core/inspection/metadata/, pkg/core/inspection/formtask/):
    • Added Callout ("callout") to ParameterInputType and CalloutParameterFormField to inspectionmetadata.
    • Added formtask.DefineCalloutForm and CalloutFormSpec supporting Info, Warning, and Error severities, omitting empty/None banners, and failing TaskModeRun when an Error callout remains unresolved.
  • Connect-RPC & MCP Server (pkg/server/api/v1/, pkg/server/mcp/):
    • Mapped CalloutParameterFormField in convertFormFields.
    • Updated MCP dry_run_inspection formatting and template guidance so callout fields render read-only notices (Info, Warning, Error), contribute to warning/error counts appropriately, and accept no parameter value.
  • Angular New Inspection Dialog (web/src/app/...):
    • Added ParameterInputType.Callout and CalloutParameterFormField to form-types.ts and inspection-converter.ts.
    • Updated new-inspection.utils.ts and ParameterInputStepComponent so read-only callouts do not inflate user input fieldCount denominators while still disabling the Run button and displaying clear footer status messages when an error or pending callout is active.
    • Added CalloutParameterComponent (khi-new-inspection-callout-parameter), registered it in GroupParameterComponent, and added Storybook stories (Dialogs/NewInspection/CalloutParameter).
  • Documentation (docs/{en,ja}/task-system/03-advanced-and-form-tasks.md):
    • Documented formtask.DefineCalloutForm in both English and Japanese task system guides.

Verification

  • make format-proto, make lint-proto, make build-proto
  • make pre-commit
  • make build-go, make lint-go, make test-go
  • make build-web, make lint-web, make test-web, make build-storybook
Add a read-only Callout (callout) parameter form field across Protobuf, Go form metadata, formtask (DefineCalloutForm), Connect-RPC conversion, MCP dry_run_inspection rendering, and Angular New Inspection dialog UI so inspection tasks can surface informational, warning, and blocking error notices without rendering an input control.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new read-only callout banner form task (DefineCalloutForm) to display prerequisite notices, warnings, or errors in parameter forms without input controls. It updates the backend task definition, proto schemas, and server converters, while adding a frontend CalloutParameterComponent with corresponding validation logic and documentation. The review feedback suggests replacing the use of [innerHTML] and the custom breakline pipe with standard Angular interpolation and CSS white-space: pre-line to prevent potential XSS vulnerabilities and simplify the component imports.

Comment on lines +36 to +41
@if (param.description) {
<p class="description" [innerHTML]="param.description | breakline"></p>
}
@if (param.hint) {
<p class="message" [innerHTML]="param.hint | breakline"></p>
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of using [innerHTML] with a custom breakline pipe to render multiline text, you can leverage standard Angular interpolation combined with the CSS property white-space: pre-line (or pre-wrap) on the .description and .message classes. This is more secure as it avoids bypassing Angular's built-in XSS protection via [innerHTML], and it simplifies the template by removing the pipe dependency. Remember to add white-space: pre-line; to the .description and .message classes in callout-parameter.component.scss to preserve the newlines.

Suggested change
@if (param.description) {
<p class="description" [innerHTML]="param.description | breakline"></p>
}
@if (param.hint) {
<p class="message" [innerHTML]="param.hint | breakline"></p>
}
@if (param.description) {
<p class="description">{{ param.description }}</p>
}
@if (param.hint) {
<p class="message">{{ param.hint }}</p>
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 228925a. Replaced [innerHTML] + breakline with standard text interpolation and added white-space: pre-line; to .description and .message in callout-parameter.component.scss.

Comment on lines +40 to +45
imports: [
MatIconModule,
MatProgressSpinnerModule,
KHIIconRegistrationModule,
BreaklinePipe,
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If you adopt the white-space: pre-line approach to render newlines, the BreaklinePipe is no longer needed in this component. You can remove it from the imports array here, as well as its import statement on line 25.

  imports: [
    MatIconModule,
    MatProgressSpinnerModule,
    KHIIconRegistrationModule,
  ],

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 228925a. Removed the unused BreaklinePipe import and @Component.imports entry.

@kyasbal
kyasbal added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 80d4830 Nov 11, 2026
21 checks passed
@kyasbal
kyasbal deleted the push-orqusuuytlvu branch November 11, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant