-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Context menu items EPIC #21
Comments
Widget does give us more flexibility, since it looks like we may have one that displays the map. How about we call them ContextMenuWidget |
Database and backend summarynew table context_menu_widgets
Each ContextMenuWidget can have many-to-many relationships to CustomViews new table context_menu_widgets_custom_views (🥲)
GraphQLWill need to model a CMWidgets are containers for
|
i think we want to do this more like the current architecture for Widgets, which has a widgets table that has a name and type, and then a GroupsWidgets table that links the widget to the group and contains things like the order, customized name, and other settings. In fact, i wonder if we could just reuse/replace the current Widgets tables! May be more trouble than its worth but we are probably going to remove them because explore is going away. I guess what you are saying above is that maybe we dont need the Widgets table at all, we just use the type column to differentiate the widget types and then the UI handles all the display stuff including the default name for each widget type? That may work 🤔 Pondering whether there is value in the database knowing about all the widget types and names... Similarly, do we need to track the common views in the database too, like Events, Projects, Map...? Because at least in the Views widget you will be tracking an order of the views, and maybe it makes sense to have just a an ordered list of view ids for this, and whether they are common or custom? Otherwise it will be an ordered list of some Custom Views by id and some common ones by name, which is a little weird, though ok. |
I am not looking too carefully here so take what I say with a grain of salt... But I do think it is easier to maintain/manage/grok/develop generally if UI stuff is mostly handled in code with the absolute minimum coming from the database to shape what is displayed. So... generally the direction this is headed, if it is moving defaults and logic into components out of data this is great where possible, and obviously there is some customisation that is per member or group that is requiring the database storage so maybe I am likely not saying much. |
Ok, this is my current thinking. It is based on centering the interface (the graphQL schema type definitions), and focusing on ensuring we can smoothly model the ordering and grouping within the ContextMenu. ContextWidget as graphQL modelWe can model the groupings and views of the context menu with ContextWidgets To map the nesting and order of the ContextWidgets in the menu, they need to have (GraphQL schema):
These are just what is needed to position the ContextWidgets. Simple tree modelIn this model, we can think of the group (the context in question) as a trunk of a tree. The group has a collection of ContextWidgets. Each of these views branch off that metaphorical trunk, in order. Each of these branches is rendered based on whether they terminate (there are no more child contextViews) or if they branch once more (they have child contextViews). For the purposes of our UX/UI needs, by convention, there will never be grandchild contextViews. Views as leavesEvery one of these branches terminates in a leaf; for the purposes of our UX, these leaves are views. They represent a wide range of things:
We can think of ContextWidgets being a wrapper to the views that exist on the platform, allowing these views to be manually ordered and grouped. This does not imply that all widgets will be orderable. Some are connected to queries that do their own ordering To model the leaf part of the contextWidget in the graphQL schema, we must add other fields
Functionally, a ContextWidget can only have one of these child entities or a collection of ContextWidgets that in turn terminate into one of these entities
The user, group, chatrooms and customView exist as entities in the DB. Each of those pass real values from the db that basically allow for a url or navigation action (recall that this must work for the mobile app as well) to be created. Click on the ContextWidget, and the main panel displays the result. The view value here is synthetic (exists in the graphQL schema but not in the database), in the sense that it will be hardcoded in web/mobile/backend to point to a specific stream/query. No actual graphql query will be exposed via this interface. Each one of these child entities will need to expose some sort of metric/number, that gives some sense of 'recent or unread activity'. Exactly what is somewhat underdeveloped from a product perspective. Special rulesSome of these ContextWidgets will need to respond to specific rules. Like whichever one represents the 'home' view, will always be order 1. Or some view types must always be present. This needs to be fully fleshed out RenderingA ContextWidget will render different UI based on what it is; If its a collection of other ContextWidgets, it will be a grouping. This grouping will in turn render the children elements in either a list or grid If the contextWidget has no ContextWidget children, it will render the view referenced directly. The ContextWidget rendering will also hard-code special UI/UX pieces to certain views: Kitchen Sink/ 'All view'This is a catch-all list of views; it means that no matter how stewards have composed the context menu, contents of the group can still be accessed. This is now easy to model/query; its just a request for all the collectionViews that are leaves, and rendering them in a grid. What about possible views that aren't included in the menu? Either these are covered by all the different views in the fabled "what's happening" grouping OR we create ContextWidgets for ALL of the different common views for a group, and leave them unordered (aka, order = null). ExtensibilityThe group context is the main context, but this data model could easily allow us to model ordering and grouping in other context menus as well, such as the 'my home' context. It could also fairly easily be able to model ordering (and maybe grouping, depending on need) of items in the GLOBAL menu. |
This is cool, but feels a little too abstract maybe? I think the ContextMenuWidget version is easier for me to understand and reason about. For example, why would you need a ContextView for a single post or user? That seems like an unnecessary abstraction. And when would a context view contain a "query"? I think each widget is different enough that we should handle them differently. Unless you are thinking that someone may want to create a grid of subgroups, or a map of just the events? I suppose i could see that. We do need to think through the configuration UI and make sure this is not too complex for folks though. Have to balance flexibility with ease of setup/use. Also I think the name is too similar to CustomView. But lets talk it through so i can see what you are seeing! |
Its a way to model leaves consistently. These are examples of users or single posts as leaves in the current designs User stories:
These are just simple examples to answer your question but they are not the basis for why I am suggesting ContextViews; this makes sense because of the overall requirements for the context menu.
The idea of ContextWidgets is primarily about ordering them and grouping them. The differences between widgets can easily be modelled based on the ContextWidget proposal. The rendering (the actual Widget component) will be different; it will just be a lot easier to punch out those different units if we have a consistent interface across them. Widgets have these things in common:
The more we can create a consistent, cross-platform abstraction for these concerns, the smoother the experience will feel to us and users. When you clarified that the contents of these widgets could themselves be 'promoted' to being a widget, it really pushed home the benefit for these having a consistent interface/data model.
Of course, one of the driving motivations behind ContextWidgets. |
Changed name from ContextView to ContextWidget |
So, periodically we will change something about a group's context menu based on some change in their content. EG: I have considered two ways to track this, one that is content-centric and one that is group-centric: Whenever someone creates/edits content to a group (or group relationship), there is a validation that runs each time for any group the content is posted to. Option 1 Option 2 Any thoughts on the impacts of either choice? Given that the second option works as a migration as well, I'm inclined to do it. Otherwise Option 1 will likely need to be paired with some other migration function/method |
Ok so let me lay out my current thoughts, which honestly may align quite well with yours above, but im not quite sure yet. The context menu is basically a list containing two types of Widgets: 1) A single item (which I think we can just call a View) widget 2) A collection of views. There are several types of Views, which I think can probably all be contained by the Custom Views table, which maybe we rename to Views:
A single view widget can either just be a link to that view, or can be displayed in different ways in the Context Menu, for example a map widget could be used for any filtered query set or curated set of posts. Similarly you could have a task list or mini calendar view connected to a query or curated set of posts. Another example is the members widget which is a unique A collection widget displays a series of views either in a list, or a grid, with an order that could be manually set or potentially algorithmic (like the default Whats Happening that adds new views as you do things in the group). So maybe we can pull this off with two database tables - GroupsViews, and GroupsWidgets. Each with a type column that the UI uses to decide how to display. The GroupsViews table would have types of: Link, PostQuery, PostCollection, Chat, Members, Groups, Group, Member, Post, Embed. The GroupsWidgets table would have types of: SingleItem, ViewCollection, Map, Tasks, Members, Groups, Calendar... How does that sound? |
i think this is very similar to what you describe above, though maybe a bit simpler? |
Sorry I should have updated and explained that I've implemented ContextWidgets already, with mutations and graphql updates, and have a nice test set for them already. So how I read this suggestion:
Generally, I don't find this compelling. If it was really compelling in some way, I'd consider abandoning the couple of days of implementation work on the ContextWidget setup. As far as I can infer, there aren't any behaviors or functionality that it offers over the ContextWidgets direction, and it creates more code and more changes to the db by needing two database tables to change/be created. If you want to change something about custom views (maybe we should?) ContextWidgets will work with that easily, and they don't rely on it. I don't think the desire to change something with CustomViews needs to change how we handle the context menu. From a UI perspective, this would imply that when a steward moves a view from being a child of a collection to being a widget, and/or back, we are creating and deleting GroupWidgets for this operation. For ContextWidgets, its just an update call, because its the same entity but just repositioned. This is easier to model in the optimistic updates that will be required in urql or redux. In short, we are juggling the relationships between two similar entities, instead of just modeling them as the one entity. Additionally, I think we can extend ContextWidgets to model the navigation of the home context (here is belongs to a userId not a groupId) and even the global context, with the addition of a context 'column'. Even if we are not offering customization of those things straight away, this simplifies the UI components we have to build; they can just expect a set of ContextWidgets and render them like any other, whether those data-structures are coming from the db or hardcoded behind a hook. |
"ContextMenuWidgets": sections of the ContextMenu that display data and point to different views
Sources from the product spec as of 22OCT24:
These things can be:
'home' section?)
Naming
Section sounds like the container for these things in the html, as opposed to what they are. At a minimum, I'd prefer to refer to them as something more specific, like 'MenuSection'. If one searches 'section' in the repo, one gets lots of references to 'sections' in parts of the app that...Will work with them being called
ContextMenuWidget
for nowRequirements
Each
ContextMenuWidget
must have:Categories of
ContextMenuWidgets
Running lists of them:
Architecture
Goal: We have to have UI/UX that makes the common things a group wants (or expect from prior experience) easy to access.
A ContextMenuWidget could point to:
Which things:
CustomViews (which point at: a collection of posts, a query/stream or an external link) cover some but not all of these needs...
Covering off on what we want to deliver in 1st phase:
Managed collections
Queried collections
Others
So thinking about how to model all of this; some options
Option A: model ContextMenuWidget in db; hard-code what to do with common views, point at custom views
Option B: model ContextMenuWidget in db; create CommonView to model the legacy views, point at custom views
Leaning towards just doing Option A for now
UI/UX implementation
If we go crazy on multi layered dnd
https://www.reddit.com/r/reactjs/comments/16ogvr6/nested_sortable_lists_multiple_containers_with/
Only doing one layer of dnd (drag and drop) for phase one, for re-ordering widgets
Tracking 'recent activity'
What needs to be included? What data is available? What counts as 'recent' for the number counts?
Going to punt on figuring this part out until we have the rest of the context menu pieces in place
The text was updated successfully, but these errors were encountered: