Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fix error message styling consistency in browser notification modal (#4418)

Copilot85082d248e9e
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index 5c01602d7d..9562aacb3b 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -53,6 +53,12 @@ Do not access the web application via http://localhost:8080 or build the web pro
Take a screenshot after every UI change without being asked. Screenshots should be automatically taken after every code change that affects UI.
After every UI change we should be able to see in the PR comments, visually, exactly what the change is. This helps with code review and ensures that the UI changes are clear and understandable. This should happen every time, automatically, without being asked, and never fail or be skipped.
+These screenshots should be displayed inline in the PR comments, and not as attachments. This allows reviewers to see the changes without having to download or open files separately.
+
+- If it is a standalone UI component, take a screenshot of the component in Storybook if it is available.
+- When taking a screenshot of a component in Storybook, make sure to hide all the controls that are not relevant to the component itself. This means hiding the knobs, actions, and any other controls that are not part of the component's visual representation and would get in the way of the screenshot.
+- If it is something that doesn't exist in Storybook, take a screenshot of the component in the live web application using the local development server.
+- Most things in the admin do not exist in Storybook, so screenshots should be taken of the admin web application.
- When taking a screenshot of the web frontend or the admin web application, an instance of the Owncast backend service needs to be running locally by running `go run main.go` in the root of the repository as well.
- When taking screenshots for PR documentation, create temporary files in /tmp directory or use patterns like _screenshot_.js and _screenshot_.png that are excluded by .gitignore.
- Screnshots should be taken using the web dev server at `http://localhost:3000` and not the production build at `http://localhost:8080`.
diff --git a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.module.scss b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.module.scss
index 6e5e6ec619..bddba16e34 100644
--- a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.module.scss
+++ b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.module.scss
@@ -2,6 +2,20 @@
margin-bottom: 5px;
}
+.errorAlert {
+ margin-bottom: 1.25rem;
+ font-family: var(--theme-text-display-font-family);
+
+ :global(.ant-alert-message) {
+ font-size: 14px;
+ }
+
+ :global(.ant-alert-description) {
+ font-size: 12px;
+ font-family: monospace;
+ }
+}
+
.pushPreview {
border-style: dashed;
border-width: 2px;
diff --git a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx
index 59cb476f4f..f6fd6c8067 100644
--- a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx
+++ b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx
@@ -1,4 +1,4 @@
-import { Row, Spin, Typography, Button } from 'antd';
+import { Row, Spin, Typography, Button, Alert } from 'antd';
import React, { FC, useState } from 'react';
import UploadOutlined from '@ant-design/icons/lib/icons/UploadOutlined';
import PlusSquareOutlined from '@ant-design/icons/lib/icons/PlusSquareOutlined';
@@ -189,7 +189,18 @@ export const BrowserNotifyModal = () => {
  about Owncast browser notifications.
</span>
</Row>
- <Row>{error}</Row>
+ <Row>
+ {error && (
+ <Alert
+ message="Browser Notification Error"
+ description={error}
+ type="error"
+ closable
+ className={styles.errorAlert}
+ onClose={() => setError(null)}
+ />
+ )}
+ </Row>
<PermissionPopupPreview start={() => startBrowserPushRegistration()} />
</Spin>
</ErrorBoundary>