Skip to content

feat: active pane indicator in split view#29

Merged
emarkou merged 7 commits into
mainfrom
feat/active-pane-indicator
May 14, 2026
Merged

feat: active pane indicator in split view#29
emarkou merged 7 commits into
mainfrom
feat/active-pane-indicator

Conversation

@emarkou

@emarkou emarkou commented May 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add .pane-label--active CSS class: active pane label renders in $accent color + bold
  • Inactive pane label stays in $text-muted (dimmed)
  • arrow retained for non-color terminals
  • Class toggled on every Tab keypress via action_switch_pane
  • Initial state (POST active) set in on_mount

Test plan

  • Open any post, press Enter → POST label highlighted in accent color
  • Press Tab → COMMENTS/README label highlights, POST dims
  • Press Tab again → POST highlights, COMMENTS dims
  • 196 tests pass, ruff + mypy clean, coverage 79% → 82%

Summary by CodeRabbit

  • Style

    • Improved active-pane visual in the post split modal: active label uses an accent background and bold text and defaults to "POST" on open.
  • Tests

    • Added UI tests verifying the active-pane initializes on "POST", toggles to the other pane, and returns after two toggles; removed one obsolete comments test.
  • Chores

    • Updated Reddit integration: bumped user-agent and added hot-feed pagination support.
  • Breaking Changes

    • Removed the full-screen content and comments modals and their public exports.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an active-state style and toggle behavior to PostSplitModal (POST vs README/COMMENTS), updates tests to assert the active-class behavior, removes ContentModal and CommentsModal modules and their public re-exports, and updates Reddit source config (user-agent, hot-with-after URL) and httpx client instantiation.

Changes

PostSplitModal active-state and tests

Layer / File(s) Summary
CSS + mount initialization + pane-switch logic
devskim/widgets/post_split_modal.py
Adds .pane-label--active style, marks #pane-label-post active in on_mount, and rewrites action_switch_pane to update both pane labels' text and toggle pane-label--active between #pane-label-post and #pane-label-comments based on _active_pane/_right_label.
Async DOM-level tests for toggle behavior
tests/test_widgets.py
Adds three async tests that mock PostSplitModal._load_comments and assert: default post pane is active, one action_switch_pane() moves active class to comments pane, and a second call restores post pane active. Also removes the standalone test_comments_modal_comment_widget_render.

Widget removals and package exports

Layer / File(s) Summary
Remove full comment and content modals
devskim/widgets/comments_modal.py (removed), devskim/widgets/content_modal.py (removed)
Deletes CommentsModal, CommentWidget, and ContentModal modules and their implementations (mount/compose/actions/async loading/scroll bindings).
Narrow package exports
devskim/widgets/__init__.py
Removes re-exports for ContentModal and CommentsModal and updates __all__ to ["FeedList", "StoryRow"].

Reddit source config and client behavior

Layer / File(s) Summary
User-agent, hot-with-after URL, and HTTP client setting
devskim/sources/reddit.py
Bumps USER_AGENT to devskim:v0.8.0, adds REDDIT_HOT_AFTER URL template for pagination, and changes httpx.AsyncClient instantiation to http2=False in fetch_reddit_posts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A modal bright with labels two,
POST dons bold and gleams anew.
A hop to comments, a toggle dance,
One more hop and POST gets its chance.
Tests clap softly — all in tune.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a visual active pane indicator to the split view modal, which is the primary feature implemented.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/active-pane-indicator

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.41%. Comparing base (20dee9f) to head (173f00d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   79.30%   82.41%   +3.10%     
==========================================
  Files          18       16       -2     
  Lines        1068      978      -90     
==========================================
- Hits          847      806      -41     
+ Misses        221      172      -49     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_widgets.py`:
- Around line 169-170: The test only asserts the POST label is active; also
query the COMMENTS label (e.g., app.query_one("#pane-label-comments", Label) or
the actual comments label id used elsewhere) and assert that
"pane-label--active" is not in its .classes to ensure COMMENTS is inactive—add
this symmetric assertion right after the existing post_label check to prevent
false positives where both labels could be active.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ab45f26d-7139-45f1-8af0-9509a5f3150f

📥 Commits

Reviewing files that changed from the base of the PR and between 1005709 and c5207de.

📒 Files selected for processing (2)
  • devskim/widgets/post_split_modal.py
  • tests/test_widgets.py

Comment thread tests/test_widgets.py Outdated
emarkou added 4 commits May 13, 2026 15:51
PostSplitModal replaced both modals. Remove the dead files, their
exports, and corresponding tests.

Fix Reddit 403 by passing http2=False to httpx.AsyncClient; Reddit
blocks HTTP/2 connections.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_widgets.py`:
- Around line 92-161: The file tests/test_widgets.py is failing ruff formatting;
run the formatter (e.g., ruff format tests/test_widgets.py or ruff format .) to
fix whitespace/import/format issues in the test functions
(test_post_split_modal_initial_active_class,
test_post_split_modal_switch_pane_toggles_class,
test_post_split_modal_switch_pane_twice_restores) and any patched symbol usage
(PostSplitModal._load_comments), then stage and commit the formatted file so CI
passes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 11b50cac-2e02-414c-b6f2-7b56f97ac829

📥 Commits

Reviewing files that changed from the base of the PR and between 2204998 and bd03616.

📒 Files selected for processing (5)
  • devskim/sources/reddit.py
  • devskim/widgets/__init__.py
  • devskim/widgets/comments_modal.py
  • devskim/widgets/content_modal.py
  • tests/test_widgets.py
💤 Files with no reviewable changes (2)
  • devskim/widgets/content_modal.py
  • devskim/widgets/comments_modal.py

Comment thread tests/test_widgets.py
emarkou and others added 2 commits May 14, 2026 14:32
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
query_one in on_mount was unreliable in CI before children finish
mounting. Setting classes= in Vertical() constructor is race-free.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@emarkou emarkou merged commit 88a92a7 into main May 14, 2026
11 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