Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context Menu #949

Merged
merged 33 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
add75de
Move tui code into its own library.
lsmor Jan 10, 2024
d59b37c
Create Menu system. Similar to Brick.Forms
lsmor Feb 15, 2024
eeb2b3f
Extract common functionality
lsmor Feb 27, 2024
06843bf
Context Menu visuals
lsmor Feb 28, 2024
71a3b00
Add visuals for Advance Install
lsmor Feb 28, 2024
e88de9b
migrate #987 to new library
lsmor Feb 7, 2024
7e6ddf8
Add visuals for compile Menu
lsmor Feb 28, 2024
ca67098
Better aesth for context menu
lsmor Feb 28, 2024
5d2784f
Advance Install menu implements functionality.
lsmor Mar 1, 2024
f804c03
Visuals for compiling HLS
lsmor Mar 4, 2024
246851b
untested compileGHC IOAction
lsmor Mar 13, 2024
588cf68
untested compile HLS
lsmor Mar 13, 2024
51b94fb
Execute action only if inputs are valid + better UX
lsmor Mar 13, 2024
9a16dcc
Remove trailing white space
lsmor Mar 16, 2024
f6b948e
fix regression #875 and build system
lsmor Mar 16, 2024
3af3ee0
makes ctrl+c the shourtcut to exit menus + fix trailing new line in e…
lsmor Mar 17, 2024
02e876c
fix #1030. Adds screen reader friendlyness
lsmor Mar 23, 2024
3b4e661
fix unix version in cabal file
lsmor Apr 10, 2024
546c6e4
:drop dependencies between tui and opt by factoring out commmon func
lsmor Apr 11, 2024
9153f21
fix vty version + attributes
lsmor Apr 27, 2024
11d1917
minor refactor, use traverse
dfordivam May 20, 2024
d98a57c
Fix help msg, the "-- " prefix is not necessary in the input text
dfordivam May 20, 2024
9e1a05e
Dont reset the state of Install/Compile submenus
dfordivam May 20, 2024
7b36ce6
Return errors from compileGHC and compileHLS APIs
dfordivam May 20, 2024
aafbf40
Fix HLS compile field label
dfordivam May 28, 2024
5d46492
Reorder the fields in compile HLS menu.
dfordivam May 31, 2024
fe4466a
Move common imports to app-common-depends
dfordivam May 31, 2024
d97246a
Fix build with -tui flag
dfordivam May 31, 2024
1753199
minor fix/cleanup
dfordivam May 31, 2024
8fb4ec0
rebase and port 6c59475 to new Common/Parsers
lsmor Jun 14, 2024
e71ea82
fix tests and hlint
lsmor Jun 18, 2024
3a7a9a7
fix windows build
lsmor Jun 18, 2024
e613ea6
remove dead code
lsmor Jun 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,046 changes: 0 additions & 1,046 deletions app/ghcup/BrickMain.hs

This file was deleted.

3 changes: 2 additions & 1 deletion app/ghcup/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
module Main where

#if defined(BRICK)
import BrickMain ( brickMain )
import GHCup.BrickMain (brickMain)
#endif

import qualified GHCup.GHC as GHC
Expand All @@ -24,6 +24,7 @@ import GHCup.Platform
import GHCup.Types
import GHCup.Types.Optics hiding ( toolRequirements )
import GHCup.Utils
import GHCup.Utils.Parsers (fromVersion)
import GHCup.Prelude
import GHCup.Prelude.Logger
import GHCup.Prelude.String.QQ
Expand Down
62 changes: 55 additions & 7 deletions ghcup.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ common app-common-depends
, haskus-utils-variant ^>=3.3
, megaparsec >=8.0.0 && <9.3
, mtl ^>=2.2
, optics ^>=0.4
, optparse-applicative >=0.15.1.0 && <0.18
, pretty ^>=1.1.3.1
, pretty-terminal ^>=0.1.0.0
Expand All @@ -92,6 +93,7 @@ common app-common-depends
, temporary ^>=1.3
, text ^>=2.0
, time >=1.9.3 && <1.12
, transformers ^>=0.5
, unordered-containers ^>=0.2
, uri-bytestring ^>=0.3.2.2
, utf8-string ^>=1.0
Expand All @@ -109,6 +111,7 @@ common app-common-depends
build-depends: libarchive ^>=3.0.3.0

