|
51 | 51 | pageContextDefaultEnabled: true, // Default state of checkbox |
52 | 52 | pageContextStorageKey: 'osa-page-context-enabled', |
53 | 53 | pageContextLabel: 'Share page URL to help answer questions', |
| 54 | + // AI disclaimer shown above the footer |
| 55 | + disclaimerEnabled: true, |
| 56 | + disclaimerText: 'This is a multi-agent AI assistant and may make mistakes. Please verify responses.', |
| 57 | + disclaimerColor: '#9a3412', |
| 58 | + disclaimerBackground: '#fff7ed', |
54 | 59 | // Fullscreen mode (for pop-out windows) |
55 | 60 | fullscreen: false, |
56 | 61 | // Streaming responses - enable progressive text display for better UX |
|
696 | 701 | 40% { transform: scale(1); } |
697 | 702 | } |
698 | 703 |
|
699 | | - .osa-chat-footer { |
700 | | - padding: 8px 16px; |
701 | | - border-top: 1px solid var(--osa-border); |
702 | | - text-align: center; |
703 | | - font-size: 11px; |
704 | | - color: var(--osa-text-light); |
705 | | - } |
706 | | -
|
707 | | - .osa-chat-footer a { |
708 | | - color: var(--osa-text-light); |
709 | | - text-decoration: none; |
710 | | - } |
711 | | -
|
712 | | - .osa-chat-footer a:hover { |
713 | | - color: var(--osa-primary); |
714 | | - text-decoration: underline; |
715 | | - } |
716 | 704 |
|
717 | 705 | .osa-turnstile-container { |
718 | 706 | padding: 12px 16px; |
|
758 | 746 | border-top: 2px solid rgba(0,0,0,0.2); |
759 | 747 | } |
760 | 748 |
|
761 | | - .osa-page-context-toggle { |
| 749 | + .osa-ai-disclaimer { |
| 750 | + padding: 4px 16px; |
| 751 | + font-size: 10px; |
| 752 | + text-align: center; |
| 753 | + border-top: 1px solid var(--osa-border); |
| 754 | + color: var(--osa-disclaimer-color, #9a3412); |
| 755 | + background: var(--osa-disclaimer-bg, #fff7ed); |
| 756 | + } |
| 757 | +
|
| 758 | + .osa-combined-footer { |
762 | 759 | padding: 6px 16px; |
763 | 760 | font-size: 11px; |
764 | 761 | color: var(--osa-text-light); |
765 | 762 | display: flex; |
766 | 763 | align-items: center; |
767 | | - gap: 6px; |
| 764 | + justify-content: space-between; |
| 765 | + border-top: 1px solid var(--osa-border); |
| 766 | + gap: 8px; |
| 767 | + } |
| 768 | +
|
| 769 | + .osa-combined-footer .osa-page-context-toggle { |
| 770 | + display: flex; |
| 771 | + align-items: center; |
| 772 | + gap: 5px; |
| 773 | + flex-shrink: 0; |
| 774 | + } |
| 775 | +
|
| 776 | + .osa-combined-footer .osa-page-context-toggle::after { |
| 777 | + content: '|'; |
| 778 | + color: var(--osa-text-light); |
| 779 | + opacity: 0.5; |
| 780 | + margin-left: 3px; |
768 | 781 | } |
769 | 782 |
|
770 | | - .osa-page-context-toggle input[type="checkbox"] { |
| 783 | + .osa-combined-footer input[type="checkbox"] { |
771 | 784 | width: 11px; |
772 | 785 | height: 11px; |
773 | 786 | margin: 0; |
774 | 787 | cursor: pointer; |
775 | 788 | accent-color: var(--osa-primary); |
776 | 789 | } |
777 | 790 |
|
778 | | - .osa-page-context-toggle label { |
| 791 | + .osa-combined-footer label { |
779 | 792 | cursor: pointer; |
780 | 793 | user-select: none; |
781 | 794 | } |
782 | 795 |
|
| 796 | + .osa-combined-footer .osa-footer-powered { |
| 797 | + text-align: right; |
| 798 | + white-space: nowrap; |
| 799 | + } |
| 800 | +
|
| 801 | + .osa-combined-footer .osa-footer-powered a { |
| 802 | + color: var(--osa-text-light); |
| 803 | + text-decoration: none; |
| 804 | + font-weight: 600; |
| 805 | + } |
| 806 | +
|
| 807 | + .osa-combined-footer .osa-footer-powered a:hover { |
| 808 | + color: var(--osa-primary); |
| 809 | + text-decoration: underline; |
| 810 | + } |
| 811 | +
|
783 | 812 | /* Settings modal - contained within chat window to avoid z-index conflicts |
784 | 813 | and ensure modal is properly scoped to the widget's stacking context */ |
785 | 814 | .osa-settings-overlay { |
|
1552 | 1581 | container.style.setProperty('--osa-primary-dark', darker); |
1553 | 1582 | } |
1554 | 1583 |
|
| 1584 | + // Apply disclaimer colors if configured (must be valid CSS color: hex, named, rgb, hsl) |
| 1585 | + const cssColorPattern = /^(#[0-9a-fA-F]{3,8}|[a-zA-Z]+|rgba?\([^)]+\)|hsla?\([^)]+\))$/; |
| 1586 | + if (CONFIG.disclaimerColor && cssColorPattern.test(CONFIG.disclaimerColor.trim())) { |
| 1587 | + container.style.setProperty('--osa-disclaimer-color', CONFIG.disclaimerColor.trim()); |
| 1588 | + } |
| 1589 | + if (CONFIG.disclaimerBackground && cssColorPattern.test(CONFIG.disclaimerBackground.trim())) { |
| 1590 | + container.style.setProperty('--osa-disclaimer-bg', CONFIG.disclaimerBackground.trim()); |
| 1591 | + } |
| 1592 | + |
1555 | 1593 | // Update header title |
1556 | 1594 | const titleEl = container.querySelector('.osa-chat-title'); |
1557 | 1595 | if (titleEl) { |
|
1919 | 1957 | ${ICONS.send} |
1920 | 1958 | </button> |
1921 | 1959 | </div> |
1922 | | - <div class="osa-page-context-toggle" style="display: ${CONFIG.allowPageContext ? 'flex' : 'none'}"> |
1923 | | - <input type="checkbox" id="osa-page-context-checkbox" ${pageContextEnabled ? 'checked' : ''} /> |
1924 | | - <label for="osa-page-context-checkbox">${escapeHtml(CONFIG.pageContextLabel)}</label> |
1925 | | - </div> |
1926 | | - <div class="osa-chat-footer"> |
1927 | | - <a href="${escapeHtml(CONFIG.repoUrl)}" target="_blank" rel="noopener noreferrer"> |
1928 | | - Powered by ${escapeHtml(CONFIG.repoName)} (osc.earth/osa)<span class="osa-version"></span> |
1929 | | - </a> |
| 1960 | + <div class="osa-ai-disclaimer" style="display: ${CONFIG.disclaimerEnabled ? 'block' : 'none'}">${escapeHtml(CONFIG.disclaimerText || '')}</div> |
| 1961 | + <div class="osa-combined-footer"> |
| 1962 | + <div class="osa-page-context-toggle" style="display: ${CONFIG.allowPageContext ? 'flex' : 'none'}"> |
| 1963 | + <input type="checkbox" id="osa-page-context-checkbox" ${pageContextEnabled ? 'checked' : ''} /> |
| 1964 | + <label for="osa-page-context-checkbox">${escapeHtml(CONFIG.pageContextLabel)}</label> |
| 1965 | + </div> |
| 1966 | + <div class="osa-footer-powered"> |
| 1967 | + Powered by <a href="${escapeHtml(CONFIG.repoUrl)}" target="_blank" rel="noopener noreferrer">OSA</a><span class="osa-version"></span> |
| 1968 | + </div> |
1930 | 1969 | </div> |
1931 | 1970 | <div class="osa-settings-overlay"> |
1932 | 1971 | <div class="osa-settings-modal"> |
|
0 commit comments