0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
Commit Graph

26 Commits

Author SHA1 Message Date
Marius Andra
88e1300a14
fix exception when using a bad selector to select actions (#3067) 2021-01-25 09:35:07 +01:00
Marius Andra
19b453c996
Kea TypeGen types in the same folder as logic (#3048)
* update kearc to generate types in the same folder, add types to gitignore

* update type imports
2021-01-22 10:21:48 +01:00
Paolo D'Amico
f9a35e2dbf
Instrument toolbar (#2859)
* elements instrumentation, stats & heatmaps

* add events for action & inspect mode

* more events

* fix capture on setExtensionPercentage

* update posthog imports

* add heatmap and action counts

* update heatmap and action counts

* fix few type errors

* track down all data-* attributes when selecting an HTML element in the toolbar

* exchange extensionPercentage for toolbar loaded

* rename event (lost in some rebase)

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-01-07 12:55:25 +01:00
Marius Andra
71b022b8cb
fix bug from query-selector-shadow-dom update (#2856) 2021-01-05 19:48:27 +01:00
Marius Andra
22ef7cec6f
Custom NPM packages under @posthog (#2854)
* move some packages out of the @mariusandra/ npm namespace

* Fix yarn.lock

Co-authored-by: Michael Matloka <dev@twixes.com>
2021-01-05 14:42:19 +01:00
Marius Andra
3fe093f80b
Fix typescript errors #1 (#2027)
* add TSC check, fix tsconfig.json error

* fix toolbar ts errors

* fix the first 100 errors

* fix key bug

* fix some more types

* fix even more types

* webhook setting logic

* fix more logic types

* fix more logic types

* use billingSubscription from action payload
2020-10-27 09:57:06 +01:00
Marius Andra
5729fb5f68
Toolbar Shadow Root Support (#1805)
* reset toolbar fonts (only things that leak through the shadow root)

* select elements from the shadow roots for "inspect"

* extract getParent

* select inside shadow roots for heatmap

* upgrade packages

* remove inline querySelectorDeep

* toolbar shadow dom trim

* improve toolbar no capture of itself

* improve a few things on the actions page

* also support actions

* use non-private query-selector-shadow-dom package
2020-10-07 10:17:28 +02:00
Marius Andra
1254e8ccbd
Remove Toolbar Dock Mode (#1733)
* remove dock code

* set "help" icon

* remove some extra styles, make button fade

* fade component to TS

* clear up a type

* fix fade-induced absolute bug

* make the help button round and blue

* Make rounding more similar and bring back gray

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-09-29 10:29:31 +02:00
Tim Glaser
9dbb5e2134
Revert "WIP: have the element info window follow the mouse (#1472)" (#1542)
This reverts commit b559fee904.
2020-09-01 17:24:23 +02:00
Marius Andra
b559fee904
WIP: have the element info window follow the mouse (#1472) 2020-09-01 15:51:53 +02:00
Marius Andra
be30a464ef
Few toolbar inspect fixes (#1470)
* Fix undefined error

* Reload all click targets when changing the URL

* Write code like it's 2020... after upgrade simmer to a version that return null instead of false
2020-08-20 02:38:56 +02:00
Marius Andra
1b116059b2
Improve heatmap count display (#1459)
* show count for heatmap instead of index, humanize large numbers and have a red hue for the biggest ones

* Improve humanizeNumber readability

* Fix code style

* Fix humanizeNumber

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-08-18 21:47:47 +02:00
Marius Andra
1e261ebabc
Toolbar Heatmap & Inspect improvement (#1424)
* make element selection smarter (fixes several issues from posthog.com), upgrade simmer to version that supports data-attr

* when selecting click tartgets, if tag (e.g. <li>) has only one child (e.g. <a>), go all the way down (before coming back as high up as needed)

* get rect of inner node if it's bigger than click target (e.g. for "a > img")

* trim heatmap elements

* only show elements with `width * height > 0` in inspect

* revert antd to 4.2.0

* upgrade antd, downgrade cypress
2020-08-18 11:13:43 +02:00
Marius Andra
45f10a8eaf
Kea TypeGen 0.2 (#1427)
* kea-typegen 0.2

* remove old Type.ts files

* more setup for typegen-0.2, update yarn scripts, remove webpackbar

* import types from the right paths

* update ENV in build script
2020-08-14 17:02:57 +02:00
Marius Andra
d4291da022
Toolbar Actions Flow (#1320)
* fix TS undefined case (store can be undefined, but it never is... should be typed properly in kea)

* respect userIntent prop when opening the toolbar

* refactor opening the right actions view
2020-08-13 15:53:54 +02:00
Marius Andra
75a12b7bbf
Fix clicks counted multiple times (#1400) 2020-08-11 13:53:33 +02:00
Marius Andra
cf98e8ba35
Toolbar Typings (#1306)
* update to kea-typegen that runs through prettier

* remove posthog-js yalc package regression

* add types to toolbar

* add react-dom and react-redux types

* add types to toolbar react components

* convert a lot of components to typescript

* convert more components to typescript

* fix error

* actions return void

* clean up other Type.ts files as well

* fix last untyped files

* upgrade kea, fix webpack config entrypoint

* add stricter typechecking

* add types for a few more files

* fix bug with nth_child selectors (introduced in this PR, now fixed)

* fix one more type
2020-07-30 19:16:59 +02:00
Marius Andra
f2b8d54ee5
Kea TypeGen 0.0.31 (#1297)
* update to kea-typegen that runs through prettier

* update logic type files

* remove posthog-js yalc package regression

* upgrade to 0.0.32 that fixes error with string literals in defaults

* prettier wants to reformat things
2020-07-29 11:21:00 +02:00
Marius Andra
3f47ad2d0c
Kea TypeGen (#1286)
* update typescript eslint config / fix tsconfig.json path bug

* add kea-typegen and UserType

* kea-typegen first run, add types to userLogic
2020-07-28 22:25:24 +02:00
Marius Andra
8eb43925ab
[WIP] Toolbar Updates Episode 5 - The Editor Strikes Back (#1160)
* don't show action labels in normal inspect mode

* fix draggable windows on touch devices (close button didn't work)

* show "click for details" to guide users in toolbar button mode

* show actions tooltip
2020-07-10 15:22:40 +02:00
Michał Matłoka
93aebb9e7b
Update prettier to 2.0.x (#1143)
* Update prettier devDependency to 2.0.x

* Format with prettier 2.0.5

* Update yarn.lock
2020-07-03 14:37:07 +02:00
Marius Andra
c751085cfd
Toolbar Updates - Episode 4 (A New Hope) (#1125)
* max-height for the floating windows

* authenticate text alignment

* drag only from the main toolbar button

* fix key errors

* support searching by text

* fade above the heatmap

* keep dock on top

* max height for toolbar block

* put all of the "stats" tab in a block that can scroll

* fix heatmap style

* if I can't `position:fixed` this dock, then let's at least make it animate smoothly

* add link to issue to provide feedback during the beta program
2020-07-01 16:05:02 +02:00
Marius Andra
8a9d7f620a
Toolbar Updates - Episode 3 (#1105)
* fix tab alignment

* fix button float color

* default color in float mode

* long press extends the toolbar

* add new logo

* also add logo without text

* add window values plugin

* refactor utils

* support x,y coords in circle

* show toolbar button in new style

* remove float mode

* draging doesn't trigger click

* improve rotation

* improve heatmap number

* position of the close button

* "dock" icons to button

* clarify my choice

* show heatmap in a window

* show heatmap with a border

* use new icons

* open actions tab

* remove unused prop

* move Fade into lib/components

* animate with fire

* fix heatmap icon bug

* don't show X, new stats icon

* heatmap window title

* dock and close also shrink

* flag animation and loading for actions

* dock actions to button when enabled

* actions window

* open actions in button window

* colors for indicators

* close buttons

* inspect X

* add stats view with info

* new icons for close & dock

* add/edit actions in button mode

* color code the different elements in select element view
2020-06-30 12:57:02 +02:00
Marius Andra
3130b967ee
Toolbar: fix gatsby body overflow (#1095)
* fix gatsby body overflow

* make the site work better with the toolbar: set height: 100vh to minHeight: 100vh

* capture all scroll events
2020-06-25 20:53:25 +02:00
Marius Andra
5cd2f07c76
Toolbar Actions (#1033)
* fix scrollbar taking up space in window

* get actions for elements

* show number of elements found

* fix bug with tooltip position

* clean up text and tooltip

* show labels for elements that have actions

* X button orientation + text color

* remove dashboards tab

* extract colors for elements

* hover styles also applied when selected

* form for new action

* improve ux

* section titles

* no tab animation

* show info on actions

* top align in dock mode

* element action flag mouse events

* very rough actions lists

* show action labels only if inspect active

* more ux updates, hide inspect/heatmap when on actions tab

* action new/edit interface

* remove old actions

* toolbar actions form, various ux fixes and refactoring

* tab refactor, keep element open on inspect

* form via kea, more space

* inpsect element for actions

* select the right fields by default

* action select logic

* highlight elements when creating actions

* highlight action elements when in the list

* remove debug

* select action to edit by clicking on heatmap

* save actions in db

* delete actions

* fix some interactivity

* actions list cleanup in element view

* toolbar ux and code cleanup

* float mode max height

* clarify code

* rename StepField

* try to justify the madness

* add shadow back to float toolbar

* add "dock" button to float mode

* remove elements with width=0 & height=0 from inspect

* align current page icon

* make the name of the action required

* hide heatmap/inspect when the toolbar is closed
2020-06-25 11:40:33 +02:00
Marius Andra
aeed457909
Toolbar Heatmap (#974)
* Temporary Hack™ - allow access to the events API via the temporaryToken

* Consolidate small utility functions

* Heatmap [WIP]

* Let the mouse through

* adjust z-index

* no heatmap pointer events when inspecting

* bolder and more interactive toolbar button

* zoom and padding for float mode heatmap

* extend toolbar buttons from the mouse distance, add toggle for heatmap

* animated spinner when showing the heatmap

* add labels to circles

* fix distance bug

* more text shadow

* also highlight inspect element after something has been highlighted

* hover heatmap element

* highlight selected elements

* show metadata for heatmap

* reorder elements

* show inspect element box

* tiny "x" in magnifying glass

* close selected element metadata

* heatmap element click data

* add "add action" stub

* fix element selection logic ux inconsistencies, add esc support

* actionstep display

* move events around

* inspect element rect also via react

* extract element trim logic (path --> svg), add support for cursor:pointer click targets

* keep yellow markers in bounds, fix positions after a delay after scrolling

* get heatmap data from /api/element/stats/

* scale element metadata

* show ranking in metadata

* rename link to clickable

* remove posthog toolbar from clickable list

* move TemporaryTokenAuthentication to utils

* try to bust the cache

* use authentication screen to get temporaryToken, add toolbarLogic to store all props

* use button mode if not authenticated

* more control over animation

* can drag unauthenticated button

* hide heatmap when animating

* no need for cascading props

* call a width a width (radius was incorrect as it should be half that)

* clean toolbarButton code

* add 'userIntent' instead of 'defaultTab' to guide the user in adding an action

* enable heatmap in the float/dock toolbar

* re-request authentication on a 403

* small tweaks to scroll update delay and bust cache again

* double-space-cache-bust

* rotating text for logged out button

* split heatmap elements and labels into separate components

* heatmap with inspect element click targets

* also select all elements with cursor:pointer

* merge "inspectElement" and "heatmap" into "element", remove "inspect anything" mode

* fix element tooltip horizontal position

* escape class names in selector

* leave clues for the next time

* toolbar hello text update

* fix css escape issue on nth queries

* fix color in docusaurus v2 dark mode

* show element info window in sidebar in dock mode

* support ESC

* scrolling and animating won't conflict with each other in dock mode

* close button first unselects

* reverse elements if body is the last one returned

* click to select element in heatmap list

* only show element in toolbar in dock mode

* Order elements by order

* heatmap bottom position min and max heights

* keep window on screen

* remove element hack

* highlight element got stuck

* position heatmap info window better

* Fix tests

* remove selected element when disabling heatmap

* simple auth text

* 3 pixels lower

* center with flexbox

Co-authored-by: Tim Glaser <tim.glaser@hiberly.com>
2020-06-16 14:28:11 +02:00