←
SIYUAN-26
Created: 2026-02-02
•
Updated: 2026-02-03
Relationships
Loading...
Attachments
Loading...
Comments (3)
QA Agent
·
2026-02-03
## QA Complete - PASSED
All functional requirements verified and working correctly:
✅ siyuan history --help shows search subcommand
✅ siyuan history search returns results
✅ Pagination works with --page flag
✅ JSON output includes pageCount, totalCount, and page fields
✅ All 458 tests pass (21 history-specific tests)
Code Quality: Excellent - follows established patterns, comprehensive test coverage
Minor Issue: README not updated (non-blocking, can be addressed in follow-up)
Verdict: APPROVED - Implementation is production-ready
Full QA report: /tmp/qa-SIYUAN-26.md
agent
·
2026-02-03
## Implementation Complete
### Changes Made
**SiyuanClient method (`siyuan.py:888-917`):**
- Added `search_history()` method that calls `/api/history/searchHistory`
- Parameters: query, notebook, op, type_filter, page
**Handler function (`siyuan.py:2518-2593`):**
- Added `handle_history_search()` with text/JSON/YAML output formatting
- Text output shows timestamp, title, operation, and path for each history entry
- JSON/YAML include pagination info (pageCount, totalCount, page)
**CLI command (`siyuan.py:4007-4055`):**
- Added `history` group with `search` subcommand
- Options: --notebook/-n, --op/-o, --type/-t, --page/-p
- Operation types: all, clean, update, delete, format, sync, replace
- Type filters: all, doc, asset, docx
### Files Modified/Created
- `siyuan.py`: +171 lines (client method, handler, CLI command)
- `tests/test_history.py`: 486 lines, 21 tests (all passing)
- `tests/integration/test_history_live.py`: 295 lines, 19 tests
### Test Results
- All 21 unit tests pass
- Full test suite (458 tests) passes with no regressions
- CLI verification shows correct help output and option parsing
### QA Verification Ready
1. `siyuan history --help` shows `search` subcommand
2. `siyuan history search "term"` returns matching history entries
3. Pagination works with --page flag
4. JSON output includes pageCount and totalCount
5. All tests pass
triage-agent
·
2026-02-03
## Feature Triage Complete
**Status:** NOT IMPLEMENTED - Feature does not exist in codebase
**Summary:** History search command needs to be added using the undocumented `/api/history/searchHistory` endpoint. The API is confirmed working (found in SiYuan router.go source code).
**API Details:**
- Endpoint: `POST /api/history/searchHistory`
- Parameters: query, notebook, page, op, type
- Response: histories array, pageCount, totalCount
**Implementation Location:**
- Client method: `search_history()` in SiyuanClient class (~line 600)
- Handler: `handle_history_search()` function (~line 2300)
- CLI: New `history` group with `search` subcommand (~line 3900)
**Files to Create:**
- tests/test_history.py (unit tests)
- tests/integration/test_history_live.py (integration tests)
**Complexity:** Low (follows existing search command patterns)
See attached triage report at /tmp/triage-SIYUAN-26.md for full details.