Skip to content

feat(feedback): Implement new user feedback embeddable widget #9217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
64617df
docs(feedback): Add more themeables + improve/fix inconsistencies
billyvg Nov 1, 2023
493992c
wip: initial widget api
billyvg Oct 6, 2023
9f81fda
wip: refactor to functions
billyvg Oct 6, 2023
916bb62
lint
billyvg Oct 10, 2023
5f5479e
ref: move css into separate fns
billyvg Oct 10, 2023
a75e600
ref: move Actor into sep file
billyvg Oct 10, 2023
3e71020
ref: use FeedbackComponent and rename methods
billyvg Oct 10, 2023
9cd810b
feat: add success message, error message, move submit logic up into i…
billyvg Oct 10, 2023
bbc26dc
dont typecheck callback fns
billyvg Oct 13, 2023
4097e4b
some svg refactors
billyvg Oct 13, 2023
6a91be8
WIP: Add attachTo configuration
billyvg Oct 16, 2023
fbf4e30
fix cENS
billyvg Oct 16, 2023
fde0896
try/catch all the things, fix dialog not opening, add autoInject option
billyvg Oct 17, 2023
cd8b208
move feedback class to integration.ts, make isAnonymous work, hide fa…
billyvg Oct 17, 2023
725a42f
ref(Form): destructure options in params
billyvg Oct 17, 2023
9e2ce65
ref: move theme/text labels to constants, fix dark mode for svgs
billyvg Oct 17, 2023
9925a87
ref: change/add some callbacks
billyvg Oct 17, 2023
80294ad
ref: fix onDialogOpened, add option for host id
billyvg Oct 17, 2023
e4904d8
feat: change positioning css to use css vars
billyvg Oct 17, 2023
9b94658
meta: lint fixes
billyvg Oct 17, 2023
c5821d9
use isBrowser
billyvg Oct 25, 2023
ff14e8e
ref(feedback): Refactor to better support multiple dialogs (#9305)
billyvg Oct 25, 2023
fc5568e
refactor shadow/host creation
billyvg Oct 25, 2023
6dfc0b5
remove $ prefix, change h to createElement
billyvg Oct 25, 2023
30596d6
createElementNS
billyvg Oct 25, 2023
1a85ce6
test feedback in size limit
billyvg Oct 26, 2023
3b5bc77
v0.0.1-alpha.5
billyvg Oct 26, 2023
d14ae45
export Form props + add Form test
billyvg Oct 26, 2023
6c532d0
test when message turns empty
billyvg Oct 27, 2023
f41ffd1
add actor test + slight refactor, add text label test for form
billyvg Oct 27, 2023
8a820c6
remove referrer
billyvg Oct 27, 2023
3eb963a
explicit props instead of passing options
billyvg Oct 27, 2023
edd2a90
add dialog test
billyvg Oct 27, 2023
e6c09d2
add submit button test
billyvg Oct 27, 2023
5497c1c
add test for SuccessMessage
billyvg Oct 27, 2023
6bfdbf9
lint
billyvg Oct 30, 2023
02d17c9
add createWidget test, refactor
billyvg Oct 30, 2023
9456f37
ref: remove disabled button, instead add better a11y for required field
billyvg Oct 30, 2023
97ca405
update aria attributes + elements should be in getter
billyvg Oct 30, 2023
6b6ca10
fix type for attachTo
billyvg Oct 30, 2023
03d10cd
missing callback
billyvg Oct 30, 2023
99ef589
update tests
billyvg Oct 30, 2023
c488fcd
lint
billyvg Oct 30, 2023
c97d3bb
bump sentry version
billyvg Oct 31, 2023
0897a26
v0.0.1-alpha.6
billyvg Oct 31, 2023
6a951bd
fix(types): Fix optional types for theme
billyvg Oct 31, 2023
5b12a2f
submit/cancel
billyvg Nov 1, 2023
2b12c96
refactor theme names to be even more consistent, add input styles
billyvg Nov 1, 2023
5230bf6
v0.0.1-alpha.7
billyvg Nov 1, 2023
fda4cb2
feat: Add Sentry branding
billyvg Nov 1, 2023
7942039
fix outline
billyvg Nov 2, 2023
6d439d5
fix branding
billyvg Nov 2, 2023
5c2682f
fix darkmode firefox
billyvg Nov 2, 2023
b9a3c9c
v0.0.1-alpha.8
billyvg Nov 2, 2023
9c02d47
v0.0.1-alpha.9
billyvg Nov 2, 2023
cc43a04
review fixes
billyvg Nov 6, 2023
aa31d8d
prettier
billyvg Nov 6, 2023
78e6b60
fix ts
billyvg Nov 6, 2023
ee46ff4
more ts
billyvg Nov 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
- *shared
- 'packages/browser/**'
- 'packages/replay/**'
- 'packages/feedback/**'
browser_integration:
- *shared
- *browser
Expand Down
7 changes: 7 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,11 @@ module.exports = [
gzip: true,
limit: '57 KB',
},
{
name: '@sentry-internal/feedback - Webpack (gzipped)',
path: 'packages/feedback/build/npm/esm/index.js',
import: '{ Feedback }',
gzip: true,
limit: '35 KB',
},
];
3 changes: 2 additions & 1 deletion packages/feedback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The following options can be configured as options to the integration, in `new F
| key | type | default | description |
| --------- | ------- | ------- | ----------- |
| `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. |
| `showBranding` | `boolean` | `true` | Displays the Sentry logo inside of the dialog |
| `colorScheme` | `"system" \| "light" \| "dark"` | `"system"` | The color theme to use. `"system"` will follow your OS colorscheme. |

