Setting root directories for projects and autochdir regardless of if file is inside a project?

I just did a bunch of searching, and basically I want to be able to declare root directories for project, (which I can do with Telescope project) but also automatically change directories when I switch buffers, so if if the file is inside a folder inside a project folder, then set the directory to that. And if not then set the dir to the file’s directory.

Project.nvim can change directories to project folders, but it overwrites autochdir to false, there’s an issue, and a pull request for it. I installed it and disabled the override, but then it stops changing to project directories, and the plugin doesn’t let me manually add project dirs anyway.