Skip to content

[codex] Add activity JSON shortcut#591

Merged
ramimbo merged 2 commits into
ramimbo:mainfrom
Squirbie:codex/activity-json-link
May 28, 2026
Merged

[codex] Add activity JSON shortcut#591
ramimbo merged 2 commits into
ramimbo:mainfrom
Squirbie:codex/activity-json-link

Conversation

@Squirbie
Copy link
Copy Markdown
Contributor

@Squirbie Squirbie commented May 28, 2026

Summary

  • Add a direct activity-page link to the matching /api/v1/activity JSON feed.
  • Preserve the current search query in the JSON link so contributors can inspect the same filtered result set without manually editing URLs.
  • Cover unfiltered, plain filtered, and encoded issue-reference filtered activity-page rendering in tests.

Refs #580.

Evidence

Confusion/bug addressed

The public /activity page and /api/v1/activity feed show the same accepted-work activity surface, but contributors had to manually rewrite the URL to inspect the exact machine-readable result set for the current page.

Bounty capacity checked

Bounty #580 remains open as the active site UX and functional-improvements round, and the maintainer's latest update leaves 2 slots remaining after the paid #596 update.

Intended files/surfaces

  • app/templates/activity.html: add the activity-page JSON inspection link.
  • tests/test_activity.py: cover unfiltered, filtered, and encoded #12 search-link behavior.

Expected PR size

Small focused UI/template behavior plus regression tests only.

Out of scope

No wallet material, private keys, cookies, OAuth state, access tokens, signatures, private data, payout actions, deployment changes, price/liquidity/exchange/off-ramp claims, bridge promises, or fabricated payout claims.

Validation

  • .venv/bin/python -m pytest tests/test_activity.py -q -> 3 passed
  • .venv/bin/python -m ruff check tests/test_activity.py -> passed
  • .venv/bin/python -m ruff format --check tests/test_activity.py -> 1 file already formatted
  • .venv/bin/python -m mypy app/activity.py -> success
  • .venv/bin/python scripts/docs_smoke.py -> docs smoke ok
  • git diff --check origin/main...HEAD -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean merge tree

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

The activity template adds a "View JSON activity" link to /api/v1/activity, conditionally appending the current q parameter (URL-encoded). Tests verify the link on unfiltered and filtered activity pages, including encoded issue-ref queries.

Changes

Activity page JSON link

Layer / File(s) Summary
Activity page JSON link and test verification
app/templates/activity.html, tests/test_activity.py
Template adds a "View JSON activity" link to /api/v1/activity with conditional ?q= appending using Jinja urlencode. Tests assert the link renders for unfiltered (/api/v1/activity) and filtered (/api/v1/activity?q=bob, q=%2312) activity views.

Possibly related PRs

  • ramimbo/mergework#486: Adds hash-prefixed q=%2312 query parsing in the activity serializer; this PR adds the UI link that preserves the current q= parameter when viewing JSON activity.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the changed surface and describes the main change: adding a JSON activity link shortcut to the activity page.
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.
Mergework Public Artifact Hygiene ✅ Passed PR adds technical activity page link to JSON API endpoint with no investment, price, cash-out, off-ramp, payout, or private security claims in template, tests, or commit message.
Bounty Pr Focus ✅ Passed PR changes match stated files. Template adds query-preserving JSON link with aria-label. Tests verify unfiltered, filtered with query params, and URL-encoded cases. Scope is focused.
Description check ✅ Passed The PR description is well-structured, follows the required template sections, and provides comprehensive details including summary, evidence, validation, and scope boundaries.

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


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

@Squirbie Squirbie marked this pull request as ready for review May 28, 2026 19:02
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/test_activity.py (1)

246-253: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add an assertion for encoded-query JSON link in the #12 filtered state.

You validate the #12 filter content, but not that the new JSON shortcut preserves that query in encoded form. Add a regression assertion for the rendered link.

Proposed test addition
     assert issue_ref.status_code == 200
     assert 'value="`#12`"' in issue_ref.text
     assert "Showing accepted work matching “#12”." in issue_ref.text
+    assert 'href="/api/v1/activity?q=%2312">View JSON activity</a>' in issue_ref.text
     assert "github:bob" in issue_ref.text

As per coding guidelines, "tests/**/*.py: Do not request docstrings. Focus on whether tests prove the changed behavior and include negative, replay, boundary, or regression cases where relevant."


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6c46ecf4-ab27-4f35-9925-eafc956bf58e

📥 Commits

Reviewing files that changed from the base of the PR and between 55d5155 and 3a15cd9.

📒 Files selected for processing (2)
  • app/templates/activity.html
  • tests/test_activity.py

Copy link
Copy Markdown

@eliasx45 eliasx45 left a comment

Choose a reason for hiding this comment

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

Reviewed current head 3a15cd92069e6364480de5e106eedacab24a4229.

No blocker found. The PR adds a focused activity-page shortcut from /activity to /api/v1/activity, preserving the active q search value via Jinja urlencode. This improves the maintainer/contributor workflow by making the exact JSON feed reachable from the matching rendered activity view without changing ledger, wallet, payout, auth, or mutation behavior.

Evidence:

  • Inspected app/templates/activity.html and tests/test_activity.py.
  • Confirmed the unfiltered link renders as /api/v1/activity and filtered searches render the preserved query, e.g. /api/v1/activity?q=bob.
  • CodeRabbit's suggested extra assertion for q=%2312 is a useful hardening follow-up, but I do not consider it blocking because the implementation uses the same query | urlencode path and existing activity tests already cover hash issue-ref filtering in the API/page flow.
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_activity.py -q -> 3 passed.
  • .\.venv\Scripts\python.exe -m ruff check tests\test_activity.py -> passed.
  • .\.venv\Scripts\python.exe -m ruff format --check tests\test_activity.py -> 1 file already formatted.
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m mypy app\activity.py -> success.
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe scripts\docs_smoke.py -> docs smoke ok.
  • git diff --check origin/main...HEAD -> clean.
  • git merge-tree --write-tree origin/main HEAD -> clean merge tree.
  • Hosted quality check and CodeRabbit status are green.

Note: I intentionally did not count an accidental Ruff run against the Jinja template as validation, since Ruff parses Python and is not the right tool for .html templates.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

Copy link
Copy Markdown

@eliasx45 eliasx45 left a comment

Choose a reason for hiding this comment

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

Re-reviewed current head 003878d419e20087d512cef3909b2af441b17041 after the test follow-up.

No blocker found. The new commit adds the encoded #12 activity search assertion that CodeRabbit suggested, so the tests now cover unfiltered, plain filtered, and encoded issue-ref filtered JSON shortcut links.

Validation on current head:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_activity.py -q -> 3 passed.
  • .\.venv\Scripts\python.exe -m ruff check tests\test_activity.py -> passed.
  • .\.venv\Scripts\python.exe -m ruff format --check tests\test_activity.py -> 1 file already formatted.
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m mypy app\activity.py -> success.
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe scripts\docs_smoke.py -> docs smoke ok.
  • git diff --check origin/main...HEAD -> clean.
  • git merge-tree --write-tree origin/main HEAD -> clean merge tree.

Approval stands for the current head.

@ramimbo ramimbo merged commit 3f30c9d into ramimbo:main May 28, 2026
2 checks passed
@ramimbo ramimbo added mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants