0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
Commit Graph

63 Commits

Author SHA1 Message Date
Michael Matloka
6e51b92f3b
test(frontend): Further improvements to UI stability (#18851)
* test(frontend): Further improvements to UI stability

* Use `waitForPageReady()`

* Override playwright to always be 1.32.2

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update test-runner.ts

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-23 16:35:15 +01:00
David Newell
1961b5b6f1
chore: upgrade playwright (#18793)
* chore: upgrade playwright

* remove core

* upgrade container image

* use test-runner version
2023-11-23 13:51:01 +01:00
Ben White
d65a775a7c
chore: Upgrade test runner (#18794) 2023-11-22 16:24:37 +01:00
Michael Matloka
361e15fa9d
feat(3000): Breadcrumbs bar as dynamic page header (#18426)
* Disable double-tap-to-zoom in our app

* Add prominent scene title to breadcrumbs

* Render page-level actions next to breadcrumbs

* Fix overflow occasionally caused by `InsightTooltip`

* Fix word wrap

* Make spacing more relaxed

* Keep breadcrumb highlighted when popover active

* Resolve cyclic import

* Tune top bar sizing

* Fix import problem

* Fix a couple more issues in stories

* Update UI snapshots for `chromium` (1)

* Wait for loaders more reliably

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-13 21:52:36 +01:00
Michael Matloka
fded6fdf62
test: Regular checkup of visual regression tests (#18469)
* test: Regular checkup of visual regression tests

* Fix billing gauge animation

Animations done in JS can't be stopped automatically by the Storybook test runner. CSS animations can, easily, and they are anyway the cleaner and more performant way of achieving the same here.

* Rename misleading feature flag `recentInsights` to `relatedInsights`

* Mock homepage endpoints to avoid error toasts

* Wait for the recordings list in the notebook node story

* Fix `featureFlagLogic`

* Wait for `.NotebookNode__content`

* Try to optimize

* Screenshot failures and upload as artifacts

* Fix remaining failures

* Increase timeouts

* Fix rendering of Survey stories

* Remove `clang-format`

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Fix alignment of series name in insights details

* Try to fix experiment story flakiness

* Include toasts in loaders

* Fix superfluous toast

* Fix un-awaited breakpoints

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Make login snapshots slightly stabler

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Skip incorrect Surveys story

* Update UI snapshots for `chromium` (2)

* Revert msw upgrade

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-13 15:32:10 +01:00
Michael Matloka
ec095f3aab
test(3000): Fix Sidebar story (#18251) 2023-10-27 22:47:36 +02:00
Thomas Obermüller
d6d259a117
feat(storybook): add theme toggle to storybook (#18123) 2023-10-26 11:27:17 +00:00
Robbie
0fbea00e2f
test: Increase playwright timeouts (#17872)
* Increase playwright timeouts

* Tidy up comments
2023-10-10 12:18:59 +02:00
David Newell
b6c2524699
fix: screenshot flapping from selector (#17555) 2023-09-21 14:11:54 +01:00
Michael Matloka
2edc058d0c
feat: Allow Markdown in item descriptions (#17241)
* feat: Allow Markdown in item descriptions

* Allow forcing Link "open in new" icon for non-text children

* Fix `LemonFileInput` empty child

* Add `LemonMarkdown`

* Simplify `LemonMarkdown` imports

* Update .eslintrc.js

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Increase test timeout

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Paul D'Ambra <paul@posthog.com>
2023-09-18 12:16:33 +02:00
Paul D'Ambra
3908adb4b2
chore: make visual regression less sensitive to differences (#17455)
* chore: make visual regression less sensitive to differences

* Update UI snapshots for `chromium` (1)

* git diff only after optipng has run

* git diff only after optipng has run

* Update UI snapshots for `chromium` (1)

* Update .storybook/test-runner.ts

* text

* no need to run lint staged... we've already run optipng

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-15 11:15:43 +01:00
Paul D'Ambra
65de847328
chore: clear the console in storybook a little (#17430)
* chore: clear the console in storybook a little

* Update .storybook/preview.tsx

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* maybe this?

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* maybe this

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-14 10:37:09 +01:00
David Newell
41d555eddb
chore: wait for unknown lettermark (#17346)
* chore: wait for unknown lettermark
2023-09-11 10:30:50 +01:00
Michael Matloka
41f49b7a18
chore: Use project week start setting in calendars (#17251) 2023-09-06 15:43:44 +02:00
Paul D'Ambra
04e6c7c7d3
chore: report when falling back (#17293)
* chore: report when falling back

* Update UI snapshots for `chromium` (2)

* wait for recordings to buffer in snapshots

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-02 17:35:18 +01:00
Michael Matloka
c098d4b0ba
ci(vrt): Better await in a few more stories (#17244)
* ci(vrt): Better await in a few more stories

* Optimize CI concurrency

* Explain mechanics
2023-08-30 11:49:15 +02:00
Michael Matloka
59d4398646
ci(vrt): Stop the snapshot madness (#17163)
* Remove redundant Playwright specs

* Increase tolerance in Playwright

* Wait for profile pictures to resolve

* Ensure scene is loaded before proceeding

* Always wait for loaders to disappear

* Disable Gravatars in snapshots

* Don't wait for loaders in more stories with loaders

* Improve resiliency of batch export story

* Fix one more loading story

* Unskip Playwright tests

* Improve inconsistencies

* Upgrade Playwright from 1.29.2 to 1.37.1

* Wait for images to load

* Unify code editors

* Properly wait for images to load

* Go back to Playwright 1.29.2

* Wait for loader selector in LemonTable stories

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-29 09:28:03 +02:00
Marius Andra
8075e42879
chore(storybook): upgrade storybook to 7.3 (#17078)
* feat(kea): typegen path cleanup and delete unused files

* bump

* 3.2.2

* typegen upgrade to 3.3.0

* storybook 7.3

* upgrade storybook to 7.3

* try using #storybook-root instead of #root

* try using #storybook-root instead of #root (2)

* try using #storybook-root instead of #root (3)

* try using #storybook-root instead of #root (4)

* switch out argTypes.defaultValue with args

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: Thomas Obermüller <thomas.obermueller@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-21 09:32:49 +02:00
Thomas Obermüller
0b25f54e86
test(storybook): add more insight card examples (#15906)
* add global withFeatureFlags story decorator

* add more examples for insight cards

* Update UI snapshots for `chromium` (2)

* use cached results for all dashboard placements

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-08 21:02:46 +00:00
Michael Matloka
adbffe3584
test(vrt): Disable Firefox snapshots (#15846) 2023-06-01 14:33:21 +00:00
Michael Matloka
5bdfb4ac6d
fix(icons): Restore Redeem icon (#15694)
* fix(icons): Restore `Redeem` icon

* Snapshot all the icons
2023-05-24 12:49:53 +00:00
Ben White
33113b0494
feat: Improved Notebooks UX (#15561) 2023-05-24 12:44:57 +02:00
Michael Matloka
a94a9901d9
fix(taxonomic-filter): Show definition popovers again (#15598) 2023-05-22 09:15:17 +02:00
Michael Matloka
b44dd02b8a
style(3000): Refine sidebar style (#15179)
* style(3000): Refine sidebar style

* Remove extraneous class

* Use slightly darker `border-3000-light`

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Improve sidebar scrolling experience

* Fix logo colors in dark mode

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `webkit` (2)

* Make border color translucent

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-24 15:09:15 +02:00
Michael Matloka
348aee94ce
feat(3000): Update project homepage (#14746)
* Fix "Ctrl" and "Alt" display in `KeyboardShortcut

* Update colors for a less tan light theme

* Add styles for primary and secondary 3000 buttons

* Add Breadcrumbs 3000

* Revert button padding fix

Extracted out into #14750.

* Update UI snapshots for `chromium` (1)

* Restore command palette

* Hide superfluous elements from 3000 homepage

* Restyle all buttons for PostHog 3000 without custom `status`

* Update UI snapshots for `chromium` (1)

* Use "keyboard shortcut" rather than "hotkey" consistently

* Fix current place breadcrumb being translucent

* Use 3000 style more for buttons and popovers

* Fix exporter visual regression

* Update UI snapshots for `chromium` (1)

* Fix typing

* Remove divider

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Increase UI snapshot failure threshold to avoid tab flakiness

* Add some code comments

* Improve buttons styling

* Update UI snapshots for `chromium` (1)

* Tune padding better

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-17 13:26:57 +01:00
Michael Matloka
ab6f079be7
test(frontend): Tune visual regression test failure threshold (#14766)
* Don't take snapshots of the feedback scene

Also fixes some typing.

* Change approach to loading Gravatars to avoid flakiness

* Reduce SSIM failure threshold and use more accurate algorithm

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `firefox` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Increase failure threshold a bit

* Go back to bezkrovny

Looks like `fast` is causing some inexplicable errors.

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `firefox` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-16 16:05:07 +01:00
Michael Matloka
666766429c
test(frontend): Eliminate flakiness of snapshots with charts (#14590)
* Retry pixel data check approach to canvas snapshots

* Increase canvas timeout

* Always make canvases blank

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update snapshots but only clear canvas explicitly

* Update UI snapshots for `chromium` (1)

* Revert "feat(dev): warn about recursive data structures in kea actions (#14573)"

This reverts commit 77d5cf7b08.

* Update UI snapshots

* Increase memory limit

* Don't wait between clearing canvases and taking snapshot

* Update UI snapshots for `chromium` (1)

* Try an in-app approach to chart blanking

* Update UI snapshots for `firefox` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-08 18:06:32 +01:00
Michael Matloka
631ba8c946
test(frontend): Improve reliability of visual regression tests (#14422)
* test(frontend): Ensure 100% reliability of visual regression tests

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Use OptiPNG in CI

* Update UI snapshots for `chromium` (1)

* Don't rely on pre-commit hook for image compression

* Allow waiting for selector instead of constant delay

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Add extra insight rendering conditions

* Set strict timeouts for visual regression test jobs

* Optimize OptiPNG step

* Fix histogram selector

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Ensure non-blank canvas

* Fix blank canvas detection and auto-detect `waitForLoadersToDisappear`

* Use `Spinner` for loading state in `MonacoEditor`

* Make timeout limits less strict

* Update UI snapshots for `chromium` (2)

* Improve blank canvas detection further

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (2)

* Tune selectors

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Try a different way of ensuring graphs are rendered

* Update UI snapshots for `webkit` (2)

* Increase `waitForLoadersToDisappear` initial UI wait

* Update UI snapshots for `webkit` (2)

* Make it easier to see what file wasn't pushed

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Fix `timeout-minutes`

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Add extra wait for canvases

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-02 21:11:03 +00:00
Michael Matloka
1c2d74fe8b
test(frontend): Automatically update UI snapshots in CI (#14391)
* Update UI snapshots with comment instead of failing on change

* Make a few stories more reliable

* Remove unused snapshots in CI

* Update query snapshots

* Update `webkit` UI snapshots

* Update `chromium` UI snapshots

* Update `firefox` UI snapshots

* Shard visual regression tests

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `webkit` (2)

* Fix remaining issues

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Improve reliability of insights snapshots

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Improve reliability of login/signup snapshots

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update .github/workflows/storybook-chromatic.yml

Co-authored-by: Thomas Obermüller <thomas.obermueller@gmail.com>

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Obermüller <thomas.obermueller@gmail.com>
2023-02-24 19:33:39 +00:00
Michael Matloka
2f36cfff7c
refactor(frontend): Replace Tabs with LemonTabs (1/2) (#14191) 2023-02-13 17:13:07 +01:00
Michael Matloka
0ae6902c4a
test(frontend): Optionally track snapshots for Firefox and Safari (#14175) 2023-02-10 12:50:43 +01:00
Michael Matloka
406b6d9357
test(frontend): Cover practically all the Storybook tests with snapshots (#14001) 2023-02-03 13:06:21 +01:00
Michael Matloka
489edd1cc0
test(frontend): Test more Storybook stories automatically (#13947) 2023-01-30 19:30:18 +01:00
Michael Matloka
adacf8ffb4
test(frontend): Automatically test Storybook stories with snapshots (#13839) 2023-01-27 15:51:35 +01:00
Thomas Obermüller
f2bb78a27b
fix(storybook): don't use esbuild for storybook (#13883) 2023-01-23 23:46:29 +01:00
Paul D'Ambra
a895b3fc46
chore: set default mocks for storybook (#13610)
Adds a hook in preview.tsx where global storybook mocks could be added
passes the same default mocks that are used in Jest tests into that hook
merges those mocks with any provided by the mswDecorator for a particular story
2023-01-10 09:49:22 +00:00
Thomas Obermüller
4a30e78b22
chore: use pnpm to manage dependencies (closes #12635) (#13190)
* chore: use pnpm to manage dependencies

* Fix CI errors

* Don't report Docker image size for external PRs

* Fix pnpm-lock.yaml formatting

* Fix module versions

* Ignore pnpm-lock.yaml

* Upgrade Cypress action for pnpm support

* Set up node and pnpm before Cypress

* Fix typescript issues

* Include patches directory in Dockerfile

* Fix Jest tests in CI

* Update lockfile

* Update lockfile

* Clean up Dockerfile

* Update pnpm-lock.yaml to reflect current package.json files

* remove yarn-error.log from .gitignore

* formatting

* update data exploration readme

* type jest.config.ts

* fix @react-hook issues for jest

* fix react-syntax-highlighter issues for jest

* fix jest issues from query-selector-shadow-dom

* fix transform ignore patterns and undo previous fixes

* add missing storybook peer dependencies

* fix nullish coalescing operator for storybook

* reorder storybook plugins

* update editor-update-tsd warning to new npm script

* use legacy ssl for chromatic / node 18 compatibility

* use pnpm for visual regression testing workflow

* use node 16 for chromatic

* add @babel/plugin-proposal-nullish-coalescing-operator as direct dependency

* try fix for plugin-server

* cleanup

* fix comment and warning

* update more comments

* update playwright dockerfile

* update plugin source types

* conditional image size reporting

* revert react-native instructions

* less restrictive pnpm verions

* use ref component name in line with style guide

Co-authored-by: Jacob Gillespie <jacobwgillespie@gmail.com>
2022-12-12 10:28:06 +01:00
Thomas Obermüller
ad1303a0fb
test(e2e-vrt): add playwright visual regression testing for storybook (#13065) 2022-12-07 11:40:56 +01:00
Thomas Obermüller
289ff1dfff
fix(storybook): update dashboard api response to new format (#13030)
* fix(storybook): update dashboard api response to new format

* refactor(storybook): enable quiet mode for mock service worker
2022-11-30 11:42:44 +00:00
Thomas Obermüller
b2b3678cc3
fix(storybook): fix mock service worker (#12779) 2022-11-15 11:22:50 +00:00
Paul D'Ambra
7762c9ecea
chore: turn off chromatic visual regression tests for all but one component (#12516)
* chore: turn off chromatic visual regression tests for all but one component

* run storybook chromatic workflow if the .storybook folder changes
2022-10-30 13:18:17 +01:00
Marius Andra
1aca9598f5
feat(calendar): option to show Sunday first (#11722)
* feat(calendar): option to show Sunday first

* add week_start to app context

* support weekStart in LemonCalendar

* use the weekStart from appContext

* run with newer black

* add storybook context
2022-10-19 15:50:54 +00:00
Michael Matloka
5c783c744c
chore: Add debug info to JSX output (#12295)
* chore: Add debug info to JSX output

* Pin React to `^16.14.0` instead of `^16.13.0`

* Remove redundant `React`s

* Add `@babel/preset-react` for Storybook

* Update babel.config.js
2022-10-17 19:30:31 +02:00
Paul D'Ambra
36622515f1
fix: home accessibility (#11211)
* feat: test a11y with Cypress

* axe test more pages

* archive a11y violations on success too

* remove date from file path

* don't warn if no accessibility files to upload... they're not on all test jobs

* support switching accessibility tests to failing

* support aria label on lemon buttons

* add story book axe add-on

* Defuckulate the tests

* oops

* can't stop skipping a11y failures for home just yet
2022-08-09 20:01:58 +01:00
Ben White
893c483adf
feat: LemonButton refactor (#11093) 2022-08-08 08:27:00 +02:00
Ben White
8c42c7090f
feat: Extended utility classes and updated color palette (#11047) 2022-08-01 14:09:44 +00:00
Marius Andra
9d7b53ea1b
chore(frontend): remove <Provider> (#10556)
* chore(frontend): remove <Provider>

* this is also not how we use storybook
2022-06-29 16:08:30 +02:00
Ben White
dd0695a24c
feat(subscriptions): Insight Subscriptions (#10197)
* Added modal for subscriptions
* Added unsubscribe endpoint
* Added cronjob for sending subscriptions
2022-06-14 15:14:44 +00:00
Marius Andra
c2a97ee645
feat(frontend): storybook form stories (#9173)
* storybook form stories

* improve form story

* improve form story

* chore(npm): upgrade typescript

* upgrade kea-forms

* upgrade to new kea-forms with better value/onChange support

* fix feature flags form

* fix few other forms

* update stories

* sort and description
2022-05-10 11:36:34 +02:00
Michael Matloka
58b59c48b3
docs(storybook): Lemon UI (#9426)
* Put building block component stories under "Lemon UI"

* Use `LemonTable` in `icons` story

* Add Lemon UI overview

* Update `LemonRow` JSDoc

* Fix story titles

* Fix `LemonTable` header height

* Update some stories

* Fix `IconMagnifier` size

* Use `Spinner` in `LemonSwitch` loading state

* Use `Spinner` in `LemonSwitch` and make `LemonRow` mandatory

* Move `LemonTextArea` to "Lemon UI" in Storybook

* Update Lemon UI.stories.mdx

* Fix some buttons

* Refactor `LemonSwitch` a bit and add stories

* Refactor `AlertMessage` a bit and add stories

* Remove old `IconRocket`

* Add `LemonModal` story

* Refactor `LemonCheckbox` stories

* Update Lemon UI.stories.mdx

* Tune styles

* Update `LemonSpacer` (`LemonDivider`) and `LemonRow` disabled state

* Add `Lettermark` and `Splotch`

* Add `LettermarkColor.Default`

* Fix imports

* Update LemonSwitch.stories.tsx
2022-04-27 12:20:52 +02:00