Skip to content

Commit e83646e

Browse files
authored
Merge pull request #443 from gbaz/gb/fewer-left-links
no leftlinks if query specifier given
2 parents ee6f155 + 930c3fc commit e83646e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Action/Server.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ showResults local links haddock args query results = do
200200
H.div ! H.class_ "links" $ H.a ! H.href (H.stringValue link) $ "Uses"
201201
H.div ! H.class_ "from" $ showFroms local haddock is
202202
H.div ! H.class_ "doc newline shut" $ H.preEscapedString targetDocs
203-
H.ul ! H.id "left" $ do
204-
H.li $ H.b "Packages"
205-
mconcat [H.li $ f cat val | (cat,val) <- itemCategories $ concat results, QueryScope True cat val `notElem` query]
203+
H.ul ! H.id "left" $ -- if there's already a scope query we don't show subquery links because bots will get lost in a maze of links.
204+
if (any isQueryScope query) then pure () else do
205+
H.li $ H.b "Packages"
206+
mconcat [H.li $ f cat val | (cat,val) <- itemCategories $ concat results, QueryScope True cat val `notElem` query]
206207

207208
where
208209
useLink :: [Target] -> Maybe String

0 commit comments

Comments
 (0)