Skip to content

Conversation

@klntsky
Copy link
Collaborator

@klntsky klntsky commented Jul 6, 2020

2020-07-06-212400_432x545_escrotum
2020-07-06-212411_296x488_escrotum

@klntsky klntsky requested a review from f-f July 6, 2020 18:28
@klntsky
Copy link
Collaborator Author

klntsky commented Jul 6, 2020

Known issues:

  • if there are no definitions in a module, it will not show up in the listing (Right now we are getting package info by looking at the code locations of the definitions; so no definitions is indistinguishable from a non-existing module)
  • visual design

To consider:

  • Do we want "expand all" functionality in the package tree?

Copy link

@m-bock m-bock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool work, a feature I've been really looking forward to. thx!!

]
[ HH.text " GROUP BY PACKAGE" ]

, if mode == GroupByPackage
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe extract the HH.ul_ as it appears in both branches of the if .. then .. else?

]

if status == Expanded
then [ HH.text packageName
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the same here, HH.text packageName is not part of the conditions...


-- Some optics:

_expansions :: forall a b rest. (a -> b) -> { expansions :: a | rest } -> { expansions :: b | rest }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space, or is that on purpose?.. don't know..

@@ -0,0 +1,5 @@
module Docs.Search.Types where

type ModuleName = String
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could consider using newtypes here..

Copy link
Collaborator Author

@klntsky klntsky Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do it in a separate PR. The best set of types here would be:

newtype ModuleName = ModuleName String
newtype PackageName = PackageName String
data PackageInfo = Package PackageName | Builtin | LocalPackage | UnknownPackage

Copy link
Member

@f-f f-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a small request for more docs, but this looks amazing otherwise, great great work! 👏

@klntsky
Copy link
Collaborator Author

klntsky commented Jul 7, 2020

Oh and also, we should preserve the state of the checkbox between page loads.

Copy link
Member

@f-f f-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 👏

@klntsky klntsky merged commit e5c1386 into master Jul 8, 2020
@f-f f-f deleted the add-sidebar branch July 8, 2020 12:33
@klntsky klntsky changed the title Group modules by package in the sidebar: WIP Group modules by package in the sidebar Jul 8, 2020
This was referenced Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants