Open shankari opened 1 year ago
Before the rewrite, the new modes were filled in based on the modes that were pulled from the server. So if the "pogo stick" mode was last used last month, it will not show up this month by default, until the user pulls more data. While re-implementing this, we want to:
I would suggest doing this incrementally in the order above. Let's design and implement (1) first and then (2) and then (3) But keep (2) and (3) in mind while designing (1) so we don't have to refactor/revisit too much code.
@jiji14 will work on this end to end, next step will be to add in a design with pros and cons
Mode
when a user writes a customized mode through the Other
option.most frequently used
and most recent
after the default list of modes.my car
through the Other
option.my car
option will be displayed after the default list of modes.my bike
through the Other
option.my bike
and my car
will be shown after the default list of modes, ordered by creation time in reverse (Because each mode is equally used once).my car
mode.my car
and my bike
will be shown after the default list of modes. (The order is based on usage frequency; my car
appears twice, and my bike
once.)Handling Long Text:
I am more inclined towards limiting characters but our current UI is using text truncation. I believe 20 characters are sufficient, and if we use truncation, we would need to display the full text, but I can't find any good ways to show it without affecting the UI. I will discuss this matter next UI meeting.
Handling a Large Number of Modes:
I propose limiting the number of modes (e.g., to 50) to prevent users from adding numerous modes for unnecessary purposes. When displaying modes, I don't think a "more" button is necessary since there is a scroll function in the modal.
Pros:
Cons:
I strongly believe in the necessity of limiting the number of modes a user can upload, but we should engage in further discussion about determining the specific limit.
Save Modes in Native App Storage:
Save Modes in Database (Consider Profile
Collection):
Profile
collection appears to be a suitable choice for storing mode data.
We can store data as a name-object pair and organize it based on frequency
and creation date
. To achieve this, we would need to update the frequency
whenever a user saves or changes a customized mode. For instance, if a user adds my car
,the frequency of my car
becomes 1. Subsequently, if the user changes my car
to other customized mode
, we need to decrease the frequency of my car
to 0 and increase the frequency of the other mode
.
{
...
"mode": {
[name]: {
[createdAt]: Date,
[frequency]: Number,
...
}
}
}
Pros:
sort
function in MongoDB.Cons:
Despite efforts to explore alternative methods and data structure, option 1 seems to be the most efficient. Please share if you have other ideas or considerations.
Manage My Mode
to the Profile tab.Delete Mode
function on Manage My Mode.Manage My Mode
.delete
button next to the item in the list.yes
, and the mode is deleted.If a user deletes a mode and subsequently adds the same one, consider treating it as a new mode and resetting the information. Alternatively, we can set an isActive
key to retain all modes and change isActive
from true
to false
when a user deleting it.
{
...
"mode": {
[name]: {
[createdAt]: Date,
[frequency]: Number,
[isActive]: Boolean
...
}
}
}
Note: I intend to submit a pull request in the order of Step 1 > 2 > 3 > 4. Kindly review each step and feel free to comment if you have any questions or if I overlooked anything.
@jiji14 Step 1 looks fine at a high level.
Comments to ponder and discuss:
I strongly believe in the necessity of limiting the number of modes a user can upload, but we should engage in further discussion about determining the specific limit.
I think this needs some thought. Maybe I first live in a small rural area with one set of modes, and then I go to a big city with a completely different set of modes. So between the two, I end up at the limit. Will I be prevented from adding any more modes? I think that it would be better to remove the lowest frequency older modes and allow the user to add new modes. But maybe this is moot when we have "Manage my mode"
Add Manage My Mode to the Profile tab.
I think we may want to have this during onboarding as well, at least in Step 4. Because otherwise, the user might just use "drove_alone" instead of taking the effort to enter "my car" since it is not "other". Or is the expectation that we would not have any default modes after this change?
@shankari
Yes, this is when we have "manage my mood" because a user can delete unused modes there. My thought was that it would not limit the user experience when a user can add enough modes, and they can delete some of the modes they haven't used for a while. I will discuss this issue in the UI meeting too.
Also, adding it to onboarding seems like a good idea. I will implement that after adding the "manage my mode" feature.
During the meeting, we addressed the following points:
@shankari
I'll proceed with the implementation of Step 1. Please let me know if you need me to collect something.
when we get to (iii) I would like to discuss further. I see the comment about onboarding, but I don't think people will do anything that they don't have to.
Related changes are merged. We still need to determine how to account for the energy/emissions of the newly entered modes.
Before the rewrite, we used to incorporate "other" responses into the dropdowns. Concretely, if the user added "pogo stick" as the selected mode, then for the next trip that they try to label, "pogo stick" will be an option. This allows us to eventually build a user-specific selection of mode and purpose choices, which allows us to capture the long tail of modes that are very important to individual users, even if they are not known to be very prevalent societally. This allows us to understand how prevalent such modes actually are, and how they should be accounted for in societal-level decision-making.
This behavior has regressed during the rewrite. This is not a showstopper and can be addressed in a cleanup change.