Skip to content

GUI: launch on bare invocation + implement Enrich and Deck tabs#11

Merged
JE-Chen merged 2 commits into
mainfrom
dev
May 19, 2026
Merged

GUI: launch on bare invocation + implement Enrich and Deck tabs#11
JE-Chen merged 2 commits into
mainfrom
dev

Conversation

@JE-Chen
Copy link
Copy Markdown
Member

@JE-Chen JE-Chen commented May 19, 2026

Summary

Two related GUI improvements that land together because they share the same surface.

  • Bare autopapertoppt (no args) now launches the GUI. Users running autopapertoppt / autopapertoppt.exe alone used to hit one of the arguments --query/-q --paper/-p --pdf is required because the mutex group is required=True. The obvious "just open the app" gesture errored. Pre-parse in cli.main() now treats an empty argv identically to the existing gui subcommand — both dispatch to autopapertoppt.gui.app:main via _dispatch_gui. --help epilog points at the three GUI launch routes.
  • EnrichPage is now functional. Takes the active PaperCollection, walks every paper through intelligence.fetch_and_extract + intelligence.summarise_paper on a worker thread, builds an enriched collection with rich-tier PaperSummary per paper. Sequential per paper (Anthropic latency + rate-limit friendly); per-paper failures don't kill the run; papers without pdf_url are marked "skipped" but kept in the output. ANTHROPIC_API_KEY check fires at click-time with a clear "open Settings" hint when missing.
  • DeckPage is now functional. Granular export controls supplementing the Search tab's one-button Export: output dir + filename stem + language picker, per-format checkboxes (pptx/xlsx/bib/md/json), max-slides spin (0 = unlimited), include-abstract toggle. Generated paths show in a table with an "Open folder" button (uses QDesktopServices). Status differentiates "lightweight" vs "thesis-style (enriched)" so the user knows what they're about to export.
  • Inter-tab data flow. SearchPage.collection_ready = Signal(object) emits when a search completes. MainWindow wires Search → Enrich, Search → Deck (skip-enrich path), and Enrich → Deck (enriched takes precedence). No polling, no manual refresh.
  • i18n. 35 new enrich.* + deck.* keys × 14 supported languages = 490 entries. The 14-language parity test enforces every key has every language.

Test plan

  • py -m pytest tests/ — 510 passed (was 496 + 14 new across CLI regression / Enrich / Deck)
  • py -m pytest tests/gui/ — 71 passed (was 59 + 12 new)
  • py -m pytest tests/test_i18n.py — 14-language parity guard green for every new key
  • py -m ruff check . — clean
  • py -m bandit -c pyproject.toml -r autopapertoppt/ sources/ scripts/ — 0 issues
  • Manual: launch autopapertoppt (no args) and confirm Search→Enrich→Deck flow on a small --max 3 arxiv query with ANTHROPIC_API_KEY set
  • Manual: confirm the "Open folder" button opens the OS file manager at the export directory

JE-Chen added 2 commits May 20, 2026 01:37
Regression: users running 'autopapertoppt' / 'autopapertoppt.exe' alone
hit 'one of the arguments --query/-q --paper/-p --pdf is required'
because the mutex group is required=True. The obvious "just open the app"
gesture errored instead of launching the GUI, even though the GUI extra
ships an entry point that does exactly that.

Pre-parse in cli.main() now treats an empty argv the same as 'gui' —
both dispatch to autopapertoppt.gui.app.main via _dispatch_gui. The
existing 'gui' subcommand still works and still forwards trailing
tokens (e.g. 'autopapertoppt gui --debug') to the GUI's own argv.

When the [gui] extra isn't installed, _dispatch_gui prints the existing
"pip install autopapertoppt[gui]" hint and exits 2 — same as before.

Also add an epilog to the argparse parser pointing at the three GUI
launch routes (bare, 'gui' subcommand, autopapertoppt-gui entry point)
so users running --help see the option without having to read the README.

Tests:
  test_cli_bare_invocation_dispatches_gui — empty argv → GUI dispatcher
  test_cli_gui_subcommand_dispatches_gui   — 'gui' + tokens → forwards
Both tabs used to be PlaceholderPage stubs; this lands the full
implementation so the GUI shell stops advertising "comes in a follow-up"
in the README and produces the same outputs the CLI does.

autopapertoppt/gui/pages/enrich.py — EnrichPage:
  Walks every paper in the active PaperCollection through
  intelligence.fetch_and_extract + intelligence.summarise_paper. Settings
  surface the deck language + an optional Anthropic model override.
  Sequential (not parallel) because each Anthropic call already takes
  ~10 s and parallelism would just stress the user's rate limit. Papers
  without pdf_url are marked "skipped" but kept in the output collection;
  per-paper failures don't kill the whole run. ANTHROPIC_API_KEY check
  fires at click-time, not load-time, so the tab opens cleanly without
  a key configured.

autopapertoppt/gui/pages/deck.py — DeckPage:
  Granular export controls that supplement the Search tab's one-button
  Export: output directory + filename stem + language picker, per-format
  checkboxes (pptx / xlsx / bib / md / json), max-slides spin (0 = no
  cap), include-abstract toggle. Shows a list of generated paths with an
  "Open folder" button that uses QDesktopServices for the OS file
  manager. Distinguishes "lightweight" vs "thesis-style (enriched)" in
  the ready status so the user knows what they're about to export.

autopapertoppt/gui/pages/search.py:
  New Signal(object) collection_ready, emitted whenever a search
  completes. Lets the new tabs react without polling.

autopapertoppt/gui/main_window.py:
  Replaces the two PlaceholderPage stubs with EnrichPage + DeckPage.
  Wires the inter-tab data flow:
    Search.collection_ready -> Enrich.set_collection
    Search.collection_ready -> Deck.set_collection  (skip-enrich path)
    Enrich.collection_ready -> Deck.set_collection  (enriched takes precedence)

autopapertoppt/gui/i18n.py:
  Adds ~35 new keys (enrich.* + deck.*) across all 14 supported
  languages. The 14-language parity test in tests/test_i18n.py is the
  hard contract — every key has every language.

tests/gui/test_enrich_page.py + test_deck_page.py:
  12 new tests covering: initial-state disabled, set_collection enables
  the action button, no-API-key surfaces a Settings hint, happy-path
  enrich attaches summaries, paper-without-pdf-url skipped, signal
  emission, Deck export wiring (format checkboxes → ExportOptions),
  raw-vs-enriched status differentiation.

All 510 tests pass; ruff + bandit clean.
@JE-Chen JE-Chen merged commit d344c61 into main May 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant