nf-core / nf-core/tools

Configbuilder: refactor & clean up code

Open
#4,088 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

command line tools enhancement
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

Description

Some of the code requires refactoring and cleaning up to improve readability and maintainability. Additionally, some screens, e.g. FinalInfraDetails, load slowly and with some visual glitches.

Example

One area for improvement is the handling of button presses.

  • Capturing button presses isn’t consistent; sometimes we are using the @on decorator, other times we are defining a special on_button_pressed method. This could be standardised.
  • Some button press logic is defined globally in the ConfigsCreateApp class, others are defined within the screens they appear on. This makes sense for the back button logic which has the global effect of running self.pop_screen(), but might not be the best place to put other event handlers, and can make it difficult to work out the flow of the app.
  • When next buttons are pushed, many screens run similar code to iterate through the text fields on the screen and add the data to the Pydantic model. This results in some code duplication. Could we clean this up and create a single method that all screens could use?
Tasks
  • Identify places in the app code that could be refactored, consolidated, or otherwise re-written to improve readability and maintainability.
    • The major places for refactoring will be in the utils.py module and any code related to updating and validating the Pydantic model.
  • (Optional) For large refactors, create a sub-issue to track the work
  • Update code accordingly and test

We'll be working on this issue at the 2026 hackathon Sydney hub

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in utils.py and ConfigsCreateApp, then trace the screen code around FinalInfraDetails and the Pydantic model updates and validation. Review the duplicated button handlers and next-button field processing first; done means the refactoring is implemented and the affected code is tested without the reported slow loading or visual glitches.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.