Skip to content

Improve widget footer: AI disclaimer and compact layout#246

Merged
neuromechanist merged 6 commits intodevelopfrom
feature/issue-245-widget-footer
Mar 2, 2026
Merged

Improve widget footer: AI disclaimer and compact layout#246
neuromechanist merged 6 commits intodevelopfrom
feature/issue-245-widget-footer

Conversation

@neuromechanist
Copy link
Member

@neuromechanist neuromechanist commented Mar 2, 2026

Summary

  • Add configurable AI disclaimer above the footer: "This is a multi-agent AI assistant and may make mistakes. Please verify responses." (faded orange background)
  • Merge the two separate footer lines (page context checkbox + powered by) into a single compact row with pipe separator
  • Left side: checkbox for "Share page URL to help answer questions"
  • Right side: "Powered by OSA v0.7.1 (71a2511)" with OSA hyperlinked to website
  • All disclaimer options configurable: disclaimerEnabled, disclaimerText, disclaimerColor, disclaimerBackground
  • Color values validated with CSS color pattern before applying (matches existing themeColor approach)

Closes #245

Test plan

  • Verify AI disclaimer renders above the footer with orange background
  • Verify combined footer shows checkbox on left, powered-by on right, pipe separator between
  • Verify "OSA" link opens osc.earth/osa in new tab
  • Verify version and commit hash still display correctly
  • Verify page context checkbox toggle still works
  • Verify layout correct when allowPageContext is false (checkbox and separator hidden)
  • Verify disclaimer hidden when disclaimerEnabled is false
  • Verify invalid color values fall back to defaults (CSS custom property fallback)

Add AI disclaimer banner below header noting the assistant is
multi-agent AI and can make mistakes. Merge the page context
checkbox and "Powered by" lines into a single row with checkbox
on left and "Powered by OSA" (hyperlinked) with version on right.

Closes #245
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Preview Deployment

Name Link
Preview URL https://feature-issue-245-widget-foo-demo.osc.earth
Branch feature/issue-245-widget-footer
Commit fab591d

This preview will be updated automatically when you push new commits.

Move the AI disclaimer line from above the header to just above
the footer row. Shorten text. Add pipe separator between the
page context checkbox and the powered-by portion.
Add disclaimerEnabled, disclaimerText, disclaimerColor, and
disclaimerBackground CONFIG options. Current values are defaults
that widget embedders can override.
- Fix CSS injection: use validated CSS custom properties instead
  of interpolating config values into inline style attributes
- Remove dead .osa-chat-footer CSS rule entirely
- Replace separator span with ::after pseudo-element
- Add null/undefined guard for disclaimerText
- Validate disclaimerColor/disclaimerBackground with CSS color
  pattern before applying (matches themeColor approach)
@neuromechanist
Copy link
Member Author

PR Review Findings

Reviewed by 3 specialized agents: code-reviewer, silent-failure-hunter, code-simplifier.

Critical (1) -- Fixed

# Issue Fix
1 CSS injection via inline style attributes: disclaimerColor and disclaimerBackground were interpolated directly into style= without sanitization, allowing arbitrary CSS injection by malicious embedders Replaced inline styles with validated CSS custom properties (--osa-disclaimer-color, --osa-disclaimer-bg). Color values validated against CSS color pattern before applying, matching existing themeColor approach. Defaults provided via var() fallback.

Important (3) -- Fixed

# Issue Fix
2 Dead CSS: .osa-chat-footer { display: none } left as vestige instead of removed Removed the entire rule block
3 Inline styles instead of CSS custom properties: Disclaimer colors should use the same pattern as themeColor Colors now applied via container.style.setProperty() with validation in applyWidgetConfig()
4 null/undefined in disclaimer config: Passing disclaimerText: null renders literal "null"; passing disclaimerColor: null produces invalid CSS silently Added disclaimerText || '' fallback; color values validated before applying, invalid values silently fall back to CSS defaults

Nice-to-have (3) -- 2 Fixed, 1 Documented

# Issue Status
5 Separator span unnecessary: A <span> element with duplicated allowPageContext conditional could be replaced with ::after pseudo-element Fixed -- replaced with ::after on .osa-page-context-toggle, eliminating extra element and conditional
6 PR description mismatch: Said "below the header" but disclaimer is above the footer Fixed -- updated PR description
7 Separator visibility not updated on dynamic config change: If allowPageContext changes after render, separator stays stale Pre-existing issue (checkbox had same problem before this PR). Now moot since ::after is tied to the toggle element itself.

All critical and important issues addressed in commit f37c380.

@neuromechanist neuromechanist merged commit 0d70be0 into develop Mar 2, 2026
8 checks passed
@neuromechanist neuromechanist deleted the feature/issue-245-widget-footer branch March 2, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant