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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beef up Recents 馃ォ #41957

Open
5 of 6 tasks
Tracked by #35564
iethree opened this issue Apr 29, 2024 · 0 comments 路 Fixed by #42239 or #42305
Open
5 of 6 tasks
Tracked by #35564

Beef up Recents 馃ォ #41957

iethree opened this issue Apr 29, 2024 · 0 comments 路 Fixed by #42239 or #42305

Comments

@iethree
Copy link
Contributor

iethree commented Apr 29, 2024

related to #39528
product doc

For the new recent item picker, we're going to need some changes to the activity/recents api

  • We need to track the most recent 20 items that each user has "touched" (ie viewed) of each entity type
    • question
    • model
    • table (probably don't need right now)
    • dashboard
    • collection
  • for a collection to be "recently viewed" means that:
    • the collection was created
    • a dashboard or question was saved in the collection
    • a dashboard, question, or collection was moved into the collection
  • We also need more information about each item than the current api provides
    • can_write
    • last_touched or some sort of proxy for sorting by most recently used (i think this is what the timestamp field in the recent_views table is doing)
    • parent information - collection name + authority level (eventually parent db for tables)
  • While we're at it, can we make the payload for the recents endpoint conform more closely to search and/or collection items?
    • nesting model_object inside each recent item is a weird pattern that's used nowhere else and is completely unnecessary, we can just populate a model property on each item like we do elsewhere
    • we should probably update the popular items api to match

Desired RecentItem Shape

(open to discussion)

interface RecentItem {
  id: number;
  name: string;
  model: string; // should differentiate between regular cards and "dataset" for models
  can_write: boolean;
  display: string; // for questions
  parent_collection: { // for non-tables
    id: number;
    name: string;
    authority_level: "official" | null; // for collections
  } | null;
  database: { // for tables
    id: number;
    name: string; // display name
  } | null;
  authority_level: "official" | null; // for collections
  moderated_status: "verified" | null; // for models
  timestamp: string; // last touched
}

Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants