feat(tags): Add tag archive route and admin interface integration

Implement Phase 3 of v1.3.0 tags feature per microformats-tags-design.md:

Routes (starpunk/routes/public.py):
- Add /tag/<tag> archive route with normalization and 404 handling
- Pre-load tags in index route for all notes
- Pre-load tags in note route for individual notes

Admin (starpunk/routes/admin.py):
- Parse comma-separated tag input in create route
- Parse tag input in update route
- Pre-load tags when displaying edit form
- Empty tag field removes all tags

Templates:
- Add tag input field to templates/admin/edit.html
- Add tag input field to templates/admin/new.html
- Use Jinja2 map filter to display existing tags

Implementation details:
- Tag URL parameter normalized to lowercase before lookup
- Tags pre-loaded using object.__setattr__ pattern (like media)
- parse_tag_input() handles trim, dedupe, normalization
- All existing tests pass (micropub categories, admin routes)

Per architect design:
- No pagination on tag archives (acceptable for v1.3.0)
- No autocomplete in admin (out of scope)
- Follows existing media loading patterns

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-10 11:42:16 -07:00
parent 377027e79a
commit 372064b116
41 changed files with 2573 additions and 10573 deletions

View File

@@ -0,0 +1,97 @@
# StarPunk Backlog
**Last Updated**: 2025-12-10
## Priority Levels
- **Critical** - Items that break existing functionality
- **High** - Important features or fixes
- **Medium** - Planned features
- **Low** - Nice-to-have, deferred indefinitely
---
## Critical
*No critical items*
---
## High
### Strict Microformats2 Compliance
- Complete h-entry properties (p-name, p-summary, p-author)
- Author h-card implementation
- h-feed wrapper for index pages
- Full IndieWeb parser compatibility
- Microformats2 validation suite
- See: ADR-040
### Enhanced Feed Media Support
- Multiple image sizes/thumbnails (150px, 320px, 640px, 1280px)
- Full Media RSS implementation (media:group, all attributes)
- Enhanced JSON Feed attachments
- ATOM enclosure links for all media
- See: ADR-059
### Tag/Category System
- Database schema for tags
- Tag-based filtering
- Tag clouds
- Category RSS/ATOM/JSON feeds
- p-category microformats2 support
---
## Medium
### Webmentions
- Receive endpoint
- Send on publish
- Display received mentions
- Moderation interface
### Reply Contexts
- In-reply-to support
- Like/repost posts
- Bookmark posts
### Media Uploads Enhancements
- File management interface
- Thumbnail generation
- CDN integration (optional)
### Photo Posts
- Instagram-like photo notes
- Gallery views
- EXIF data preservation
### Audio/Podcast Support
- Podcast RSS with iTunes namespace
- Audio duration extraction
- Episode metadata support
- Apple/Google podcast compatibility
- See: ADR-059
### Video Support
- Video upload handling
- Poster image generation
- Video in Media RSS feeds
- HTML5 video embedding
---
## Low
### Flaky Migration Race Condition Tests
- Improve `test_migration_race_condition.py::TestGraduatedLogging::test_debug_level_for_early_retries`
- Test expects DEBUG retry messages but passes when migration succeeds without retries
- May need to mock or force retry conditions for reliable testing
### Deferred Indefinitely
- Static Site Generation - Conflicts with dynamic Micropub
- Multi-language UI - Low priority for single-user system
- Advanced Analytics - Privacy concerns, use external tools
- Comments System - Use Webmentions instead
- WYSIWYG Editor - Markdown is sufficient
- Mobile App - Web interface is mobile-friendly

View File

@@ -0,0 +1,20 @@
# StarPunk v1.0.0 Release
**Status**: Released 2025-11-24
**Codename**: Initial Release
## Features
- IndieAuth authentication (via indielogin.com)
- Micropub server implementation
- Notes CRUD functionality
- RSS feed generation
- Web interface (public & admin)
## Bugs Addressed
*Initial release - no prior bugs*
## Implementation
See `docs/design/v1.0.0/` for implementation details and reports.

