Comments (3)
see discussion re potentially logging "selections" independent of "views" so that we can slice these things more finely in various places
from metabase.
Summarizing our decisions regarding this idea:
API To track selection events:
POST /api/activity/recents
Whenever a selection occurs, the frontend will send a post body like:
{
id: number,
model: 'card' | 'dataset' | 'dashboard' | 'table' | 'collection',
context: 'selection'
}
API To read recently selected + viewed items
context is a required query parameter, and dictate what keys will be in the response.
GET /api/activity/recents?context=view
returns recent view items only
{"recent_views": [Items...]}
(n.b. this is the exact same thing as /api/activity/recent_views
)
GET /api/activity/recents?context=selection
to get only views or recently-selected items:
{"recent_selections": [Items...]}
GET /api/activity/recents?context=all
gets both, under the 2 keys:
{"recent_views": [Items...],
"recent_selections": [Items...]}
Backend details
We should add context
, a non-nullable text column to the recent_views
table, that can be used to differentiate these two kinds of views. That should allow for easily expanding the recents purview.
The 4 or 5 big queries will need to be parameterized with context: either selection
, view
, or both of them, so we can keep the query upfront. We can still pass everything through
Garbage Collection
For deduplication, we would need to delete all but the most recent values for all rows with the same (user_id, model_type, model_id, context)
therefore context will need to be considered here. Then for compaction, we delete all but the latest 20 items per user_id x model_type x model_id x context
- As it is now, we make a query for duplicate items, and delete all but the newest entry when there is a collision on
(user_id, model_type, model_id, context)
. I think it is time to closely consider improving the recent_views schema, to be unique on those fields, and simply do upserts when there is a collision on (user_id, model_type, model_id, context). This will let us stop doing manual deduplication.
- Add
POST /api/activity/recents
to record selection events (.5 days) - Create the
GET /api/activity/recents?context=view
endpoint (.3 days) - Update db schema + backend to return selection events (2 days)
- Compaction on multiple contexts (1 day)
- Update the api to be able to return both (1 day)
- tests + ci (1 day)
from metabase.
Frontend Tasks:
- Adding a request to
POST /api/activity/recents
to record selection events - Update the request for
GET /api/activity/recent_items
in the data picker toGET /api/activity/recents?context=selection
, and use that list instead (the exact same shape is returned, so nothing else to do there).
POST /api/activity/recents
Whenever a selection occurs, the client will send a post body like:
{
id: number,
model: 'card' | 'dataset' | 'dashboard' | 'table' | 'collection',
context: 'selection',
}
from metabase.
Related Issues (20)
- RowCharts continuously shrink on hover (row charts have become shy)
- [Dashboard subscription] Pivot table is not pivoted HOT 1
- Failed to upgrade v0.44.4 -> v0.49.13 HOT 2
- Store context in `QueryField` table
- Ensure we can find logged parse exceptions in Grafana
- Instrument parsing performance HOT 1
- Do some basic profiling (on big queries, etc.) to make sure we don't use too much memory HOT 1
- Send the queries to starrocks as normal strings without a prepared statement HOT 2
- Slack alert is no longer working due to Slack API change HOT 1
- Error: There was a problem displaying this chart HOT 2
- Ability to lock the side_nav (hide sidebar) for interactive embedding
- Pinned Models lack an icon HOT 1
- Add Model Icon to Model section inside a collection
- Table background changes when adding it to a dashboard
- Decouple Sort of Legend and Segments of a Stacked Bar HOT 1
- Daily error in Metabase HOT 8
- Review styling issues in static dashboards for embedding SDK HOT 1
- Review styling issues for visualizations in questions and dashboards in embedding SDK HOT 1
- special characters on the data will break subscriptions
- Improve `ambiguous column name X` error message to include the line number HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metabase.