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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handover Focus #28

Closed
simonharrer opened this issue Apr 21, 2020 · 6 comments
Closed

Handover Focus #28

simonharrer opened this issue Apr 21, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@simonharrer
Copy link
Member

Problem

Handover includes handing over code but also the current focus. The current focus typically is the opened file, and maybe even the cursor position. Maybe also all opened files in the project.

Solution Idea for handover opened file

We can get the title of intellij window on osx via

osascript -e "tell application \"System Events\" to get the title of first window of process \"idea\""

From the title, we can deduct the last opened file. On mob next, we can put the filename in the commit message of the WIP commit. And on the next mob start we can look for a file with that name and open it.

Challenges

  • two files with same name needs to be resolved somehow
  • other operating systems require additional logic to get the window title, and the filename must be shown in the window title
  • getting opened file and opening file requires knowledge of editor, and requires editor to be available on the terminal

Any thoughts on this? Not sure whether this is worth it, but found the idea interesting to think about at least.

@Morl99
Copy link
Contributor

Morl99 commented Jun 8, 2020

Maybe it would be a start, to open the file(s) that were modified last? While that surely is not 100% accurate, it could be worth a try. Implementing it isn't editor specific (at least the detection mechanism) and there could be a config setting to control the time span of files (last 60 seconds before mob next for example).

@simonharrer
Copy link
Member Author

Thanks for the great idea. Do I understand correctly that you would determine the last modified timestamps of any files changed as the first step when entering 'mob next' and then we could add that file to the commit message so that the next person doing 'mob start' could open that file explicitly?

What do you mean be controlling the time span of files? Can you elaborate that, please?

@Morl99
Copy link
Contributor

Morl99 commented Jun 8, 2020

Right, let me try to sort out the ideas I had in mind.

The simplest thing would be, to determine the youngest file during mob next and write it to the commit message.
I can think of two additions:

  1. Instead of just a single file, you could find the files modified in the last X minutes (configurable). And write the array of files to the commit message.
  2. This would be something for an IDE plugin. If we choose a parseable message format, an IDE plugin could pick it up and make sure that the file is open and has focus.

Does that make sense?

@simonharrer
Copy link
Member Author

Format of the git commit message:

mob next [ci-skip]
path-to-file-within-git-repo#line,column
path-to-file2-within-git-repo#line,column

Paths sorted by last modified desc.

@simonharrer
Copy link
Member Author

Not sure if we should put this on hold. It doesn't make that much sense with the CLI alone, only in combination with an IDE. And the IDE plugins aren't there yet.

@simonharrer
Copy link
Member Author

Putting on hold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants