Discard an old search preview when a starter changes the topic
Opened by @shuxiachai · Assignees: None
Claim Status & GitHub Signal
Unassigned, with 2 comments. Unassigned does not guarantee unclaimed—read comments and linked PRs first.
The issue involves modifying existing functionality and ensuring that the application behaves correctly when changing topics. It requires understanding of the codebase and some testing, but it is manageable for someone with basic experience in JavaScript and API interactions.
What It's About
The issue is about invalidating an old search preview when a user changes the topic by selecting a starter, ensuring that the application does not attempt to submit outdated information.
Why It Matters
This fix is important to prevent incorrect submissions that could waste resources and ensure a smooth user experience when switching topics in the application.
Expected Outcome
The application should correctly remove the old search preview and Start control when a new topic is selected, and the new topic should be ready for preview and submission without errors.
Log in to compare this issue's requirements against your profile skills. Required concepts: JavaScript, API interactions, Event handling, Testing, Frontend development.
Progressive AI Hints
Hint #1 is always free and calibrated to your experience level. Extra hints unlock with coins without spoiling the full solution.
Skill-Gap Learning
Issue Description
Why
On a workbench where search previews are enabled, manually editing the topic clears a preview for a different topic. Clicking a starter replaces the topic without going through that check. In the offline composer contract, previewing hyperloop for regional freight and then choosing the solid-state batteries starter left the old Start control visible. Clicking it attempted to submit the hyperloop topic and search phrase even though the composer now showed batteries. Both requests were intercepted. A real run could use the daily allowance or provider credits on the wrong assessment. Topic and starter handlers · Start from preview
Task
Invalidate the existing search preview when a starter changes its topic. The user can then ask for a preview of the new topic and confirm it through the existing flow.
Done when
- After previewing topic A, choosing a starter for topic B shows topic B and immediately removes A's preview and Start control. Choosing the starter alone issues no request.
- An old Start action from A can no longer send a run request. Asking to preview B reads B, and confirming B sends B with its own search phrase.
- Extend the offline composer contract with a real starter handler and intercepted
/api/planand/api/runsrequests. Assert the topic and search-plan payload at the request boundary. Composer fixture · Existing preview contract
Read the contribution guide and comment here before starting. Keep the PR focused and to one commit.
Linked Pull Requests (0)
No linked or cross-referenced pull requests detected via GitHub timeline. Check comments below for informal claims before starting.
GitHub Comments (2)
I'd like to take this one. I'll have a starter that changes the topic drop the stale preview the same way a typed edit does (so its Start control goes away and the click itself requests nothing), and add a composer contract case with the real starter handler that checks the /api/plan and /api/runs payloads.
Thanks, @leninworld — it's yours.
Issue Troubleshooting Threads (0)
No troubleshooting threads opened for this issue yet. If you hit a test, build, or navigation blocker, post what you've tried so fellow contributors can help.
PR Verification & Rewards
Sign in and link GitHub to verify your PR against this issue and earn XP + coins.
Contribution Workflow
Track your local progress before opening a pull request on GitHub.
Repository Context
Top Repository Paths
CONTRIBUTING.md Excerpt
Contributing
Read AGENTS.md first. It is a decision index: several seemingly obvious changes have already been rejected on measured evidence. Use the documentation map for current guides and historical results.
For a first contribution, the map below is enough; read AGENTS.md before changing pipeline, scoring or experiment code.
Where newcomers can work
Look for issues labelled
good first issue
or help wanted.
Comment on one before you start, so two people don't take the same issue.
You can hold up to five at a time, counting the ones whose pull request is
still open. If three days pass after your claim without a pull request, or
after a review that asks for changes without a reply or a push, the issue
goes back to the pool; a maintainer may also finish an open pull request on
its branch, keeping you as its author. You need no API keys: the test suite
and the browser smokes make no paid requests.
| Where | |
|---|---|
| Good for a first PR | The main web client (web/index.html, web/samples.html, web/static/; new UI strings go in web/static/js/i18n.js, in English and Chinese); ui/ readers and PDF export; current guides (README*, CONTRIBUTING.md, docs/operating-guide.md, docs/README.md); new tests in tests/ and e2e/; new tools under scripts/ |
| Open an issue first | Production pipeline and retrieval (src/academic_agent/crew.py, source_pipeline.py, config/); API access, BYOK and billing boundaries in api/; anything that changes scores, prompts or providers |
| Do not change | src/academic_agent/evidence.py (frozen experiments hash its bytes, and their tests fail on any edit; to change its behaviour, wrap it as reviewer_plan_bounds.py does); AGENTS.md, the maintainer's instructions to assistants; the experimental pages web/saved-source-*/ and web/source-locator/; the experiment scripts under experiments/ and the experimental modules in src/academic_agent/ (their paths and bytes are bound the same way); dated documents docs/prereg-*, docs/results-*, docs/errata-*, docs/protocol-*; fixtures in tests/fixtures/, evals/ and benchmark_fixtures/. Touch pyproject.toml and `u |
... (truncated)
Advisory PR Assistant
Helps structure your PR description or unpack reviewer feedback. Does not perform GitHub actions.