Skip to content
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

fix(surveys): polishing the popup survey UI #1279

Merged
merged 4 commits into from
Jul 5, 2024

Conversation

dmarticus
Copy link
Contributor

@dmarticus dmarticus commented Jul 1, 2024

Changes

Closes issues 1,3, and 4 from this ticket PostHog/posthog#20851.

Fixing 4 requires some changes to posthog, too: PostHog/posthog#23460

Issue 2 I wasn't able to reproduce; I need more context from @annikaschmid and/or @jurajmajerik

Quick note on browser compatibility: I'm using the :has pseudo-selector for determining whether to apply margins or not. Per caniuse, this has been supported in all major browsers since 2023, but is this a risky change still?

Visual Diff For Part 1

Before

2024-07-01 16 46 43

After

2024-07-01 16 41 07

Visual Diff for Part 3

Before

2024-07-02 12 28 27

After

2024-07-02 11 57 41

Visual Diff for Part 4

Before

2024-07-03 13 47 07

After

2024-07-03 13 21 12

...

Checklist

  • Tests for new code (see advice on the tests we use)
  • I manually tested this for each survey type
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

Copy link

vercel bot commented Jul 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Jul 3, 2024 8:41pm

Copy link

github-actions bot commented Jul 1, 2024

Size Change: +34.5 kB (+3.1%)

Total Size: 1.15 MB

Filename Size Change
dist/array.full.js 316 kB +1.18 kB (+0.37%)
dist/array.js 154 kB +10.5 kB (+7.34%) 🔍
dist/main.js 155 kB +10.5 kB (+7.3%) 🔍
dist/module.js 154 kB +10.5 kB (+7.34%) 🔍
dist/recorder-v2.js 110 kB +1.38 kB (+1.27%)
dist/recorder.js 110 kB +1.38 kB (+1.27%)
dist/surveys-preview.js 59.6 kB -748 B (-1.24%)
dist/surveys.js 64.6 kB -301 B (-0.46%)
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 10.4 kB
dist/tracing-headers.js 8.26 kB
dist/web-vitals.js 5.79 kB

compressed-size-action

@dmarticus dmarticus force-pushed the feat/popup-survey-ui-polish branch from 3ba700a to d203f58 Compare July 1, 2024 23:38
@dmarticus dmarticus marked this pull request as draft July 1, 2024 23:47
Comment on lines +60 to +62
.survey-box:has(.survey-question:empty):not(:has(.description)) textarea {
margin-top: 0;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only want to remove the margin in the event where there's no description (the selector is gone) AND there's no question (the selector is empty). Otherwise, the margins should remain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using the :has pseudo-selector ... supported in all major browsers since 2023, but is this a risky change still?

This is fine in my opinion. It's a small styling detail that just won't work in a tiny minority of cases.

@dmarticus dmarticus marked this pull request as ready for review July 2, 2024 17:26
@dmarticus dmarticus requested a review from a team July 2, 2024 17:26
@dmarticus dmarticus changed the title fix(surveys): polishing the surveys UI fix(surveys): polishing the popup survey UI, part 1 Jul 2, 2024
@dmarticus dmarticus changed the title fix(surveys): polishing the popup survey UI, part 1 fix(surveys): polishing the popup survey UI Jul 2, 2024
@jurajmajerik
Copy link
Contributor

While you're at it, can you please also check the emoji color under the "New survey" view?

image

@jurajmajerik
Copy link
Contributor

Hmm, the emojis are still white for me, both in the preview and the live survey:
image

@jurajmajerik
Copy link
Contributor

Same goes for the top margin:
image

I thought maybe I wasn't linking posthog-js properly, but not the case - I can see the new stylesheet under Sources/surveys-utils.tsx and the confirmation message is being sized correctly.

@jurajmajerik
Copy link
Contributor

Issue 2 I wasn't able to reproduce

This is more like a feature request than a bug - we currently don't allow customization of the confirmation message text. Feel free to address in a follow up :)

@dmarticus
Copy link
Contributor Author

@jurajmajerik yeah, I haven't finished part 4 yet, sorry! I thought I'd gotten it working but it's not ready.

@dmarticus
Copy link
Contributor Author

Same goes for the top margin: image

I thought maybe I wasn't linking posthog-js properly, but not the case - I can see the new stylesheet under Sources/surveys-utils.tsx and the confirmation message is being sized correctly.

Wait, so are you saying you can't reproduce the top margin being re-sized correctly?

This is what I see when I run it with posthog-js locally

image

@jurajmajerik
Copy link
Contributor

There's indeed something going wrong with my posthog-js linking. I've just sunk an hour trying to figure it out, but I'm gonna cut my losses - I trust you this is working :)

@dmarticus dmarticus merged commit 2a8fd80 into main Jul 5, 2024
14 checks passed
@dmarticus dmarticus deleted the feat/popup-survey-ui-polish branch July 5, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants