Skip to content

feat(swa): add subject tag to notes and replies#69

Merged
github-actions[bot] merged 1 commit into
devfrom
feature/subject-tag
Jun 18, 2026
Merged

feat(swa): add subject tag to notes and replies#69
github-actions[bot] merged 1 commit into
devfrom
feature/subject-tag

Conversation

@Ryback2501

Copy link
Copy Markdown
Owner

Summary

  • Add NIP-14 subject lines to text notes: an optional subject on new notes, shown as a header in the feed, and replicated (editable, pre-filled with Re:) when replying.

Changes

Threading helpers (swa/)

  • threading.jsgetSubject(event) returns the first subject tag value (or ''); adornReplySubject(subject) prepends Re: unless the subject already starts with re: (case-insensitive).
  • threading.test.js — unit tests for both helpers (present/absent/first-of-many; empty/plain/already-prefixed).

Compose & reply (swa/)

  • index.html — optional subject input (max 80 chars) in the compose panel.
  • app.js — the post handler attaches a subject tag when set (clearing the field after posting); onReply takes the reply form's subject and attaches it. Mention #[n] offsets account for the leading subject tag so references stay correct.
  • feedView.js — the reply form gains a subject input pre-filled with the Re:-adorned parent subject (editable/clearable), passed through to onReply.

Display (swa/)

  • feedView.jsrenderEvent and renderReply show a .event-subject header (via .textContent) above the content when a subject is present.
  • style.css.event-subject styling.

Test plan

  • Post a note with a subject; confirm it carries a subject tag and shows as a header.
  • Post with the subject left blank; confirm no subject tag is added.
  • Post a note with both a subject and an @<hex> mention; confirm the mention still resolves (correct tag index).
  • Reply to a subjected note; confirm the field is pre-filled with Re: …, is editable/clearable, and the reply carries the edited subject.
  • Confirm subject + proof-of-work compose (mining still succeeds with a subject set).

@github-actions github-actions Bot merged commit 2116a17 into dev Jun 18, 2026
10 checks passed
@github-actions github-actions Bot deleted the feature/subject-tag branch June 18, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant