Skip to content

Commit c17b008

Browse files
authored
feat(feedback): Implement new user feedback embeddable widget (#9217)
Implements the new user feedback widget. Please view README for instructions and configuration options.
1 parent 9f32c61 commit c17b008

34 files changed

+2832
-30
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ jobs:
9898
- *shared
9999
- 'packages/browser/**'
100100
- 'packages/replay/**'
101+
- 'packages/feedback/**'
101102
browser_integration:
102103
- *shared
103104
- *browser

.size-limit.js

+7
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,11 @@ module.exports = [
121121
gzip: true,
122122
limit: '57 KB',
123123
},
124+
{
125+
name: '@sentry-internal/feedback - Webpack (gzipped)',
126+
path: 'packages/feedback/build/npm/esm/index.js',
127+
import: '{ Feedback }',
128+
gzip: true,
129+
limit: '35 KB',
130+
},
124131
];

packages/feedback/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The following options can be configured as options to the integration, in `new F
5555
| key | type | default | description |
5656
| --------- | ------- | ------- | ----------- |
5757
| `autoInject` | `boolean` | `true` | Injects the Feedback widget into the application when the integration is added. This is useful to turn off if you bring your own button, or only want to show the widget on certain views. |
58+
| `showBranding` | `boolean` | `true` | Displays the Sentry logo inside of the dialog |
5859
| `colorScheme` | `"system" \| "light" \| "dark"` | `"system"` | The color theme to use. `"system"` will follow your OS colorscheme. |
5960

6061
### User/form Related Configuration
@@ -93,7 +94,7 @@ Most text that you see in the default Feedback widget can be customized.
9394
| `formTitle` | `Report a Bug` | The title at the top of the feedback form dialog. |
9495
| `nameLabel` | `Name` | The label of the name input field. |
9596
| `namePlaceholder` | `Your Name` | The placeholder for the name input field. |
96-
| `emailLabel` | `Email` | The label of the email input field. ||
97+
| `emailLabel` | `Email` | The label of the email input field. |
9798
| `emailPlaceholder` | `[email protected]` | The placeholder for the email input field. |
9899
| `messageLabel` | `Description` | The label for the feedback description input field. |
99100
| `messagePlaceholder` | `What's the bug? What did you expect?` | The placeholder for the feedback description input field. |

packages/feedback/jest.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
module.exports = require('../../jest/jest.config.js');
1+
const baseConfig = require('../../jest/jest.config.js');
2+
3+
module.exports = {
4+
...baseConfig,
5+
testEnvironment: 'jsdom',
6+
};

packages/feedback/package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/feedback",
3-
"version": "7.77.0",
3+
"version": "0.0.1-alpha.9",
44
"description": "Sentry SDK integration for user feedback",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/feedback",
@@ -23,9 +23,10 @@
2323
"access": "public"
2424
},
2525
"dependencies": {
26-
"@sentry/core": "7.70.0",
27-
"@sentry/types": "7.70.0",
28-
"@sentry/utils": "7.70.0"
26+
"@sentry/browser": "7.77.0",
27+
"@sentry/core": "7.77.0",
28+
"@sentry/types": "7.77.0",
29+
"@sentry/utils": "7.77.0"
2930
},
3031
"scripts": {
3132
"build": "run-p build:transpile build:types build:bundle",
@@ -51,7 +52,7 @@
5152
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
5253
"test": "jest",
5354
"test:watch": "jest --watch",
54-
"yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push"
55+
"yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig"
5556
},
5657
"volta": {
5758
"extends": "../../package.json"

packages/feedback/src/constants.ts

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
const LIGHT_BACKGROUND = '#ffffff';
2+
const INHERIT = 'inherit';
3+
const LIGHT_THEME = {
4+
fontFamily: "'Helvetica Neue', Arial, sans-serif",
5+
fontSize: '14px',
6+
7+
background: LIGHT_BACKGROUND,
8+
backgroundHover: '#f6f6f7',
9+
foreground: '#2b2233',
10+
border: '1.5px solid rgba(41, 35, 47, 0.13)',
11+
boxShadow: '0px 4px 24px 0px rgba(43, 34, 51, 0.12)',
12+
13+
success: '#268d75',
14+
error: '#df3338',
15+
16+
submitBackground: 'rgba(88, 74, 192, 1)',
17+
submitBackgroundHover: 'rgba(108, 95, 199, 1)',
18+
submitBorder: 'rgba(108, 95, 199, 1)',
19+
submitForeground: LIGHT_BACKGROUND,
20+
21+
cancelBackground: 'transparent',
22+
cancelBackgroundHover: 'var(--background-hover)',
23+
cancelBorder: 'var(--border)',
24+
cancelForeground: 'var(--foreground)',
25+
26+
inputBackground: INHERIT,
27+
inputForeground: INHERIT,
28+
inputBorder: 'var(--border)',
29+
inputBorderFocus: 'rgba(108, 95, 199, 1)',
30+
};
31+
32+
export const DEFAULT_THEME = {
33+
light: LIGHT_THEME,
34+
dark: {
35+
...LIGHT_THEME,
36+
37+
background: '#29232f',
38+
backgroundHover: '#352f3b',
39+
foreground: '#ebe6ef',
40+
border: '1.5px solid rgba(235, 230, 239, 0.15)',
41+
42+
success: '#2da98c',
43+
error: '#f55459',
44+
},
45+
};
46+
47+
export const ACTOR_LABEL = 'Report a Bug';
48+
export const CANCEL_BUTTON_LABEL = 'Cancel';
49+
export const SUBMIT_BUTTON_LABEL = 'Send Bug Report';
50+
export const FORM_TITLE = 'Report a Bug';
51+
export const EMAIL_PLACEHOLDER = '[email protected]';
52+
export const EMAIL_LABEL = 'Email';
53+
export const MESSAGE_PLACEHOLDER = "What's the bug? What did you expect?";
54+
export const MESSAGE_LABEL = 'Description';
55+
export const NAME_PLACEHOLDER = 'Your Name';
56+
export const NAME_LABEL = 'Name';
57+
export const SUCCESS_MESSAGE_TEXT = 'Thank you for your report!';

packages/feedback/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { sendFeedbackRequest } from './util/sendFeedbackRequest';
2+
export { Feedback } from './integration';

0 commit comments

Comments
 (0)