ParthJadhav / Verve

Verve is a lightweight and blazingly fast launcher for accessing and opening applications, files and documents. ⚡
GNU Affero General Public License v3.0
658 stars 25 forks source link

feat: show result path & refactor result component #38

Closed ParthJadhav closed 1 year ago

ParthJadhav commented 1 year ago

closes: #33

ParthJadhav commented 1 year ago

Hey @benediktms , This PR refactors the results component, Separates the logic & adds path on right side of full drive search.

Screenshot 2023-01-14 at 12 48 13 AM
benediktms commented 1 year ago

@ParthJadhav I think it looks good, some suggestions I have:

What do you think?

ParthJadhav commented 1 year ago

I actually didn't understand what VCS mean 😅

benediktms commented 1 year ago

Sorry I meant version control repos like git. But I thought maybe it would be a good to be version control agnostic. But probably that can be added if and when it's needed. We could just start with git.

ParthJadhav commented 1 year ago

I'll work on it tomorrow 🤝

ParthJadhav commented 1 year ago
  • As a followup we could also truncate from some sort of meaningfull directory to give the user and understanding where generally the file is, for example rather than: fileParentDir/fileDir/fileName we could display root/.../fileParentDir/fileDir/fileName where root could be the VCS root

I still quite didn't understand... Can u give me an example?

benediktms commented 1 year ago

currently only 2 parent folders are displayed: fileParentDir/fileDir/fileName. This is better but for files that are nested deeper, e.g. app/pages/page1/components/index.ts This pattern might have lots of folder named components and lots of files named index.ts. In cases like this there are 2 solutions:

  1. Always display the absoute path from the home directory
  2. Display the absolute path from the git repository root.

Both options are fine but probably option 2 is better. In cases where the total path name is very long, we should truncate the final output to not clutter the UI. E.g.:

some-project/app/pages/feature/componets/edit/state.ts

could become

some-project/.../components/edit/state.ts

otherwise depending on how deeply nested the file is, the full file path might not fit in the results view because it is too wide.

ParthJadhav commented 1 year ago

Gotcha, I'll create a different Issue for that...

ParthJadhav commented 1 year ago

Will merge this @benediktms