Skip to content

claude-code-chat-browser: Remove export_count legacy alias from export state API #63

@clean6378-max-it

Description

@clean6378-max-it

Planned Effort

3 story points — sprint item #4 (Medium): Remove/deprecate export_count legacy alias on GET /api/export/state

One issue → one PR. the-claw benchmarks are a separate issue/PR (Thursday sprint #7).

Depends on

Prerequisite Why
Monday PR merged (#3, #5, #6) CHANGELOG.md, docs/deprecation-policy.md, docs/api-reference.md
Tuesday + Wednesday merged or rebased Green CI (Ubuntu + Windows) on base branch

Problem

GET /api/export/state returns duplicate counters: last_export_session_count (canonical) and export_count (legacy alias). Monday documented the alias as deprecated; the bundled SPA still falls back to export_count in static/js/projects.js, which keeps the duplicate field on the wire indefinitely.

Goal

Complete the migration started Monday: one canonical field in JSON, SPA and tests updated, user-visible change recorded under [Unreleased] in CHANGELOG.md.

Recommended approach (atomic bundled deploy)

Because the SPA ships in the same repo as the API, this single PR should:

  1. Update static/js/projects.js to read only last_export_session_count.
  2. Remove export_count from api/export_api.py response body.
  3. Update tests that assert export_count.
  4. Update docs/api-reference.md (remove alias row and example JSON key).
  5. Add CHANGELOG.md entry under ### Removed (stay in [Unreleased] until v0.1.0 tag — path B).

Policy note: docs/deprecation-policy.md requires two tagged releases for fields external integrators rely on. The bundled SPA is updated in the same merge, so removal is acceptable for this internal contract. If review asks to keep the alias on the wire longer, use Fallback below.

Fallback (deprecate on wire only)

  • Keep export_count in JSON; mark deprecated in api-reference.
  • SPA uses only last_export_session_count.
  • CHANGELOG ### Deprecated with planned removal (e.g. 0.2.0).
  • Tests assert canonical field; optionally assert deprecated alias still present.

Scope — files

File Change
api/export_api.py Remove "export_count": n from get_export_state()
static/js/projects.js Drop ?? exportState.export_count fallback
docs/api-reference.md Remove export_count from field table + example JSON
tests/test_api_routes.py Assert last_export_session_count; remove export_count requirement
tests/test_export_api_bulk.py Same
CHANGELOG.md ### Removed (or ### Deprecated if fallback)

Acceptance Criteria

  • SPA no longer reads export_count
  • Legacy alias removed from API or documented deprecated with sunset per fallback
  • CHANGELOG.md entry under [Unreleased]
  • docs/api-reference.md matches actual response shape
  • pytest -q and npm test green on PR (Ubuntu + Windows if matrix merged)

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions