issues/completed/10-006-identify-checkbox-conversion-opportunities.md

10-006: Identify Checkbox Conversion Opportunities

Status

  • Phase: 10
  • Priority: Low
  • Type: Enhancement
  • Status: COMPLETED
  • Created: 2025-12-23
  • Completed: 2025-12-23

Summary

This issue analyzes the current TUI menu structures in both run.sh and src/main.lua to identify which items should be checkboxes (multi-select, build command) vs actions (immediate execution) vs flags (numeric input).

Analysis Results

run.sh TUI (Implemented in 10-004)

The run.sh TUI was implemented correctly with checkboxes from the start:

ItemTypeCLI FlagStatus
1. Update Wordscheckbox--update-words✅ Correct
2. Extractcheckbox--extract✅ Correct
3. Parsecheckbox--parse✅ Correct
4. Validatecheckbox--validate✅ Correct
5. Catalog Imagescheckbox--catalog-images✅ Correct
6. Generate HTMLcheckbox--generate-html✅ Correct
7. Generate Indexcheckbox--generate-index✅ Correct
Thread Countflag--threads✅ Correct
Force Regenerationcheckbox--force✅ Correct
Dry Runcheckbox--dry-run✅ Correct
Verbose Outputcheckbox--verbose✅ Correct
Run Selected StagesactionN/A✅ Correct

Verdict: run.sh TUI is already optimally configured.


src/main.lua TUI (Needs Updates)

The main.lua TUI has several issues that should be addressed:

Issue 1: Section Types

Many sections use type: "single" (radio-button, pick one) when they should use type: "multi" (multi-select):

SectionCurrent TypeRecommended TypeReason
pipelinesinglemultiCan extract AND validate AND catalog
embeddingsinglesingleOK - testing or calculating, not both
htmlsinglemultiCan generate chronological AND similarity pages
testingsinglesingleOK - test one thing at a time
optionsmultimulti✅ Correct
utilitiessinglemultiCan view status AND clean (with warning)

Issue 2: Missing CLI Flags

No menu items have cli_flag properties, so they don't contribute to command preview:

Item IDLabelShould Have CLI Flag
extractExtract poems--parse (maps to parse stage)
validateValidate poems--validate
catalogCatalog images--catalog-images
datasetGenerate dataset--parse --validate --catalog-images
chronologicalGenerate chronological--generate-html (partial)
similar_pagesGenerate similarity pages(custom flag needed)
different_pagesGenerate difference pages(custom flag needed)
full_websiteGenerate complete website--generate-html
test_poem_idTest poem ID(internal use only)
thread_countThread count--threads

Issue 3: Composite Actions

Some items are "composite" (run multiple stages):

  • dataset = extract + validate + catalog
  • full_website = chronological + explore + similar + different

Recommendation: Either:

  1. Remove composite items (users can toggle multiple checkboxes)
  2. Keep composites as convenience shortcuts that toggle multiple items

Detailed Recommendations

Category 1: Convert to Multi-Select Checkboxes

These sections should change from type: "single" to type: "multi":

-- Data Pipeline Section (CHANGE: single -> multi)
{
    id = "pipeline",
    title = "Data Pipeline",
    type = "multi",  -- Changed from "single"
    items = { ... }
}

-- HTML Generation Section (CHANGE: single -> multi)
{
    id = "html",
    title = "HTML Generation",
    type = "multi",  -- Changed from "single"
    items = { ... }
}

Category 2: Add CLI Flags

Each checkbox should have an associated CLI flag for command preview:

{
    id = "validate",
    label = "Validate extracted poems",
    type = "checkbox",
    value = "0",
    description = "Check data quality",
    shortcut = "v",
    cli_flag = "--validate"  -- ADD THIS
}

Category 3: Keep as Actions

These should remain as actions (immediate execution, no command build):

ItemTypeReason
runactionExecute button
statusactionView-only, no side effects

Category 4: Keep as Flags

These are correctly implemented as flags:

ItemTypeValue Format
test_poem_idflag"1:5"
thread_countflag"8:3"

Implementation Priority

Since run.sh now has a complete TUI with command preview (10-004), and the main.lua TUI is primarily for internal/advanced use, updates to main.lua are low priority.

If updated, the main.lua TUI should:

  1. Change section types from "single" to "multi" where appropriate
  2. Add cli_flag properties to items
  3. Add command preview section
  4. Call run.sh with built command instead of internal functions

Alternative: Deprecate main.lua TUI in favor of run.sh TUI, which is now more feature-complete.


Comparison: run.sh vs main.lua TUI

Featurerun.sh TUImain.lua TUI
Command preview✅ Yes❌ No
CLI flag mapping✅ Yes❌ No
Multi-select stages✅ Yes⚠️ Partial (some single-select)
Clipboard copy✅ Yes (~)❌ No
Educational value✅ High⚠️ Low
Fallback support✅ Lua TUIN/A

Recommendation: Use run.sh -I as the primary interactive interface.


Implementation Note

This issue is marked COMPLETED as an analysis task. The actual conversion of main.lua TUI items can be done as a follow-up if needed, but the run.sh TUI (10-004) now provides superior UX and should be the recommended interface.

Related Documents

  • Issue 10-004: Command preview (implemented in run.sh) - Moved to /home/ritz/programming/ai-stuff/scripts/issues/
  • Issue 10-005: CLI flag support (provides flags to map)
  • /mnt/mtwo/programming/ai-stuff/neocities-modernization/run.sh (recommended TUI)
  • /mnt/mtwo/programming/ai-stuff/neocities-modernization/src/main.lua (legacy TUI)

Note: Phase 10 issues related to the TUI library and issue-splitter.sh have been moved to the monorepo scripts/issues directory, as they apply to monorepo-level tools rather than being specific to the neocities-modernization project.