-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
27559ae
to
f95d65a
Compare
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
frontend/src/scenes/notebooks/NotebookSelectButton/NotebookSelectButton.tsx
Outdated
Show resolved
Hide resolved
@@ -281,6 +281,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": |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"
b239c96
to
bb08774
Compare
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
…17850) * Fix top pages SQL * Use person id for now * Add limits to web analytics queries * Add some trends to web analytics * Tweak query date ranges and formatting * Consistently use person_id for now
* move onstart to products page * remove product intro * include stepkey as prop * redo how navigation works * go back to products if first step * fix url redirect loop * fix jitteryness with otherproductsstep * fix grumpy linting
#17820) * chore(plugin-server): kafka: change analytics linger.ms and batch.size for all producers * add envvars
* Increase playwright timeouts * Tidy up comments
add menu option for reducing bill info
* feat(hogql): mixed poe mode * schema
* chore(hogql): Use the C++ parser in local dev * Update all the parsing functions, not just `parse_select`
…8101) * Added support for daily and weekly active user aggregations * Removed unused join * Fixed tests and applied Sample placeholders * Fixed formula running on an empty string * Updated the name of QueryModifier * Comments and fixed name casing
* WIP * Kinda sorta working * Add dashboard filters to cache key * Make mypy happy * Add support for properties * Use get_query_runner * Add tests for dashboard_query * Add tests for merging of filters * Add test for hash when dashboard filters are applied * Silently accept having no valid query runner * Remove index type from DashboardFilter * Fix type of dashboard_query * Fix test typing
…d cells (#18116) * Add better table formatting * Use QueryContent to right-align table cells and headings * Just use toLocaleString
#18120) fix(plugin-server): prevent multiple concurrent reloadPlugins and coalesce them when possible
* opt in surveys when creating survey and opt out when no active surveys * update survey banner warning * add auto opt ins for surveys list launch and stop surveys * remove from onboarding step * Update UI snapshots for `chromium` (2) * update opt in from backend instead * add filter for api surveys and post delete to receiver * Update query snapshots * fix popup flicker * ambr snapshots * disabled popup banner rename * exclude api surveys in query instead --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* pay gates wip * Update UI snapshots for `chromium` (2) * pay gate survey edit * html descriptions * Update UI snapshots for `chromium` (2) * rename ctas in pay gate mini and use getavailablefeature * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * feature flag pay gate * Update UI snapshots for `chromium` (2) * swap surveys beta tag for new and bump higher * Update UI snapshots for `chromium` (1) * fix merge conflict --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
…te (#18125) * move survey question type back up * add open feedback template * fix description
* only run hogql parser workflow if running from upstream repo * Fix capitalization --------- Co-authored-by: Michael Matloka <[email protected]>
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.18 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.18...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 still has the issue of only really working for insight queries but i can live with that for now
Problem
Reported in https://posthog.slack.com/archives/C05N9R3HT7V/p1695922124646429. The badge was showing the count for all the notebooks containing an insight, and not making use of the saved insights id
Changes
NotebookSelectButton
id_match_structure
to find matching insightsHow did you test this code?
Updated tests