View File

@@ -0,0 +1,19 @@
# StarPunk v1.1.0 Release
**Status**: Released 2025-11-25
**Codename**: SearchLight
## Features
- Full-text search with FTS5
- Custom slugs via Micropub mp-slug
- Migration system improvements
## Bugs Addressed
- RSS feed ordering (newest first)
- Custom slug extraction from Micropub
## Implementation
See `docs/design/v1.1.1/` for implementation details and reports.

View File

@@ -0,0 +1,16 @@
# StarPunk v1.1.1 Release
**Status**: Released 2025-11-26
## Features
*Hotfix release - no new features*
## Bugs Addressed
- Fix metrics dashboard 500 error
- Add data transformer for metrics template
## Implementation
See `docs/design/v1.1.1/` for implementation details and reports.

View File

@@ -0,0 +1,21 @@
# StarPunk v1.1.2 Release
**Status**: Released 2025-11-27
**Codename**: Syndicate
## Features
- Multi-format feed support (RSS 2.0, ATOM 1.0, JSON Feed 1.1)
- Content negotiation for automatic format selection
- Feed caching with LRU eviction and TTL expiration
- ETag support with 304 conditional responses
- Feed statistics dashboard
- OPML 2.0 export
## Bugs Addressed
*No bugs - feature release*
## Implementation
See `docs/design/v1.1.2/` for implementation details and reports.

View File

@@ -0,0 +1,21 @@
# StarPunk v1.2.0 Release
**Status**: Released 2025-12-09
**Codename**: IndieWeb Features
## Features
- Media upload via Micropub
- Caption/alt text support for images
- Media display CSS fixes (responsive images)
- Feed media support (Media RSS namespace, JSON Feed image field)
## Bugs Addressed
- Images too large on homepage
- Captions displaying when should be alt text only
- Images missing from feeds in feed readers
## Implementation
See `docs/design/v1.2.0/` for implementation details and reports.

View File

@@ -0,0 +1,21 @@
# StarPunk v1.3.0 Release
**Status**: Planning
## Features
### Strict Microformats2 Compliance
- Complete h-entry properties (p-name, p-summary, p-author)
- Author h-card implementation
- h-feed wrapper for index pages
- Full IndieWeb parser compatibility
- Microformats2 validation suite
- See: ADR-040
## Bugs Addressed
*None planned*
## Implementation
See `docs/design/v1.3.0/` for implementation details and reports.

View File

@@ -0,0 +1,154 @@
# StarPunk v1.3.1 Release
**Status**: Planning
**Codename**: "Syndicate Tags"
**Focus**: Feed Categories/Tags Support
## Overview
This patch release adds tags/categories support to all three syndication feed formats (RSS 2.0, Atom 1.0, JSON Feed 1.1). Tags were added to the backend in v1.3.0 but are not currently included in feed output.
## Features
### Feed Categories/Tags Support
Add tag/category elements to all syndication feeds, enabling feed readers and aggregators to categorize and filter content by topic.
#### RSS 2.0 Categories
- Add `<category>` elements for each tag on a note
- Use `display_name` as element content for human readability
- Optional: Consider using normalized `name` as `domain` attribute for taxonomy identification
- Multiple `<category>` elements per item (one per tag)
- Reference: RSS 2.0 Specification (www.rssboard.org)
**Example:**
```xml
<item>
<title>My Post</title>
<category>Machine Learning</category>
<category>Python</category>
</item>
```
#### Atom 1.0 Categories
- Add `<category>` elements with RFC 4287 compliance
- Required: `term` attribute (normalized tag name for machine processing)
- Optional: `label` attribute (display name for human readability)
- Optional: Consider `scheme` attribute for taxonomy URI
- Multiple `<category>` elements per entry (one per tag)
- Reference: RFC 4287 Section 4.2.2
**Example:**
```xml
<entry>
<title>My Post</title>
<category term="machine-learning" label="Machine Learning"/>
<category term="python" label="Python"/>
</entry>
```
#### JSON Feed 1.1 Tags
- Add `tags` array to each item object
- Array contains `display_name` strings (human-readable)
- Empty array or omit field if no tags
- Reference: JSON Feed 1.1 Specification (jsonfeed.org)
**Example:**
```json
{
"items": [{
"title": "My Post",
"tags": ["Machine Learning", "Python"]
}]
}
```
## Implementation Scope
### In Scope
- RSS feed category elements (`starpunk/feeds/rss.py`)
- Atom feed category elements (`starpunk/feeds/atom.py`)
- JSON Feed tags array (`starpunk/feeds/json_feed.py`)
- Load tags in feed generation routes (`starpunk/routes/public.py`)
- Unit tests for each feed format with tags
- Integration tests for feed generation with tagged notes
### Out of Scope (Deferred)
- Tag-filtered feeds (e.g., `/feed.rss?tag=python`) - consider for v1.4.0
- Tag cloud/list in feeds - not part of feed specs
- Category hierarchy/taxonomy URIs - keep simple for v1
## Technical Notes
### Tag Data Loading
Notes are already loaded with `include_tags=True` capability in the model. Feed routes need to ensure tags are loaded when fetching notes:
- Check if `get_note_tags()` is called or if notes have `.tags` populated
- Pass tags to feed generation functions
### Feed Generator Changes
Each feed module needs modification to accept and render tags:
1. **RSS (`generate_rss()` / `generate_rss_streaming()`):**
- Accept tags from note object
- Insert `<category>` elements after description/enclosure
2. **Atom (`generate_atom()` / `generate_atom_streaming()`):**
- Accept tags from note object
- Insert `<category term="..." label="..."/>` elements
3. **JSON Feed (`_build_item_object()`):**
- Accept tags from note object
- Add `"tags": [...]` array to item object
### Backward Compatibility
- Tags are optional in all three feed specs
- Notes without tags will simply have no category/tags elements
- No breaking changes to existing feed consumers
## Testing Requirements
### Unit Tests
- RSS: Notes with tags generate correct `<category>` elements
- RSS: Notes without tags have no `<category>` elements
- RSS: Multiple tags generate multiple `<category>` elements
- Atom: Notes with tags generate correct `<category>` elements with term/label
- Atom: Notes without tags have no `<category>` elements
- JSON Feed: Notes with tags have `tags` array
- JSON Feed: Notes without tags have empty array or no `tags` field
### Integration Tests
- Full feed generation with mix of tagged and untagged notes
- Feed validation against format specifications
- Streaming feed generation with tags
## Dependencies
- v1.3.0 tags feature must be complete (database + backend)
- No new external dependencies required
## Estimated Effort
- Small patch release (1-2 hours implementation)
- Focused scope: feed modifications only
- Well-defined specifications to follow
## Success Criteria
1. All three feed formats include tags/categories when present
2. Feed output validates against respective specifications
3. Existing tests continue to pass
4. New tests cover tag rendering in feeds
5. No regression in feed generation performance
## Related Documentation
- `docs/architecture/syndication-architecture.md` - Feed architecture overview
- `docs/design/v1.3.0/microformats-tags-design.md` - Tags feature design
- ADR-014: RSS Feed Implementation
- ADR-059: Full Feed Media Standardization (future media enhancements)
## Standards References
- [RSS 2.0 Specification - category element](https://www.rssboard.org/rss-specification#ltcategorygtSubelementOfLtitemgt)
- [RFC 4287 - Atom Syndication Format](https://datatracker.ietf.org/doc/html/rfc4287) (Section 4.2.2 for category)
- [JSON Feed 1.1 Specification](https://www.jsonfeed.org/version/1.1/) (tags field)