JacobEvelyn / friends

Spend time with the people you care about. Introvert-tested. Extrovert-approved.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace `favorites` commands with more flexible `--sort` options

danielepolencic opened this issue · comments

I'd like to know which friend I haven't talked to in a while.
I tried to look into the documentation, but I couldn't find anything.

I thought about using list activities, but it works only if I iterate on all users.
I thought about using list friends, but there's no way to list them by activities.

I tried using list favorite friends, but that's not quite right.

I'm wondering if there's any flag that I could use and I'm missing.

Hey @danielepolencic ! Thanks for opening this issue.

I'd love to learn a little more about your use case. Some questions I have for ya:

  1. Are you imagining a command that gives you a friend that you haven't had any activity with in X amount of time (or the X most recent activities)?
  2. If so, should this command give you just one random friend that meets this criteria, or a list of them?
  3. Should this command only limit to "close" friends (as computed by friends suggest)?
  1. Something like that. I think more than a "command" the intent is the following:
    I want to know which friends I haven't got in touch in a while and perhaps I should reach out.
    In practice, I think this is similar to ordering all friends by last activity.

  2. I don't like random. I'd like a list of N (10?) friends that I neglected. examples:

  3. Mat (last contacted 1y ago)

  4. Julie (last contacted 3 months ago)

  5. Raul (last contacted 2 weeks ago)

I might want to reach out to Julie and ignore Mat even if I haven't talked to them in a year.
3. This is a personal preference, but I don't like random. I want to be in control and decide who to get in touch with. suggest is not my cup of tea.

I totally hear you about not wanting a random list, but I'm trying to figure out how this could work with a larger list of friends. As an example, friends stats currently tells me that I have 527 friends in the file, and I swear I'm an introvert. Obviously, I'm not close with most of those people. Some are former coworkers who I thought I'd become close with but never did, some are spouses of friends-of-friends that I thought I'd start seeing more, etc.

But I have no idea how friends would pull 10 neglected friends out of that list, since I'm sure there are hundreds. That's what I was getting at with "close" friends (friends that have been in a bunch of activities) or using randomness to cut it down.

Some example ways this could be implemented:

  1. List all close friends that haven't had an activity in the last 3 months.
  2. List all close friends that haven't had an activity in the last 20 activities.
  3. List all close friends that haven't had an activity in the last user-supplied amount of time (e.g. a --since argument).
  4. Compute each friend's "average activity frequency," and show all friends who haven't had an activity in that amount of time times some multiplier (e.g. (frequency * 2).days.ago).
  5. Compute each close friend's "average activity frequency," and show all friends who haven't had an activity in that amount of time times some multiplier (e.g. (frequency * 2).days.ago).
  6. List all friends in order, ranked by something like number_of_activities * days_since_last_activity.

Thoughts?

To be honest, I didn't think about large use cases.
However, isn't this a ranking/filtering problem?

As suggested in the docs, I could pipe the values to another shell tool and sift through the results.
It's also very likely that with a large number of results, I could narrow down my selection with tags and location, for example.

I believe this is personal preference, rather than a hard requirement.

Yep, I agree that large outputs aren't an issue. But I think that still doesn't really resolve the question of what you're hoping the output to look like. Is it a list of friends ranked by some value like number_of_activities * days_since_last_activity? Is it something else from the list of options in my past comment? Concretely, what are you expecting/hoping the output of this command to be?

Hey @danielepolencic! I whipped up a prototype of how this might work using the number_of_activities * days_since_last_activity ranking. Running it on my own file with

bundle exec bin/friends --filename ~/path/to/my/friends.md neglected

shows... not great results. A lot of the people at the top of the list have either passed away (😢) or are from something like a sports team I was on years ago, where I had a lot of activities with the same people but it's obviously been a while.

Would you be interested in cloning this repo, pulling my branch (neglected), and running it using the command above to see how the output looks for you? I'd love to iterate on this idea and get it to a point of being useful!

Hey @danielepolencic! I just tweaked this formula a bit and now have better results with my own data, but I'm curious how it works with yours. (It's still a bit touchy for me.)

You can try tweaking the multiplier in the cutoff line—I found results between 0.75 and 0.95 to be useful.

Apologies, for the belated response. Also, I didn't mean to bring back bad memories :(

My sample is not that as big, so I don't see the same issues. Also, is there any way I can filter by tag?

Something like:

bundle exec bin/friends --filename ~/path/to/my/friends.md neglected --tagged family

@danielepolencic no worries on either count! I just added --tagged and --in options to it so you can now filter by friend tag or location.

I'm testing it, but it looks good to me!

Just a personal note. I think the command should have a positive connotation. Every time I type neglected I feel guilty of not having nurtured the relationship.

Here are some suggestions:

  • touchbase (friends touchbase --tagged family)
  • reconnect (friends reconnect --tagged family)
  • catchup or catch-up (friends catchup --tagged family / friends catch-up --tagged family)

