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

feat: Toolbar 3000 changes #18671

Merged
merged 30 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6caaea9
Modified buttons to be custom
benjackwhite Nov 16, 2023
6c78a49
More changes
benjackwhite Nov 16, 2023
1256e1e
Fixes
benjackwhite Nov 16, 2023
59129b9
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 16, 2023
b651341
Added our own dragging logic
benjackwhite Nov 16, 2023
e7647f4
Merge branch 'feat/toolbar-3000-changes' of github.com:PostHog/postho…
benjackwhite Nov 16, 2023
1474335
Bunch of changes
benjackwhite Nov 16, 2023
cd13456
Fixes for hedgehog
benjackwhite Nov 16, 2023
cd7408d
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 16, 2023
6f22c69
Fixed up hedgehog actor
benjackwhite Nov 16, 2023
d01dcca
Merge branch 'feat/toolbar-3000-changes' of github.com:PostHog/postho…
benjackwhite Nov 16, 2023
c57f991
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 16, 2023
26e5f6c
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 16, 2023
77543e6
Fixes
benjackwhite Nov 16, 2023
f08440f
Fix
benjackwhite Nov 16, 2023
108e012
Fixed up toolbar rendering
benjackwhite Nov 17, 2023
113a0b1
fixes
benjackwhite Nov 17, 2023
964bea1
Fixes
benjackwhite Nov 17, 2023
4e90d2a
Fix dragging state
benjackwhite Nov 17, 2023
27cfd50
Fix padding
benjackwhite Nov 17, 2023
b9d3642
Merge branch 'feat/toolbar-3000' into feat/toolbar-3000-changes
benjackwhite Nov 17, 2023
0798bf4
Fix
benjackwhite Nov 17, 2023
1cbedf5
Tidying
benjackwhite Nov 20, 2023
a5952c3
Fixes to styles and stories
benjackwhite Nov 20, 2023
a85f9d6
Fix flashing issue
benjackwhite Nov 20, 2023
6d2f7b0
Fixed button for dragging rules
benjackwhite Nov 20, 2023
06b8d97
Fix
benjackwhite Nov 20, 2023
7084782
Fix
benjackwhite Nov 20, 2023
1b5862c
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 20, 2023
d9f7fbc
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 20, 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
2 changes: 1 addition & 1 deletion cypress/e2e/toolbar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Toolbar', () => {
.then((href) => {
cy.visit(href)
})
cy.get('#__POSTHOG_TOOLBAR__').shadow().find('.floating-toolbar-button').should('exist')
cy.get('#__POSTHOG_TOOLBAR__').shadow().find('.Toolbar3000').should('exist')
})
})

Expand Down
Copy link
Member

Choose a reason for hiding this comment

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

┻┳|
┻┳|
┳┻|
┳┻|
┻┳|
┻┳|
┳┻|
┳┻|
┻┳|
┳┻|
┻┳|
┳┻| _
┻┳| •.•) [I'm hiding off-screen]
┳┻|⊂ノ
┻┳|

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed these!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions frontend/src/layout/navigation-3000/themeLogic.ts
benjackwhite marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { actions, events, kea, path, reducers, selectors } from 'kea'
import { actions, connect, events, kea, path, reducers, selectors } from 'kea'
import { subscriptions } from 'kea-subscriptions'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
Expand All @@ -8,6 +8,9 @@ import { sceneLogic } from 'scenes/sceneLogic'

export const themeLogic = kea<themeLogicType>([
path(['layout', 'navigation-3000', 'themeLogic']),
connect({
values: [featureFlagLogic, ['featureFlags']],
}),
actions({
toggleTheme: true,
overrideTheme: (darkModePreference: boolean) => ({ darkModePreference }),
Expand Down Expand Up @@ -36,7 +39,7 @@ export const themeLogic = kea<themeLogicType>([
(s) => [
s.darkModeSavedPreference,
s.darkModeSystemPreference,
featureFlagLogic.selectors.featureFlags,
s.featureFlags,
sceneLogic.selectors.sceneConfig,
],
(darkModeSavedPreference, darkModeSystemPreference, featureFlags, sceneConfig) => {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ export class HedgehogActor {
<div
className="HedgehogBuddy"
data-content={preloadContent}
onMouseDown={() => {
onMouseDown={(e) => {
if (e.button !== 0) {
return
}
let moved = false
const onMouseMove = (e: any): void => {
moved = true
Expand Down
306 changes: 0 additions & 306 deletions frontend/src/toolbar/3000/Toolbar3000.tsx

This file was deleted.

20 changes: 16 additions & 4 deletions frontend/src/toolbar/ToolbarContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
import { useValues } from 'kea'
import { Elements } from '~/toolbar/elements/Elements'
import { DraggableButton } from '~/toolbar/button/DraggableButton'
import { toolbarLogic } from '~/toolbar/toolbarLogic'
import { toolbarLogic } from './toolbarLogic'
import { Elements } from './elements/Elements'
import { Fade } from 'lib/components/Fade/Fade'
import { toolbarButtonLogic } from './button/toolbarButtonLogic'
import { HedgehogButton } from './button/HedgehogButton'
import { Toolbar3000 } from './button/Toolbar3000'

export function ToolbarContainer(): JSX.Element {
const { buttonVisible } = useValues(toolbarLogic)
const { theme } = useValues(toolbarButtonLogic)

// KLUDGE: if we put theme directly on the div then
// linting and typescript complain about it not being
// a valid attribute. So we put it in a variable and
// spread it in. 🤷‍
const themeProps = { theme }

return (
<Fade visible={buttonVisible} className="toolbar-global-fade-container ph-no-capture posthog-3000">
<Elements />
<DraggableButton />
<div id="button-toolbar" className="ph-no-capture posthog-3000" {...themeProps}>
<Toolbar3000 />
</div>
<HedgehogButton />
</Fade>
)
}
Loading
Loading