### User/form Related Configuration
Expand Down Expand Up @@ -93,7 +94,7 @@ Most text that you see in the default Feedback widget can be customized.
| `formTitle` | `Report a Bug` | The title at the top of the feedback form dialog. |
| `nameLabel` | `Name` | The label of the name input field. |
| `namePlaceholder` | `Your Name` | The placeholder for the name input field. |
| `emailLabel` | `Email` | The label of the email input field. ||
| `emailLabel` | `Email` | The label of the email input field. |
| `emailPlaceholder` | `[email protected]` | The placeholder for the email input field. |
| `messageLabel` | `Description` | The label for the feedback description input field. |
| `messagePlaceholder` | `What's the bug? What did you expect?` | The placeholder for the feedback description input field. |
Expand Down
7 changes: 6 additions & 1 deletion packages/feedback/jest.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
module.exports = require('../../jest/jest.config.js');
const baseConfig = require('../../jest/jest.config.js');

module.exports = {
...baseConfig,
testEnvironment: 'jsdom',
};
11 changes: 6 additions & 5 deletions packages/feedback/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/feedback",
"version": "7.77.0",
"version": "0.0.1-alpha.9",
"description": "Sentry SDK integration for user feedback",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/feedback",
Expand All @@ -23,9 +23,10 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "7.70.0",
"@sentry/types": "7.70.0",
"@sentry/utils": "7.70.0"
"@sentry/browser": "7.77.0",
"@sentry/core": "7.77.0",
"@sentry/types": "7.77.0",
"@sentry/utils": "7.77.0"
},
"scripts": {
"build": "run-p build:transpile build:types build:bundle",
Expand All @@ -51,7 +52,7 @@
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
"test": "jest",
"test:watch": "jest --watch",
"yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push"
"yalc:publish": "ts-node ../../scripts/prepack.ts --bundles && yalc publish ./build/npm --push --sig"
},
"volta": {
"extends": "../../package.json"
Expand Down
57 changes: 57 additions & 0 deletions packages/feedback/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const LIGHT_BACKGROUND = '#ffffff';
const INHERIT = 'inherit';
const LIGHT_THEME = {
fontFamily: "'Helvetica Neue', Arial, sans-serif",
fontSize: '14px',

background: LIGHT_BACKGROUND,
backgroundHover: '#f6f6f7',
foreground: '#2b2233',
border: '1.5px solid rgba(41, 35, 47, 0.13)',
boxShadow: '0px 4px 24px 0px rgba(43, 34, 51, 0.12)',

success: '#268d75',
error: '#df3338',

submitBackground: 'rgba(88, 74, 192, 1)',
submitBackgroundHover: 'rgba(108, 95, 199, 1)',
submitBorder: 'rgba(108, 95, 199, 1)',
submitForeground: LIGHT_BACKGROUND,

cancelBackground: 'transparent',
cancelBackgroundHover: 'var(--background-hover)',
cancelBorder: 'var(--border)',
cancelForeground: 'var(--foreground)',

inputBackground: INHERIT,
inputForeground: INHERIT,
inputBorder: 'var(--border)',
inputBorderFocus: 'rgba(108, 95, 199, 1)',
};

export const DEFAULT_THEME = {
light: LIGHT_THEME,
dark: {
...LIGHT_THEME,

background: '#29232f',
backgroundHover: '#352f3b',
foreground: '#ebe6ef',
border: '1.5px solid rgba(235, 230, 239, 0.15)',

success: '#2da98c',
error: '#f55459',
},
};

export const ACTOR_LABEL = 'Report a Bug';
export const CANCEL_BUTTON_LABEL = 'Cancel';
export const SUBMIT_BUTTON_LABEL = 'Send Bug Report';
export const FORM_TITLE = 'Report a Bug';
export const EMAIL_PLACEHOLDER = '[email protected]';
export const EMAIL_LABEL = 'Email';
export const MESSAGE_PLACEHOLDER = "What's the bug? What did you expect?";
export const MESSAGE_LABEL = 'Description';
export const NAME_PLACEHOLDER = 'Your Name';
export const NAME_LABEL = 'Name';
export const SUCCESS_MESSAGE_TEXT = 'Thank you for your report!';
1 change: 1 addition & 0 deletions packages/feedback/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { sendFeedbackRequest } from './util/sendFeedbackRequest';
export { Feedback } from './integration';
Loading