Skip to content

feat(tui): add spacebar flagging and fix unrated flag scoring - #32

Merged
Kilo59 merged 11 commits into
mainfrom
release/v0.1.0a6
Aug 9, 2026
Merged

Kilo59 merged 11 commits into
mainfrom
release/v0.1.0a6

Conversation

@Kilo59

@Kilo59 Kilo59 commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

Summary by Sourcery

Add spacebar-based flagging across main table, lineup, and interrogation screens, refine scoring/metadata handling for flagged unrated titles, and publish expanded documentation with updated project metadata for version 0.1.0a6.

New Features:

  • Introduce a global spacebar keybinding to toggle follow-up flags on titles in the main DataTable, Lineup screen, and Interrogation Room, including a Flag button in the Lineup actions.
  • Expose a helper on ManualMetadata to indicate presence of rating data so manual flag-only records no longer create artificial base quality scores.

Bug Fixes:

  • Ensure flagging an unrated title does not assign a default quality score, preserving N/A suitability and rendering flagged titles as '(Flagged) Not Found' until rated.

Enhancements:

  • Surface follow-up flag state directly in table cell content and notifications when toggling flags.
  • Improve scoring mode documentation with detailed explanations, guidance, and calibration tips integrated across TUI walkthrough, onboarding, and troubleshooting guides.
  • Clarify keyboard shortcut references in README, help screen, and guides, including the new Space flag shortcut and cross-linking to documentation.

Build:

  • Update project URLs in pyproject.toml to point to the hosted documentation site and repository, and bump version to 0.1.0a6.
  • Configure documentation editing link in zensical/MkDocs config for easier docs maintenance.

Documentation:

  • Add and cross-link a comprehensive documentation hub with getting started guides, TUI walkthrough, storage & sync, and troubleshooting FAQ.
  • Expand scoring mode sections with mathematical details, safety philosophy, and recommended calibration strategies using title pinning.
  • Update README and TUI walkthrough to reference new docs, installation paths, scoring modes, and the spacebar flag shortcut, plus refresh screenshots/assets.

Tests:

  • Add tests for spacebar flag toggling behavior in the main DataTable, Lineup screen, and Interrogation Room checkbox interaction.
  • Add tests verifying EvidenceLocker.toggle_flag_title behavior and merge_metadata handling for flag-only manual records without rating data.

Chores:

  • Refresh generated documentation assets (TUI screenshots) and lockfile to reflect the new release and docs site setup.

Kilo59 added 6 commits August 9, 2026 18:28
Provide comprehensive details on scoring mode mechanics and trade-offs. Emphasize the 'pin a title' feature in the Live Weight Impact Preview as a key calibration strategy, offering clearer guidance for users to optimize their settings during onboarding and preferences.
@sourcery-ai

sourcery-ai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implements a global spacebar shortcut to toggle a "flag for follow-up" state across the main DataTable, Lineup, and Interrogation Room, wires it into the Evidence Locker and evaluation pipeline, and refreshes docs, help text, screenshots, and packaging metadata for the new flagging workflow and scoring mode guidance while bumping the version to 0.1.0a6.

Sequence diagram for spacebar flag toggle in main DataTable

sequenceDiagram
    actor User
    participant NetflixNarcApp
    participant DataTable
    participant EvidenceLocker

    User->>NetflixNarcApp: press Space
    NetflixNarcApp->>DataTable: query_one(DataTable)
    NetflixNarcApp->>DataTable: coordinate_to_cell_key(cursor_coordinate)
    NetflixNarcApp->>NetflixNarcApp: derive base_title
    NetflixNarcApp->>EvidenceLocker: toggle_flag_title(base_title)
    EvidenceLocker-->>NetflixNarcApp: new_state
    NetflixNarcApp->>NetflixNarcApp: refresh_title(base_title)
    NetflixNarcApp->>User: notify("Flagged"/"Unflagged" for follow-up)
Loading

File-Level Changes

Change Details Files
Add a global spacebar-driven flag toggle workflow backed by the Evidence Locker and reflected in table rendering and notifications.
  • Bind the space key to a new toggle_flag action in the main NetflixNarcApp and LineupScreen.
  • Implement NetflixNarcApp.action_toggle_flag to resolve the selected row’s base title (including child-row keys), toggle its flagged_for_followup state in the Evidence Locker, refresh the title, and notify the user.
  • Implement LineupScreen.action_toggle_flag and wire the new Flag [Space] button to it via async background task handling.
  • Update evaluation display so manually flagged titles always prepend a (Flagged) tag, including Not Found cases.
src/netflix_narc/main.py
src/netflix_narc/lineup.py
src/netflix_narc/evaluator.py
Extend Interrogation Room UX to support spacebar-based flag toggling without interfering with text inputs.
  • Add a space binding on InterrogationRoomScreen mapped to a new toggle_flag action.
  • Implement action_toggle_flag to invert the 'Flag for future follow-up' checkbox when focus is not on an Input widget.
src/netflix_narc/interrogation_room.py
Add Evidence Locker support for flag-only records and avoid creating artificial ratings for unrated flagged titles.
  • Introduce ManualMetadata.has_rating_data helper to signal presence of rating/score metadata.
  • Change merge_metadata to return None when api metadata is absent and manual metadata only carries a follow-up flag (no rating data).
  • Add toggle_flag_title method to EvidenceLocker to flip flagged_for_followup for a title, creating a new ManualMetadata if needed.
