Generate and manage clues
Context
Implements #7 (closed).
In images:
One-shot grid and clues generation
What has changed?
Main Changes
common
- Added clues to
Puzzle
type.
spi-clue
- Created.
clue-openai-plugin
- Created.
- Requires an OpenAI API key to function.
core
- Added
ClueService
allowing to get clues for one or more words. - Added the possibility to
ClueService
to generate clues after a grid is successfully solved, in a single request.
puzzle-repository-*
- Save clues.
cli
- Added
clue get WORD [WORD...]
andclue list-providers
subcommands to respectively get clues and list the clue providers. - Added
--clues
option tosolver run
subcommand to solve a grid and generate clues in a single command.
gui-view-model
- Added
CluesViewModel
managing the state of the clue-related views. - Added
SlotsViewModel
based on box data ofCrosswordGridViewModel
. - Bound selected clue with selected slot.
gui-view
- Added
CluesPane
listing the clues. - Introduced a
ClueListCell
which, like the crossword grid boxes, has two texts: The main text is the user content and the prompt text is the system content (i.e. the content given by clue provider). - Added the possibility to generate a clue for the selected slot with a button on the
ClueListCell
. - Allowed to configure solver to generate clues for the solution found, via the
SolveSplitMenuButton
.
gui-controller
- Added controller for the
ClueService
. - Adjusted
SolverController
to pass the information whether clues should be generated upon solver success.
gui-presenter
- Implemented
CluePresenter
.
gui
- Bound new view models to views.
Reviewers
Code has already been reviewed through several smaller MRs (see #7 (closed) for the complete list). This last big MR gives the whole picture and is the occasion to see if everything fits. Hopefully, no big issue will be raised here.
Edited by Antoine Belvire