calva icon indicating copy to clipboard operation
calva copied to clipboard

Add setting for pre-selecting project file path for jack-in in monorepos

Open bpringe opened this issue 3 years ago • 3 comments

This would be helpful in projects using polylith, for example, in which people normally want to jack-in using the top-level deps.edn file.

I think it would be a path relative to the project root, maybe... I don't know if there could be issues with this, such as maybe a workspace with multiple top-level projects added to it.

@PEZ - Thoughts?

bpringe avatar May 11 '22 21:05 bpringe

Actually, maybe this only makes sense as a project-level setting (not user level), at least as it's described above (relative path).

It would be nice to set this in the project so that team members can utilize it without needing to set it or even be aware of it. Maybe that would be confusing though, unless we either still open the project root quick pick and just highlight the path of the file in the setting, or if we notify the user somehow that the setting value was used. If we don't do something like that, the user may wonder why they can't jack-in to some other sub-project, even if it doesn't make much sense to do so.

bpringe avatar May 11 '22 21:05 bpringe

The current behaviour is awesome in many monorepos. But ... Polylith ... In those projects you rather want it to remember the last selection.

I think an enum setting makes sense: something like: calva.projectRootMenuAutoSelect with two values:

  • Select root closest to active file
  • Remember last selected root

Then users choose if they set that on the project or in their user settings. It totally makes most sense as a project/workspace setting.

the user may wonder why they can't jack-in to some other sub-project

They can still do this, right? Just type part of the name of the sub-project and it will get selected.

PEZ avatar May 11 '22 21:05 PEZ

They can still do this, right? Just type part of the name of the sub-project and it will get selected.

They can't do that if we select something for them without showing a quick pick.

To clarify, I was talking about two separate approaches:

  1. Preselect a path in the quick pick according to the setting but still show the quick pick (don't select the path for them)
  2. Use a path according to the setting and don't even show the quick pick

Maybe I wasn't sure what you were suggesting on Slack, but I think # 1 is the best approach, and I now see you were probably suggesting that.

bpringe avatar May 14 '22 03:05 bpringe

I think this is taken care of somewhat now with jack-in and connect sequences being auto-selectable. WDYT, @bpringe?

PEZ avatar Mar 14 '23 09:03 PEZ

I'd say so, from what I know of them. I haven't tried the recently changes yet, but I'll go ahead and close this.

bpringe avatar Mar 15 '23 02:03 bpringe