src/netflix_narc/manual_db.py
src/netflix_narc/evaluator.py
Improve documentation and help around keybindings, scoring modes, calibration, and link all major workflows into the docs site.
  • Add a Documentation section and deep-link feature bullets and workflows from README into specific guides.
  • Document the Space keybinding and follow-up flag behavior in README, help screen, and TUI walkthrough keyboard tables.
  • Expand scoring mode explanations in the TUI walkthrough and onboarding/troubleshooting guides, including stricter vs balanced behavior and calibration tips using pinned titles.
  • Update docs index to reference scoring mode docs and pin-title calibration language, and enable edit_uri in the docs site config for direct editing.
README.md
docs/guides/tui-walkthrough.md
docs/guides/troubleshooting-faq.md
docs/guides/onboarding-and-setup.md
docs/index.md
src/netflix_narc/help_screen.py
zensical.toml
Add tests to cover the new flagging workflow across DataTable, Lineup, Interrogation Room, Evidence Locker, and metadata merging edge cases.
  • Add tests for spacebar flag toggling in the main DataTable and its reflection in Evidence Locker state and cell content.
  • Add tests for spacebar toggling of the Interrogation Room flag checkbox.
  • Add tests for lineup flagging via the Flag button and its persistence in Evidence Locker.
  • Add tests for EvidenceLocker.toggle_flag_title behavior and merge_metadata handling of flag-only manual records.
tests/test_main.py
tests/test_interrogation_room.py
tests/test_lineup.py
tests/test_manual_db.py
tests/test_evaluation.py
Bump project version and align packaging and site metadata with the new documentation homepage and URLs; refresh TUI screenshots.
  • Increment project version from 0.1.0a5 to 0.1.0a6 in pyproject.toml and document the release in CHANGELOG.md with feature and fix notes.
  • Update project.urls in pyproject.toml to point Homepage and Documentation at the docs site and add a Repository URL.
  • Refresh TUI screenshot assets to match the current UI/help content.
  • Update uv.lock and docs index/features copy to reflect the new scoring mode guidance and calibration language.
pyproject.toml
CHANGELOG.md
docs/assets/images/datatable_expanded.svg
docs/assets/images/help_screen.svg
docs/assets/images/interrogation_screen.svg
docs/assets/images/lineup_screen.svg
docs/assets/images/preferences_screen.svg
uv.lock
docs/index.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.03704% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.27%. Comparing base (e0fe801) to head (d6b7d51).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/netflix_narc/main.py 82.60% 4 Missing ⚠️
src/netflix_narc/interrogation_room.py 60.00% 2 Missing ⚠️
src/netflix_narc/lineup.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #32      +/-   ##
==========================================
+ Coverage   87.25%   87.27%   +0.02%     
==========================================
  Files          25       25              
  Lines        2896     2948      +52     
==========================================
+ Hits         2527     2573      +46     
- Misses        369      375       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Kilo59
Kilo59 marked this pull request as ready for review August 9, 2026 22:57

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/netflix_narc/evaluator.py" line_range="651-652" />
<code_context>
         return api_metadata

     if not merge_manual_data or api_metadata is None:
+        if not manual_record.has_rating_data:
+            return api_metadata
         return manual_record.to_normalized_metadata()
</code_context>
<issue_to_address>
**issue (bug_risk):** Guard against `manual_record` being `None` before accessing `has_rating_data`.

In this branch `manual_record` may be `None` (e.g., when there is no manual entry), so `manual_record.has_rating_data` will raise an exception. Add a guard, e.g. `if manual_record is None or not manual_record.has_rating_data:`, to preserve the previous behavior and avoid the crash.
</issue_to_address>

### Comment 2
<location path="docs/guides/tui-walkthrough.md" line_range="33" />
<code_context>
+| **Lineup Queue** | <kbd>Space</kbd> | **Flag for Follow-up** | Toggle flag for future follow-up on current card title. |
 | **Lineup Queue** | <kbd>x</kbd> | **Ignore Title** | Mark current title as ignored and advance to next item. |
 | **Lineup Queue** | <kbd>s</kbd> | **Skip Title** | Skip current title without modifying its status. |
+| **Interrogation** | <kbd>Space</kbd> | **Flag for Follow-up** | Toggle 'Flag for future follow-up' checkbox (when form input non-focused). |
 | **Interrogation** | <kbd>F2</kbd> | **Web Search** | Open Common Sense Media search for title in default browser. |
 | **Modals / Screens** | <kbd>Esc</kbd> | **Close / Back** | Dismiss current screen or modal dialog without saving changes. |
</code_context>
<issue_to_address>
**suggestion (typo):** Clarify the phrase "when form input non-focused" for grammatical correctness.

Please rephrase this condition to improve clarity, e.g. "when no form input is focused" or "when the form input is not focused."

```suggestion
| **Interrogation** | <kbd>Space</kbd> | **Flag for Follow-up** | Toggle 'Flag for future follow-up' checkbox (when no form input is focused). |
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/netflix_narc/evaluator.py Outdated
Comment thread docs/guides/tui-walkthrough.md Outdated
@Kilo59

Kilo59 commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@sourcery-ai title

@sourcery-ai sourcery-ai Bot changed the title feat: add spacebar flag shortcut and bump version to 0.1.0a6 feat(tui): add spacebar flagging and fix unrated flag scoring Aug 9, 2026
@Kilo59
Kilo59 merged commit 704fbd7 into main Aug 9, 2026
9 of 10 checks passed
@Kilo59
Kilo59 deleted the release/v0.1.0a6 branch August 9, 2026 23:10
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