library
import: app-common-depends
exposed-modules:
GHCup
GHCup.Cabal
Expand Down Expand Up @@ -143,6 +146,7 @@ library
GHCup.Utils.Tar
GHCup.Utils.Tar.Types
GHCup.Utils.URI
GHCup.Utils.Parsers
GHCup.Version

hs-source-dirs: lib
Expand Down Expand Up @@ -193,7 +197,6 @@ library
, lzma-static ^>=5.2.5.3
, megaparsec >=8.0.0 && <9.3
, mtl ^>=2.2
, optics ^>=0.4
, os-release ^>=1.0.0
, pretty ^>=1.1.3.1
, pretty-terminal ^>=0.1.0.0
Expand All @@ -208,10 +211,10 @@ library
, temporary ^>=1.3
, text ^>=2.0
, time >=1.9.3 && <1.12
, transformers ^>=0.5
, unliftio-core ^>=0.2.0.1
, unordered-containers ^>=0.2.10.0
, uri-bytestring ^>=0.3.2.2
, utf8-string ^>=1.0
, vector >=0.12 && <0.14
, versions >=6.0.5 && <6.1
, word8 ^>=0.1.3
Expand Down Expand Up @@ -322,6 +325,55 @@ library ghcup-optparse
else
build-depends: unix ^>=2.7 || ^>=2.8

library ghcup-tui
import: app-common-depends
exposed-modules:
GHCup.BrickMain
GHCup.Brick.Widgets.Navigation
GHCup.Brick.Widgets.Tutorial
GHCup.Brick.Widgets.KeyInfo
GHCup.Brick.Widgets.SectionList
GHCup.Brick.Widgets.Menu
GHCup.Brick.Widgets.Menus.Context
GHCup.Brick.Widgets.Menus.AdvanceInstall
GHCup.Brick.Widgets.Menus.CompileGHC
GHCup.Brick.Widgets.Menus.CompileHLS
GHCup.Brick.Actions
GHCup.Brick.App
GHCup.Brick.BrickState
GHCup.Brick.Attributes
GHCup.Brick.Common

hs-source-dirs: lib-tui
default-language: Haskell2010
default-extensions:
LambdaCase
MultiWayIf
NamedFieldPuns
PackageImports
RecordWildCards
ScopedTypeVariables
StrictData
TupleSections

ghc-options:
-Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
-fwarn-incomplete-record-updates

build-depends:
, ghcup
, brick ^>=2.1
, vty ^>=6.0 || ^>=6.1 || ^>=6.2

if !flag(tui)
buildable: False

if os(windows)
cpp-options: -DIS_WINDOWS

else
build-depends: unix ^>=2.7 || ^>=2.8

executable ghcup
import: app-common-depends
main-is: Main.hs
Expand Down Expand Up @@ -351,12 +403,8 @@ executable ghcup

if flag(tui)
cpp-options: -DBRICK
other-modules: BrickMain
build-depends:
, brick ^>=2.1
, transformers ^>=0.5
, vty ^>=6.0 || ^>=6.1 || ^>=6.2
, optics ^>=0.4
, ghcup-tui

if os(windows)
cpp-options: -DIS_WINDOWS
Expand Down
4 changes: 4 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cradle:
cabal:
- component: "ghcup:lib:ghcup"
path: ./lib
- component: "ghcup:lib:ghcup-optparse"
path: ./lib-opt
- component: "ghcup:lib:ghcup-tui"
path: ./lib-tui
- component: "ghcup:exe:ghcup"
path: ./app/ghcup
- component: "ghcup:lib:ghcup-optparse"
Expand Down
2 changes: 1 addition & 1 deletion lib-opt/GHCup/OptParse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import GHCup.OptParse.ToolRequirements
import GHCup.OptParse.Nuke

import GHCup.Types

import GHCup.Utils.Parsers (gpgParser, downloaderParser, keepOnParser, platformParser, parseUrlSource)
#if !MIN_VERSION_base(4,13,0)
import Control.Monad.Fail ( MonadFail )
#endif
Expand Down
Loading
Loading