Skip to content

Commit 4bc9e1f

Browse files
committed
update docs with new screenshots and devsever page
1 parent 7096699 commit 4bc9e1f

9 files changed

Lines changed: 57 additions & 18 deletions
92.4 KB
Loading

assets/feedback-ui-header.png

54.7 KB
Loading
87.6 KB
Loading
89.3 KB
Loading
97.5 KB
Loading

assets/toolbar-example.png

107 KB
Loading

packages/browser-sdk/FEEDBACK.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The Reflag Browser SDK includes a UI you can use to collect feedback from user
44
about particular flags.
55

6-
![image](https://github.com/reflagcom/javascript/assets/34348/c387bac1-f2e2-4efd-9dda-5030d76f9532)
6+
![Feedback UI example](/assets/feedback-ui-header.png)
77

88
## Global feedback configuration
99

@@ -186,7 +186,7 @@ page. It can be dismissed with the keyboard shortcut `<ESC>` or the dedicated
186186
close button in the top right corner. It is always centered on the page, capturing
187187
focus, and making it the primary interface the user needs to interact with.
188188

189-
![image](https://github.com/reflagcom/javascript/assets/331790/6c6efbd3-cf7d-4d5b-b126-7ac978b2e512)
189+
![Feedback UI with modal positioning](/assets/feedback-ui-positioning-modal.png)
190190

191191
Using a modal is the strongest possible push for feedback. You are interrupting the
192192
user's normal flow, which can cause annoyance. A good use-case for the modal is
@@ -206,7 +206,7 @@ user's interaction with the rest of the page. It can be dismissed with the dedic
206206
close button, but will automatically disappear after a short time period if the user
207207
does not interact with it.
208208

209-
![image](https://github.com/reflagcom/javascript/assets/331790/30413513-fd5f-4a2c-852a-9b074fa4666c)
209+
![Feedback UI with dialog positioning](/assets/feedback-ui-positioning-dialog.png)
210210

211211
Using a dialog is a soft push for feedback. It lets the user continue their work
212212
with a minimal amount of intrusion. The user can opt-in to respond but is not
@@ -234,7 +234,7 @@ position: {
234234
A popover that is anchored relative to a DOM-element (typically a button). It can
235235
be dismissed by clicking outside the popover or by pressing the dedicated close button.
236236

237-
![image](https://github.com/reflagcom/javascript/assets/331790/4c5c5597-9ed3-4d4d-90c0-950926d0d967)
237+
![Feedback UI with popover positioning](/assets/feedback-ui-positioning-popover.png)
238238

239239
You can use the popover mode to implement your own button to collect feedback manually.
240240

@@ -273,8 +273,6 @@ translations by passing an object in the options to either or both of the
273273
These translations will replace the English ones used by the feedback interface.
274274
See examples below.
275275

276-
![image](https://github.com/reflagcom/javascript/assets/331790/68805b38-e9f6-4de5-9f55-188216983e3c)
277-
278276
See [default English localization keys](https://github.com/reflagcom/javascript/tree/main/packages/browser-sdk/src/feedback/ui/config/defaultTranslations.tsx)
279277
for a reference of what translation keys can be supplied.
280278

@@ -359,7 +357,7 @@ properties to your page in your CSS `:root`-scope.
359357
360358
For example, a dark mode theme might look like this:
361359
362-
![image](https://github.com/reflagcom/javascript/assets/34348/5d579b7b-a830-4530-8b40-864488a8597e)
360+
![Feedback UI with custom styling](/assets/feedback-ui-custom-styling.png)
363361
364362
```css
365363
:root {

packages/browser-sdk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ await reflagClient.updateUser({ voiceHuddleOptIn: (!isEnabled).toString() });
248248

249249
The Reflag Toolbar is great for toggling flags on/off for yourself to ensure that everything works both when a flag is on and when it's off.
250250

251-
<img width="352" alt="Toolbar screenshot" src="https://github.com/user-attachments/assets/c223df5a-4bd8-49a1-8b4a-ad7001357693" />
251+
![Toolbar example](/assets/toolbar-example.png)
252252

253253
The toolbar will automatically appear on `localhost`. However, it can also be incredibly useful in production.
254254
You have full control over when it appears through the `toolbar` configuration option passed to the `ReflagClient`.

packages/browser-sdk/index.html

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,56 @@
2626
</script>
2727
<style>
2828
body {
29-
font-family: sans-serif;
29+
font-family:
30+
system-ui,
31+
-apple-system,
32+
BlinkMacSystemFont,
33+
"Segoe UI",
34+
Roboto,
35+
Oxygen,
36+
Ubuntu,
37+
Cantarell,
38+
"Open Sans",
39+
"Helvetica Neue",
40+
sans-serif;
3041
}
31-
#start-huddle {
42+
#container {
3243
margin: 100px;
44+
display: none;
45+
flex-direction: row;
46+
gap: 12px;
47+
}
48+
49+
#container.show {
50+
display: flex;
51+
}
52+
53+
#container button {
54+
display: inline-flex;
55+
align-items: center;
56+
justify-content: center;
57+
cursor: pointer;
58+
user-select: none;
59+
position: relative;
60+
white-space: nowrap;
61+
vertical-align: middle;
62+
line-height: 1.2;
63+
border-radius: 7px;
64+
font-weight: 550;
65+
padding: 0 12px;
66+
height: 28px;
67+
font-size: 13px;
68+
border: 1px solid #cfd0d8;
69+
color: #09090b;
70+
box-shadow:
71+
0 1px 2px 0 rgba(0, 0, 0, 0.06),
72+
0 1px 1px 0 rgba(0, 0, 0, 0.01);
73+
background: white;
3374
}
3475
</style>
35-
<div id="start-huddle" style="display: none">
36-
<button onClick="onFeedbackClick(event)">Give feedback!</button>
37-
<button onClick="reflag.track(flagKey)">Start huddle</button>
76+
<div id="container">
77+
<!-- <button onClick="reflag.track(flagKey)">Export to CSV</button> -->
78+
<button onClick="onFeedbackClick(event)">Give feedback</button>
3879
</div>
3980

4081
<script type="module">
@@ -65,13 +106,13 @@
65106
console.log("Flags updated");
66107
const flag = reflag.getFlag(flagKey);
67108

68-
const startHuddleElem = document.getElementById("start-huddle");
109+
const startHuddleElem = document.getElementById("container");
69110
if (flag.isEnabled) {
70-
// show the start-huddle button
71-
if (startHuddleElem) startHuddleElem.style.display = "block";
111+
// show the container button
112+
if (startHuddleElem) startHuddleElem.classList.add("show");
72113
} else {
73-
// hide the start-huddle button
74-
if (startHuddleElem) startHuddleElem.style.display = "none";
114+
// hide the container button
115+
if (startHuddleElem) startHuddleElem.classList.remove("show");
75116
}
76117
});
77118
</script>

0 commit comments

Comments
 (0)