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: show correct badge count on notebook button #17735

Merged
merged 211 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
96338f8
fix: show correct badge count on notebook button
daibhin Oct 3, 2023
6cb7817
update tests
daibhin Oct 3, 2023
f95d65a
remove final insight reference
daibhin Oct 3, 2023
bb08774
Merge branch 'master' into dn-fix/insight-notebook-badge
daibhin Oct 9, 2023
3076189
cleanup button styling
daibhin Oct 9, 2023
18564d5
Update UI snapshots for `chromium` (2)
github-actions[bot] Oct 9, 2023
ada936a
feat(web-analytics): Fix top pages sql and add some extra insights (#…
robbie-c Oct 9, 2023
e4cb8f9
fix: remove content width toggle from popover (#17775)
daibhin Oct 9, 2023
320786b
fix(batch-exports): Include properties in feature_enabled call (#17860)
tomasfarias Oct 9, 2023
07b4447
chore: set Sentry release using commit.txt (#17855)
bretthoerner Oct 9, 2023
06ba7e3
chore: Remove promise manager usage from ingestion warnings & db (#17…
tiina303 Oct 9, 2023
aed7ff6
fixes "CSV export is limited to 10000 events" menu is hidden behind e…
ahsan722505 Oct 9, 2023
3f9cdf9
feat: onboarding, remove product intro, fix navigation (#17858)
raquelmsmith Oct 9, 2023
b33cd39
feat: sidebar widgets (#17859)
daibhin Oct 9, 2023
2631f29
chore(plugin-server): kafka: change analytics linger.ms and batch.siz…
bretthoerner Oct 9, 2023
98f0b9f
feat(surveys): optional questions for multipleq (#17830)
liyiy Oct 10, 2023
d04774b
chore(deps): Update posthog-js to 1.83.0 (#17871)
posthog-bot Oct 10, 2023
874b2da
feat(surveys): Add question html support (#17847)
neilkakkar Oct 10, 2023
1a0e5b6
test: Increase playwright timeouts (#17872)
robbie-c Oct 10, 2023
04704d6
fix(celery): celery compatibility with importlib (#17874)
thmsobrmlr Oct 10, 2023
7bfd2d3
fix(insights): do not remove empty series from converted queries (#17…
thmsobrmlr Oct 10, 2023
b9a25a2
feat: Person node changes (#17880)
benjackwhite Oct 10, 2023
099aa84
chore: Remove runner abstraction from onEvent (#17683)
tiina303 Oct 10, 2023
ad72cb5
fix: update slack description (#17884)
MarconLP Oct 10, 2023
2537bd3
feat: Reworked Playlist UI with Notebook support (#17802)
benjackwhite Oct 10, 2023
3c88ef0
feat: clarify experiments usage in FFs onboarding (#17870)
raquelmsmith Oct 10, 2023
5c0c1a6
chore(plugin-server): run node-rdkafka with cooperative rebalancing p…
bretthoerner Oct 10, 2023
236ccc1
fix(insights): loading in saved insights card view (#17875)
mariusandra Oct 10, 2023
10f6a83
chore(invites): Clarify expiration message (#17862)
Twixes Oct 10, 2023
dcfd9c3
fix: disable link button until full href (#17889)
daibhin Oct 10, 2023
5100791
fix: remove gap cursor (#17888)
daibhin Oct 10, 2023
82d2e81
chore(plugin-server): trigger ingestion deploy (#17900)
bretthoerner Oct 10, 2023
fa2a7eb
feat: Set keepalive to 60 on gunicorn (#17897)
frankh Oct 11, 2023
2b6e72c
feat: Easier selecting of next line after node (#17883)
benjackwhite Oct 11, 2023
a0c8229
chore: launch celery by module in pycharm (#17901)
pauldambra Oct 11, 2023
198011a
perf: Reworked types and rendering to try and reduce needless renders…
benjackwhite Oct 11, 2023
1da9e8b
chore: remove title expand toggle (#17887)
daibhin Oct 11, 2023
d327937
feat(surveys): add Rating question results viz (#17886)
jurajmajerik Oct 11, 2023
2f82349
feat(3000): Added link specific styles (#17867)
benjackwhite Oct 11, 2023
69446ff
fix: Notebook colors and start position (#17907)
benjackwhite Oct 11, 2023
7483622
fix: Insight tooltip overscrolling issue (#17906)
benjackwhite Oct 11, 2023
de45d21
fix(dev): do not sync the cloud announcement flag (#17911)
thmsobrmlr Oct 11, 2023
ef90e1d
chore(decide): Add missing span instrumentation (#17910)
neilkakkar Oct 11, 2023
f5ed7e8
chore: skip flaky test in session-recordings-consumer-v2.test.ts (#17…
tiina303 Oct 11, 2023
5172cf2
chore: Update install script (#17851)
benjackwhite Oct 11, 2023
aa2c838
fix(types): fix value inspector button warning (#17876)
thmsobrmlr Oct 11, 2023
dbb09fd
chore(dev): Allow generating demo data for existing projects (#17913)
Twixes Oct 11, 2023
abb5b59
fix(autocapture): add taxonomic filter key as data-attr (#17899)
thmsobrmlr Oct 11, 2023
d8b7c32
fix: account for negative timestamps from rrweb (#17849)
daibhin Oct 11, 2023
06cb45b
chore: yeet CH recordings ingestion (#17572)
pauldambra Oct 11, 2023
45841c1
feat: Add env var to skip migration checks (#17915)
frankh Oct 11, 2023
8ca7080
feat(hogql): events query runner (#17892)
mariusandra Oct 11, 2023
868d7b0
chore(plugin-server): use existing INGESTION_BATCH_SIZE and KAFKA_CON…
bretthoerner Oct 11, 2023
006b86e
chore: Remove stale feature flags (#17925)
neilkakkar Oct 11, 2023
c7cfb6d
fix: Editor initial content (#17912)
benjackwhite Oct 11, 2023
b2bb86d
feat: persons & events settings in notebooks (#17866)
daibhin Oct 11, 2023
b16d481
chore: Remove org-wide retro from sprint planning (#17928)
timgl Oct 11, 2023
733b17d
fix: throw error so test failures are not swallowed (#17926)
pauldambra Oct 11, 2023
fc27f3b
fix: Additional parsing of incoming messages (#17937)
benjackwhite Oct 12, 2023
66c7e1a
chore: Remove v2 suffix for replay consumer (#17938)
benjackwhite Oct 12, 2023
a7243f2
fix: Notebook select matching (#17916)
daibhin Oct 23, 2023
6d2339a
feat(css): Add tailwind size breakpoints (#17918)
robbie-c Oct 12, 2023
766b248
feat: Respect resize of DataTable in Notebook (#17929)
benjackwhite Oct 12, 2023
a4e3443
feat(hogql): query debugger (#17939)
mariusandra Oct 12, 2023
ab99298
chore(plugins-server): remove eachBatchLegacyIngestion (#17894)
xvello Oct 12, 2023
c5ed2a4
fix: Check for the event generally being truthy (#17942)
benjackwhite Oct 12, 2023
d112f26
feat: Added notebooks to sidebar (#17919)
benjackwhite Oct 12, 2023
dd7fa40
fix(hogql): quick fix for events query index (#17941)
mariusandra Oct 12, 2023
80b2ec6
chore: twiddle with logging (#17944)
pauldambra Oct 12, 2023
7e054c9
fix: e2e testing posthog capture (#17940)
pauldambra Oct 12, 2023
31727bc
feat(surveys): Single Choice question results (#17923)
jurajmajerik Oct 12, 2023
35ce77f
chore: update wait-on-action (#17945)
pauldambra Oct 12, 2023
1daaf21
chore(plugin-server): add labels to merge txn metrics (#17934)
bretthoerner Oct 12, 2023
91db93c
feat: Add django command for geoip (#17947)
robbie-c Oct 12, 2023
cc1f1cc
fix: early access management cancel button (#17857)
kiran-4444 Oct 12, 2023
855e11d
feat: Allow pausing whilst buffering (#17951)
benjackwhite Oct 12, 2023
8d00bf1
fix: Performance issue with player logs (#17948)
benjackwhite Oct 12, 2023
96a486a
fix(flags): Fix spinner on new feature flag (#17953)
neilkakkar Oct 12, 2023
45fc509
feat: Added lazy joins for groups on events (#17950)
Gilbert09 Oct 12, 2023
ed5f9cf
feat: Notebook feedback changes (#17952)
benjackwhite Oct 12, 2023
c283d09
fix(insights): Move GF, GP and YT to top level on the world map (#17949)
daibhin Oct 23, 2023
53c9916
feat(web-analytics): Add web analytics filters - Part 2 (#17878)
robbie-c Oct 12, 2023
299b4d8
chore: deflake a test (#17956)
pauldambra Oct 12, 2023
5fd89fb
feat: Added not found helper for notebooks (#17957)
benjackwhite Oct 13, 2023
6d86ae8
fix: margin finness & insertion suggestion height (#17955)
daibhin Oct 13, 2023
3fdb045
fix(design): remove background from action filter (#17964)
thmsobrmlr Oct 13, 2023
3954715
feat(hogql): query modifiers (#17946)
mariusandra Oct 13, 2023
7d07ab8
fix: ensure we dont overwrite events fields with group mappings (#17965)
Gilbert09 Oct 13, 2023
7bc578b
feat(web-analytics): Fix source query views and uniques - remove blen…
robbie-c Oct 13, 2023
b7fe802
feat: Add basic Group / cohort Notebok nodes (#17962)
benjackwhite Oct 13, 2023
e28a1b4
feat(surveys): Add cypress e2e tests (#17920)
neilkakkar Oct 13, 2023
a138a8c
feat: Node title placeholders with custom title (#17966)
benjackwhite Oct 13, 2023
c6173d4
feat(database): faster queries from the persons table (#17811)
mariusandra Oct 13, 2023
49a2e02
chore: send reports closer to midnight (#17960)
raquelmsmith Oct 13, 2023
8f71710
perf: Parse HogQL with C++ for a huge speedup (#17659)
Twixes Oct 13, 2023
6dbe7af
feat: Added the first iteration of trend insghts breakdowns (#17891)
Gilbert09 Oct 13, 2023
7e2fd45
feat(hogql): debugger split view (#17970)
mariusandra Oct 13, 2023
4794016
chore: add timings measure for breakdown values query (#17974)
Gilbert09 Oct 13, 2023
cdcb114
chore: update copy to reflect popover over pinning (#17971)
daibhin Oct 13, 2023
0438640
feat(hogql): intelligent argmax on persons table (#17975)
mariusandra Oct 13, 2023
a53d8eb
chore(plugin-server): move runner process.env calculations to Hub (#1…
bretthoerner Oct 13, 2023
74991e5
chore: Update capabilities.test.ts (#17465)
tiina303 Oct 13, 2023
c9064d4
feat(surveys): Multiple Choice question results (#17954)
jurajmajerik Oct 16, 2023
ed641a3
feat(hogql): edit SQL directly where possible (#17905)
mariusandra Oct 16, 2023
95bec32
style(3000): Use new Central icons (#16463)
Twixes Oct 16, 2023
d633ff1
chore: update snapshots for optimise aggregation setting (#17990)
pauldambra Oct 16, 2023
f3c598a
feat(temporal-worker): Add steps to trigger deployment (#17881)
tomasfarias Oct 16, 2023
de57c16
chore(batch-exports): Minor model docstring updates (#17993)
tomasfarias Oct 16, 2023
9d36e03
refactor(insights): remove query from editor filter props (#17963)
thmsobrmlr Oct 16, 2023
83a130b
fix: don't process subscriptions with no assets (#17988)
pauldambra Oct 16, 2023
d375690
refactor(insight): simplify insightVizDataLogic update actions (#17972)
thmsobrmlr Oct 16, 2023
402d3b6
fix: console log fiddling (#17996)
pauldambra Oct 16, 2023
a7692e1
feat(surveys): Improved survey creation flow (#17902)
smallbrownbike Oct 16, 2023
51559eb
feat: add and handle never drop data field (#17978)
raquelmsmith Oct 16, 2023
6f461e3
fix: Nextjs onboarding snippets (#17979)
ivanagas Oct 16, 2023
bc5dab3
chore(plugin-server): remove INGESTION_DELAY_WRITE_ACKS and workerMet…
bretthoerner Oct 16, 2023
cb06116
feat(hogql-debug): add explain (#17998)
mariusandra Oct 16, 2023
93aa220
feat: Move plugin options out of drawer + uninstall safety (#17980)
tiina303 Oct 16, 2023
b40ec18
chore(plugin-server): remove some unused piscina references (#18012)
bretthoerner Oct 16, 2023
f0d7838
feat: dedupe console logs (#18009)
pauldambra Oct 16, 2023
50fe0a4
chore(deps): Update posthog-js to 1.83.1 (#18014)
posthog-bot Oct 16, 2023
4adb958
feat(surveys): templates (#17904)
liyiy Oct 16, 2023
6ebbc34
chore: really capture console log search errors to Sentry (#18015)
pauldambra Oct 16, 2023
a2d71f5
chore(surveys): report template clicked (#18017)
liyiy Oct 16, 2023
933f61f
fix: console log query (#18021)
pauldambra Oct 17, 2023
daeab9a
feat(plugin-server): allow to configure the rdkafka producer queue si…
pauldambra Oct 17, 2023
ded024c
feat: open settings when query inserted (#17969)
daibhin Oct 17, 2023
d919370
fix: text formatting icons in inline menu & slash commands (#17958)
daibhin Oct 17, 2023
fa02095
fix: popover edits out of sync (#18006)
daibhin Oct 17, 2023
786d748
feat: Create Notebook from dashboard (#17968)
benjackwhite Oct 17, 2023
f6123c2
feat: Separate out apps management tab (#18013)
tiina303 Oct 17, 2023
edb1077
chore: Update plugin-scaffold to latest (#17930)
tiina303 Oct 17, 2023
d6d0d29
feat(web-analytics): Add web analytics tabs (#17981)
robbie-c Oct 17, 2023
28cc0ad
Fix/overlap taxonomic filter popup with scroll (#17987)
pausan Oct 17, 2023
6a6f161
fix: fixed missing param when building Breakdown (#17991)
Gilbert09 Oct 17, 2023
2d13821
feat: HogQL trends breakdown by hogql expressions (#17992)
Gilbert09 Oct 17, 2023
fc00c10
fix: Make rating start at 0 for surveys (#18011)
neilkakkar Oct 17, 2023
c7082f9
chore: Make pluginConfigs be keyed over config id not plugin id (#17999)
tiina303 Oct 17, 2023
598b0c5
perf(hogql): Fix C++ parser leaks (#18022)
Twixes Oct 17, 2023
8dbc978
chore(deps): Update posthog-js to 1.83.2 (#18033)
posthog-bot Oct 17, 2023
7bff220
fix(surveys): clean up survey edit code (#18010)
liyiy Oct 17, 2023
c1478f7
feat(surveys): Implement Open Text visualization (#18016)
jurajmajerik Oct 17, 2023
33fc371
fix(surveys): fix survey template (#18034)
liyiy Oct 17, 2023
e103aed
feat: added trends breakdown by cohort (#18028)
Gilbert09 Oct 17, 2023
3c2d7c2
revert "chore: Make pluginConfigs be keyed over config id not plugin …
tiina303 Oct 17, 2023
a2b2e8e
feat: show only login options if account exists when accepting an inv…
Oct 17, 2023
c6804f7
fix: tiers show incorrect volumes if denominator differs (#18041)
raquelmsmith Oct 17, 2023
78cc85f
fix: react env var name inconsistency (#18044)
raquelmsmith Oct 17, 2023
9d240e8
fix(surveys): see multiple question surveys in overview (#18048)
liyiy Oct 17, 2023
87020e7
fix(deps): Update @posthog/icons to fix React peer dependency (#18043)
Twixes Oct 17, 2023
73c23d0
feat: show CTA for annual plan if over $1k/mo (#18049)
raquelmsmith Oct 17, 2023
b535d3e
fix(hogql): Fix boolean is not set (#18040)
robbie-c Oct 18, 2023
1200be8
fix(queries): export limit (#18046)
mariusandra Oct 18, 2023
6d98aa4
feat(insights): edit as sql (#18055)
daibhin Oct 23, 2023
0607951
feat(hogql): use join for "in cohort" operations instead of subquery …
mariusandra Oct 18, 2023
bd12ca4
feat: move buttons higher (#18039)
pauldambra Oct 18, 2023
a6b32cb
chore: Remove install button from apps view (#18038)
tiina303 Oct 18, 2023
957933d
feat: added session duration as a breakdown option (#18056)
Gilbert09 Oct 18, 2023
969a16d
chore(deps): Update posthog-js to 1.83.3 (#18035)
posthog-bot Oct 18, 2023
f392115
fix(surveys): Add html descriptions for thank you (#18036)
neilkakkar Oct 18, 2023
7c29ec8
feat(queries): persons query source (#18060)
mariusandra Oct 18, 2023
5703cb3
feat(web-analytics): Basic adding of date ranges to the web dashboard…
robbie-c Oct 18, 2023
2cddb46
chore(surveys): add surveys opt in to onboarding ingestion (#18045)
liyiy Oct 18, 2023
e44639d
fix(surveys): bypass HogQL coercion + UI fixes (#18063)
jurajmajerik Oct 18, 2023
159d94d
chore(storybook): run a few times ¯\_(ツ)_/¯ (#18066)
mariusandra Oct 18, 2023
9033116
chore(deps): Update posthog-js to 1.84.0 (#18069)
posthog-bot Oct 18, 2023
1fea2c3
fix(surveys): Some UI/UX issues (#18070)
neilkakkar Oct 18, 2023
9d5d3b6
feat: surveys onboarding (#18053)
raquelmsmith Oct 18, 2023
cfdb512
fix(surveys): check result exists (#18082)
jurajmajerik Oct 19, 2023
a550a82
fix(decide): Don't create exceptions for survey targeting flags (#18062)
neilkakkar Oct 19, 2023
5e9df5b
chore(insights): Making schema conversion from schema.ts to schema.py…
robbie-c Oct 19, 2023
20a42c4
feat(hogql): Added unit tests for the new trends query runner (#17730)
Gilbert09 Oct 19, 2023
360957f
feat(batch-exports): Add backfill workflow (#17909)
tomasfarias Oct 19, 2023
2a4bd69
feat(hogql): basic pretty print (#18086)
mariusandra Oct 19, 2023
d968fcf
fix(plugin-server): wrap a few ingestion/consumer calls in simple ret…
bretthoerner Oct 19, 2023
340d9ff
fix(version-checker): Use latest semantic version (#18085)
neilkakkar Oct 19, 2023
cec778e
fix(plugin-server): clarify var name in retryIfRetriable (#18093)
bretthoerner Oct 19, 2023
7bc36c5
fix: redirect to correct view for surveys (#18081)
raquelmsmith Oct 19, 2023
83df6bc
fix(batch-exports-backfill): Instantiate tuple when resuming from hea…
tomasfarias Oct 19, 2023
5cd17c6
chore(deps): Update posthog-js to 1.84.1 (#18096)
posthog-bot Oct 19, 2023
022e0bf
fix(plugin-server): consumer loop throwing trigger a shutdown (#18073)
bretthoerner Oct 19, 2023
9d19747
chore(batch-exports): Do not retry on forbidden (#18091)
tomasfarias Oct 19, 2023
6221de3
feat: allow placeholders in place of ratio expressions in hogql (#17973)
Gilbert09 Oct 19, 2023
2f438e4
chore(p-s): add logs around setupPlugins (#18099)
xvello Oct 19, 2023
02f3921
chore(plugin-server): log timing per rdkafka batch loop rather than b…
bretthoerner Oct 19, 2023
73dc7a1
fix(batch-exports): Only read person properties for S3 (#18095)
tomasfarias Oct 19, 2023
38b0065
fix(plugin-server): log EPS every 10 seconds, only log individual bat…
bretthoerner Oct 19, 2023
956da86
feat(surveys): add responses to the events table + fixes (#18088)
jurajmajerik Oct 19, 2023
2afad9f
feat(billing): add menu option for reducing bill info (#18050)
raquelmsmith Oct 19, 2023
6c95f47
fix: support minimal top bar for onboarding screens (#18077)
raquelmsmith Oct 19, 2023
472d814
fix(backfill-batch-exports): Do not run partial ranges (#18114)
tomasfarias Oct 19, 2023
abd23e5
feat(hogql): mixed PoE mode (#18064)
mariusandra Oct 20, 2023
9dcdcda
fix: update person recordings default date range (#18115)
pauldambra Oct 20, 2023
6f49da9
chore(batch-exports): Do not retry on RefreshError and NotFound (#18107)
tomasfarias Oct 20, 2023
a44fbd2
chore(hogql): Use the C++ parser in local dev (#18112)
Twixes Oct 20, 2023
496d492
chore(deps): upgrade storybook to 7.5 (#18113)
thmsobrmlr Oct 20, 2023
9f6a676
fix(plugin-server): jitter and retry reloadPlugins (#18108)
bretthoerner Oct 20, 2023
7bebb03
fix(plugin-server): filter NaN out of buildIntegerMatcher (#18106)
bretthoerner Oct 20, 2023
89292f2
feat: added support for daily and weekly active user aggregations (#1…
Gilbert09 Oct 20, 2023
477e64e
feat(insights): Add dashboard filters to hogql insights (#18076)
robbie-c Oct 20, 2023
338dad7
feat(web-analytics): Add localised number formatting and right-aligne…
robbie-c Oct 20, 2023
d722e8e
fix(plugin-server): prevent multiple concurrent reloadPlugins and coa…
bretthoerner Oct 20, 2023
4cbd622
fix(backfill-batch-exports): Account for jitter (#18121)
tomasfarias Oct 20, 2023
25a516a
feat(surveys): auto opt in and out surveys for users (#18080)
liyiy Oct 20, 2023
0e51d49
feat(surveys): gate premium features (#18094)
liyiy Oct 20, 2023
32a3001
fix(survey): fix question type placement and add open feedback templa…
liyiy Oct 20, 2023
251fd3d
chore(deps): Update posthog-js to 1.84.2 (#18130)
posthog-bot Oct 23, 2023
3e493e4
ci(hogql): Don't run parser build workflow on forks (#18018)
rishabnayak Oct 23, 2023
e10fbd3
chore(deps-dev): bump postcss from 8.4.18 to 8.4.31 (#17767)
dependabot[bot] Oct 23, 2023
3daf5de
Merge branch 'master' into dn-fix/insight-notebook-badge
daibhin Oct 23, 2023
abf2010
Update UI snapshots for `chromium` (2)
github-actions[bot] Oct 23, 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
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.
4 changes: 1 addition & 3 deletions frontend/src/scenes/insights/InsightPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,8 @@ export function InsightPageHeader({ insightLogicProps }: { insightLogicProps: In
<>
<NotebookSelectButton
resource={{
attrs: {
query: { kind: NodeKind.SavedInsightNode, shortId: insight.short_id },
},
type: NotebookNodeType.Query,
attrs: { id: insight.short_id },
}}
type="secondary"
/>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/scenes/notebooks/Notebook/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export const textContent = (node: any): string => {
'ph-feature-flag': customOrTitleSerializer,
'ph-feature-flag-code-example': customOrTitleSerializer,
'ph-image': customOrTitleSerializer,
'ph-insight': customOrTitleSerializer,
'ph-person': customOrTitleSerializer,
'ph-query': customOrTitleSerializer,
'ph-recording': customOrTitleSerializer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export function NotebookSelectList(props: NotebookSelectProps): JSX.Element {
}, [])

return (
<div className="space-y-2 flex flex-col flex-1 h-full overflow-hidden">
<div className="border-b space-y-2 flex-0">
<div className="flex flex-col flex-1 h-full overflow-hidden">
<div className="space-y-2 flex-0">
<LemonInput
type="search"
placeholder="Search notebooks..."
Expand All @@ -131,6 +131,7 @@ export function NotebookSelectList(props: NotebookSelectProps): JSX.Element {
New notebook
</LemonButton>
</div>
<LemonDivider />
<div className="overflow-y-auto flex-1">
{notebooksLoading && !notebooksNotContainingResource.length && !notebooksContainingResource.length ? (
<div className={'px-2 py-1 flex flex-row items-center space-x-1'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export const fromNodeTypeToLabel: Omit<Record<NotebookNodeType, string>, Noteboo
[NotebookNodeType.EarlyAccessFeature]: 'Early Access Features',
[NotebookNodeType.Survey]: 'Surveys',
[NotebookNodeType.Image]: 'Images',
[NotebookNodeType.Insight]: 'Insights',
[NotebookNodeType.Person]: 'Persons',
[NotebookNodeType.Query]: 'Queries',
[NotebookNodeType.Recording]: 'Session recordings',
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3062,7 +3062,6 @@ export type NotebookType = NotebookListItemType & {
}

export enum NotebookNodeType {
Insight = 'ph-insight',
Query = 'ph-query',
Recording = 'ph-recording',
RecordingPlaylist = 'ph-recording-playlist',
Expand Down
2 changes: 2 additions & 0 deletions posthog/api/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def _filter_request(self, request: request.Request, queryset: QuerySet) -> Query
# replay timestamps are not at the top level, they're one-level down in a content array
presence_match_structure = [{"content": [{"type": f"ph-{target}"}]}]
id_match_structure = [{"content": [{"attrs": {"sessionRecordingId": match}}]}]
elif target == "query":
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 So we are making query only work for a specific Insight? This feels very off...

If this is the way to go then I think the "target" should explicitly be saved-insight or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding was that this is just for cases in which there is an id present e.g. when the search query looks like query:vk7xz3 where the content after the colon is the short id of the saved insight. You could still search notebooks that contain / do not contain queries with the search param query:true or query:false.

The only reason we special case this lookup is because the NotebookNodeQuery does not have an id attribute which the search endpoint assumes. Its id is nested inside the query attribute.

Does that explain your question?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pauldambra am I right in thinking that this will still allow you to search for the presence of a query with the query:true param?

Copy link
Member

Choose a reason for hiding this comment

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

so long as this test is still valid

        # filter by insight
        insight_filter_response = self.client.get(f"/api/projects/{self.team.id}/notebooks?contains=query:true")
        assert [n["id"] for n in insight_filter_response.json()["results"]] == [insight_content_notebook]

then yep we can filter by presence of "type" and presence of an instance of a "type"

id_match_structure = [{"attrs": {"query": {"kind": "SavedInsightNode", "shortId": match}}}]

if match == "true" or match is None:
queryset = queryset.filter(content__content__contains=presence_match_structure)
Expand Down
27 changes: 15 additions & 12 deletions posthog/api/test/notebooks/test_notebook_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@
],
}

INSIGHT_COMMENT = lambda id: {
"type": "ph-insight",
QUERY_CONTENT = lambda id: {
"type": "ph-query",
"attrs": {
"id": id or "insight_short_id",
"query": {
"kind": "SavedInsightNode",
"shortId": id or "insight_short_id",
}
},
}

Expand Down Expand Up @@ -133,7 +136,7 @@ def test_filters_based_on_params(self) -> None:

def test_filtering_by_types(self) -> None:
playlist_content_notebook = self._create_notebook_with_content([PLAYLIST_CONTENT()])
insight_content_notebook = self._create_notebook_with_content([INSIGHT_COMMENT("insight_id")])
insight_content_notebook = self._create_notebook_with_content([QUERY_CONTENT("insight_id")])
feature_flag_content_notebook = self._create_notebook_with_content([FEATURE_FLAG_CONTENT(1)])
person_content_notebook = self._create_notebook_with_content([PERSON_CONTENT("person_id")])
recording_comment_notebook = self._create_notebook_with_content(
Expand All @@ -146,7 +149,7 @@ def test_filtering_by_types(self) -> None:
assert len(no_filter_response.json()["results"]) == 6

# filter by insight
insight_filter_response = self.client.get(f"/api/projects/{self.team.id}/notebooks?contains=insight:true")
insight_filter_response = self.client.get(f"/api/projects/{self.team.id}/notebooks?contains=query:true")
assert [n["id"] for n in insight_filter_response.json()["results"]] == [insight_content_notebook]

# filter by playlist
Expand Down Expand Up @@ -177,7 +180,7 @@ def test_filtering_by_types(self) -> None:

def test_filtering_by_abscence_of_types(self) -> None:
playlist_content_notebook = self._create_notebook_with_content([PLAYLIST_CONTENT()])
insight_content_notebook = self._create_notebook_with_content([INSIGHT_COMMENT("insight_id")])
insight_content_notebook = self._create_notebook_with_content([QUERY_CONTENT("insight_id")])
feature_flag_content_notebook = self._create_notebook_with_content([FEATURE_FLAG_CONTENT(1)])
person_content_notebook = self._create_notebook_with_content([PERSON_CONTENT("person_id")])
recording_comment_notebook = self._create_notebook_with_content(
Expand All @@ -190,7 +193,7 @@ def test_filtering_by_abscence_of_types(self) -> None:
assert len(no_filter_response.json()["results"]) == 6

# filter by insight
insight_filter_response = self.client.get(f"/api/projects/{self.team.id}/notebooks?contains=insight:false")
insight_filter_response = self.client.get(f"/api/projects/{self.team.id}/notebooks?contains=query:false")
assert sorted([n["id"] for n in insight_filter_response.json()["results"]]) == sorted(
[
playlist_content_notebook,
Expand Down Expand Up @@ -267,9 +270,9 @@ def test_filtering_by_abscence_of_types(self) -> None:
]
)

@parameterized.expand([["insight"], ["insights"]])
@parameterized.expand([["query"], ["queries"]])
def test_filtering_by_just_the_target_name_is_truthy(self, target_name: str) -> None:
insight_content_notebook_one = self._create_notebook_with_content([INSIGHT_COMMENT("insight_id_one")])
insight_content_notebook_one = self._create_notebook_with_content([QUERY_CONTENT("insight_id_one")])
_feature_flag_content_notebook_one = self._create_notebook_with_content([FEATURE_FLAG_CONTENT(1)])
filter_response = self.client.get(f"/api/projects/{self.team.id}/notebooks?contains={target_name}")
assert sorted([n["id"] for n in filter_response.json()["results"]]) == sorted(
Expand All @@ -281,8 +284,8 @@ def test_filtering_by_just_the_target_name_is_truthy(self, target_name: str) ->
def test_filtering_by_id_of_types(self) -> None:
self._create_notebook_with_content([PLAYLIST_CONTENT()])

insight_content_notebook_one = self._create_notebook_with_content([INSIGHT_COMMENT("insight_id_one")])
_insight_content_notebook_two = self._create_notebook_with_content([INSIGHT_COMMENT("insight_id_two")])
insight_content_notebook_one = self._create_notebook_with_content([QUERY_CONTENT("insight_id_one")])
_insight_content_notebook_two = self._create_notebook_with_content([QUERY_CONTENT("insight_id_two")])

feature_flag_content_notebook_one = self._create_notebook_with_content([FEATURE_FLAG_CONTENT(1)])
_feature_flag_content_notebook_two = self._create_notebook_with_content([FEATURE_FLAG_CONTENT(2)])
Expand Down Expand Up @@ -310,7 +313,7 @@ def test_filtering_by_id_of_types(self) -> None:

# filter by insight
insight_filter_response = self.client.get(
f"/api/projects/{self.team.id}/notebooks?contains=insight:insight_id_one"
f"/api/projects/{self.team.id}/notebooks?contains=query:insight_id_one"
)
assert sorted([n["id"] for n in insight_filter_response.json()["results"]]) == sorted(
[
Expand Down
Loading