Skip to content

Latest commit

 

History

History
192 lines (97 loc) · 6.66 KB

new_plan.md

File metadata and controls

192 lines (97 loc) · 6.66 KB

here’s a concrete plan to (a) make the GUI friendlier and more powerful, and (b) expose the rich option set you already have under the hood.

  1. “Export Centre” panel (single place to run everything)

Formats list (auto-discovered): Populate from exporters registry so the UI never hard-codes formats.

Use: list_available_formats(), get_llm_formats(), get_lossless_formats() to label items with badges like LLM-friendly / Lossless.

PythonProjectHelper_report

Right-hand options drawer: When a format is selected, show its specific options (more below).

Run controls: Dry-run preview, Export, Open folder, with progress + log.

Result row: show output path, size, mimetype, and a copy path button.

  1. Schema-driven options (stop hand-wiring widgets)

Expose options by generating the controls from your dataclasses (and reuse across CLI/UI):

Add lightweight metadata to each dataclass field (label, help, group, widget type, choices, default, validators). Example targets from your current plan/spec:

LRCCapsuleOptions: patterns_include, patterns_exclude, tool_codec (zstd_b64|brotli_b64), enable_llm_layers, enable_ast_outline, pii_scrub, redact_ruleset (default|strict|off), deterministic_seed, normalise_eol (LF|KEEP).

PythonProjectHelper_report

Auto-UI builder: reflect the dataclass → choose widget:

Literal[...] → dropdown

bool → switch

list[str] → tokenised entry with add/remove buttons

int/float → spinbox with min/max

patterns_* → multi-line textbox plus a Test glob… button

Validation & help: per-field inline errors and hover tooltips from metadata.

Profiles: save/load Option Profiles (JSON) that capture the entire option set for a format; pin favourites to the Export Centre.

This keeps the GUI in lockstep with your dataclasses and options used by the CLI steps (e.g., --include, --exclude, --pii-scrub, --tool-codec, etc.).

PythonProjectHelper_report

  1. Format-specific pages (example: LRC Capsule)

LRC has multiple toggles and a clear flow; give it a first-class sub-page:

Sections: File selection, Safety, Codecs & Layers, Determinism, Integrity.

Safety: pii_scrub, redact_ruleset with an info box explaining the privacy trade-offs.

Layers: switches for enable_llm_layers, enable_ast_outline, enable_tds with one-line summaries of size/quality impacts.

Determinism: deterministic_seed, normalise_eol (explain reproducibility).

Integrity: read-only note that a Merkle tree is included; checkbox to show integrity preview post-export.

PythonProjectHelper_report

Dry-run preview: show what would be included (counts, example matches from include/exclude, redaction rules summary).

One-click presets: LLM-compact, LLM-max context, Archival w/ lossless tool-codec.

  1. Menus & navigation tidy-up (Tk/ttk)

Top menu:

File → Open Project, Recent Projects, Export…

Edit → Preferences, Reset UI Layout

View → Export Centre, Analysis Summary, Logs

Tools → Validate Patterns, Benchmark Export, Clear Cache

Left sidebar: Project browser (tree) + quick filters (code, configs, docs).

Main content tabs: Export Centre, Analysis Summary, Call/Dependency maps, Settings.

Status bar: current project, PythonProjectHelper version, scan status.

(Your PyInstaller spec shows Tkinter/ttk packaging, so this fits neatly.)

PythonProjectHelper_report

  1. Make formats truly pluggable in the GUI

You already have a clean exporter interface + registry; let the GUI consume it:

At startup, query registry → formats list.

For each exporter, ask for an options schema (add a tiny describe_options() method or a module-level JSON schema alongside the exporter).

Render widgets from schema, then pass a dict to render(analysis, options) when running the export.

PythonProjectHelper_report

  1. Expose more options without clutter (“Progressive disclosure”)

Basic / Advanced switch in every panel.

Basic shows the 6–8 most common toggles (profiles decide which).

Advanced reveals the full generated set (from dataclass/schema).

Inline search (“type to filter options”).

Dependency hints (e.g., enabling AST outline disables content TDS if not applicable).

Per-format learn-more footers linking to docs or your “new_plan.md” notes (useful for LRC explanation).

PythonProjectHelper_report

  1. Safer defaults and guard-rails (clarify what’s shared)

Your report content distinguishes analysis-only vs full-content exports. Reflect this in UI copy:

Badges & warnings:

Analysis only → “safe to share; no source code exposed”

Full content → “contains full code; review before sharing”

Confirmation modal before full-content export.

PythonProjectHelper_report

  1. Fast feedback loops

Preview panel per format (JSON/Markdown/txt). Show first 2–3 KB and a Save preview button.

Performance estimates: small line under the Export button (“est. size/time based on last run”).

Logs tab with copy-to-clipboard and Include logs in bug report.

  1. Preferences (global)

Default export folder, remember last project, telemetry/log level, theme (light/dark/CTk-style), concurrency.

Profiles location (folder where .json profiles are stored).

Reset to sensible defaults button.

  1. CLI ↔ GUI parity

Everything you expose in the GUI should map 1:1 to CLI flags for headless use (your LRC CLI sketch already outlines flags like --include, --exclude, --pii-scrub, --tool-codec). Keep names identical to reduce cognitive load.

PythonProjectHelper_report

Implementation notes (quick start for Codex)

Add a tiny “options schema” helper

For each dataclass (e.g., LRCCapsuleOptions), provide a to_schema() that returns a JSON-serialisable structure with fields, types, choices, defaults, help text → the GUI builder consumes that.

PythonProjectHelper_report

GUI builder

Create ui/options_renderer.py that takes the schema and returns a Tk/ttk frame of widgets bound to a dict (StringVar/IntVar/BooleanVar), plus validation callbacks.

Export Centre

ui/export_center.py

Gets format names via list_available_formats(); badges from get_llm_formats() and get_lossless_formats().

On select → options_renderer for that exporter’s schema; on run → call exporter’s render().

PythonProjectHelper_report

Profiles

profiles/ directory with {format_name}/*.json.

Buttons: Save Profile, Load Profile, Set as Default.

Attach to the same dict used by options_renderer so state round-trips cleanly.

Dry-run & Preview

Wire a Dry-run button that executes the path/selection logic but stops before serialising; show counts, example matched files, and a short preview (if the exporter supports render_preview(); otherwise show a generated summary).

Warnings

When a format’s is_lossless() is true, show a privacy warning (full content likely included in your FullContent exporters).

PythonProjectHelper_report