I might have missed something, but is it possible to order them by date?
I think I found a bug. I used to be able to sort the results by days:

image

But as I was adding more entries:

image

It doesn't work anymore. I tried to remove entries from the MD in the hope to find the culprit, but I cannot. Any suggestion on what I should try next?

Hey @danielepolencic! Thanks for all the thoughts!

I think the command should have a positive connotation.

You're totally right! I like your suggestion of friends reconnect!

I used to be able to sort the results by days

I'm not sure I totally follow—what were you doing to sort the results? Or are you just saying that you expect the results to be sorted by days but they aren't? This command isn't just sorting friends by the number of days, because that would mean that people you interacted with once, years ago, are above people you've interacted with many times but haven't seen recently. So instead it uses a heuristic to find these combinations of people_with_lots_of_activities and people_that_haven't_had_an_activity_in_a_while. (My high-level rationale for this is what I tried to get at with this comment.)

Does that make sense? Is that different from what you expected?

Now that I pay more attention I see what you mean.

that would mean that people you interacted with once, years ago, are above people you've interacted with many times but haven't seen recently.

That's exactly what I'm after. At the moment, I have a tag for people that I don't want to follow up anymore. If I met a person once and never got in touch in a year, they should be at the top of the list — unless I filter them.

The number of activity is not relevant, I think.

It's difficult to write an algorithm that should decide if I should reconnect with my grandma who I rarely see or the ex-colleague I regularly meet at the gym every week, but they are in 3-months sabbatical holiday in South America.
I'd prefer to decide for myself instead of relying on an algorithm.

I think it's hard to come up with a heuristic without thorough testing. I'd suggest the basic command stays pretty simple, but you could add more complex behaviour with extra flags.
In this case, the functionality is progressively smarter and more opinionated. But one has the option to choose.

Gotcha, thanks for the thoughts. I can get behind a command that just lists friends by least recent activity. Thinking a bit more about the nomenclature, I think it makes sense to put it in under friends list. I'm wary of your warning about neglected though. Maybe something like one of these?

  • friends list lapsed
  • friends list erstwhile
  • friends list reconnectable

(Totally open to better names if you can come up with any!)

And since I'm still thinking about an optional flag to use a heuristic like number_of_activities * days_since_last_activity and I saw @andypearson react to an earlier comment, I'm wondering if @andypearson has any feedback for the prototype I built. 😄

*waves* :)

Mainly I'm lurking because GitHub notifications got better! I'm still using friends as a journalling tool, so not sure this feature is something I would use.

I agree with @danielepolencic though, I'd like the command to be more positive than "neglected".

Hi Jacob, is this still being worked on? I have something similar to this project for keeping tracking of friends, but it's very bare bones and I love how many features this project has. Reading through the comments it seems like you were considering different ways to implement this. I'd say that having any way to keep track of friends I haven't talked to in a while is better than no way at all, so the basic one sorting friends by days since last acitivity sounds fine.

Hi @ra314! Thanks for reaching out! I was waiting to hear if anyone else had thoughts before moving forward on implementation here, but if you'd find this useful I'm happy to add it.

Are you interested in becoming a contributor and making a PR or should I just merge the code I already have? (I'm happy either way—I just want to give you the opportunity to get involved if you want.)

(Also, I'm traveling over the next few weeks so my communication may be a bit sporadic—sorry!)

You should merge the code you already have. Thanks for the consideration!

Hi @JacobEvelyn. I probably should've tagged you in that last message, I forgot that that's how notifications were delivered around here. Or maybe not and you're busy with other stuff (in which case ignore this message). Just nudging you about the issue. Cause I'd find the feature super useful and would be able to shift to using this app.

Sorry for the delay, @ra314! This hadn't slipped my mind, I just hadn't gotten a chance to work on this over the past few weeks. But I appreciate the nudge!

I'm working on adding this now!

Alright, I've got a good solution but my CI system seems to have broken so first I need to fix that :(

Okay @ra314 @danielepolencic @andypearson ! It took longer than I'd hoped to get this out the door but it's now released in v0.55.

Basically I removed the list favorite friends and list favorite locations commands in favor of a --sort option on the list commands. You can now --sort alphabetical (the default), as well as --sort n-activities (equivalent to the old favorite commands), and --sort recency. You can reverse the sort direction with the --reverse flag, so to find friends you haven't interacted with in a while (the original ask on this issue) it would be list friends --sort recency --reverse.

Hope that's helpful, and as always I'd love feedback!

Hi Jacob, this works perfectly. I don't have much data rn because I haven't been using Friends before today, but the output I have so far is exactly what I wanted. Thank you for adding the feature!

ra314@ra314:~$` friends list friend --sort recency
0 days ago: John Doe1
2 days ago: John Doe2
5 days ago: John Doe3