CodeEdit icon indicating copy to clipboard operation
CodeEdit copied to clipboard

[WIP] Resolved issues in search-results #534

Open zuziakaxel opened this issue 2 years ago • 9 comments

Dev note 🛠

I started working on this issue and found out that after clicking on a search result we open whole file (instead of file with desired line of code). I found it hard to fix all of color issues without a little bit of hacking (🪝 ).

Current implementation of FindNavigatorResultList doesn't catch selection events within the same file so I'm considering refactoring it something similar to ProjectNavigator - OutlineGroup. WDYT?

Description

Changes

  • Fixed issues with colors in search results
  • Fixed: text in the search field is removed from the input field when you switch panels.
  • Refactored FindNavigatorResultFileItem - extracted large parts to separate subviews

Related Issue

  • #534

Checklist

  • [x] I read and understood the contributing guide as well as the code of conduct
  • [x] My changes generate no new warnings
  • [x] My code builds and runs on my machine
  • [x] I documented my code
  • [ ] Review requested

Screenshots

Light Mode

Before After
CleanShot 2022-04-25 at 22 35 48@2x CleanShot 2022-04-25 at 22 19 28@2x

Dark Mode

Before After
CleanShot 2022-04-25 at 22 35 58@2x CleanShot 2022-04-25 at 22 19 11@2x

zuziakaxel avatar Apr 25 '22 21:04 zuziakaxel

Looks good. We need to preserve the transparency of unbolded text in your results though.

austincondiff avatar Apr 25 '22 21:04 austincondiff

Two related things that need to be looked at...

  • We need to be using a selection material instead of a color for the background of your selection. See #530.
  • The breadcrumb selector above the input is not spaced correctly and the inputs themselves have a slightly different style compared to Xcode.

austincondiff avatar Apr 25 '22 22:04 austincondiff

@zuziakaxel : As you can see from the pictures it looks different.

Schermata 2022-04-26 alle 09 11 32 Schermata 2022-04-26 alle 09 11 52

I don't know if it's the font or the bold. Other related text is also different in font.

@austincondiff : What do you think?

  • You could put the icon color of the file when it is not selected.
  • I also noticed one more thing, search the same word on both xcode and codeEdit, the results on the files should be the same data in the same way. I'm not talking about the ignore case (upper and lower case) which has not yet been implemented. I talk about the order of the files, for example the first file given on xcode is AboutView on codeEdit is WelcomeView. How come this difference, what is based.

Angelk90 avatar Apr 26 '22 07:04 Angelk90

Agreed. Please add the appropriate icon color in that is used in the project navigator and tab bar.

austincondiff avatar Apr 29 '22 20:04 austincondiff

Update: Still working on it. I need to refactor FindNavigatorResultList from:

List
    ForEach
        DisclosureGroup
            ForEach

to:

List
    OutlineGroup

Because previous implementation was supporting only selecting whole file (not a specific search result), therefore adjusting selection style for single "cell" was not possible.

zuziakaxel avatar May 08 '22 19:05 zuziakaxel

@zuziakaxel This PR is still in draft status and it is three weeks old. To avoid this getting stale I just wanted to check on the status of this PR.

austincondiff avatar May 17 '22 19:05 austincondiff

FYI, the unmatched text is too prominent, especially in dark mode.

austincondiff avatar May 17 '22 19:05 austincondiff

Any updates on this?

lukepistrol avatar Jun 10 '22 15:06 lukepistrol

Hey @zuziakaxel! This PR looks like it might be stale if you don't mind I'm going to take it over and finish it up.

thecoolwinter avatar Jun 22 '22 15:06 thecoolwinter

Closing this due to #703. Thanks for the help @zuziakaxel! Your initial work gave me a great boost.

thecoolwinter avatar Aug 06 '22 16:08 thecoolwinter