Feat: notes - #54
Draft
khanzadimahdi wants to merge 1 commit into
Draft
Conversation
A note is a short, body-only piece of content — no title, no cover. It is
multilingual the same way an article is, keyed by correlation UUID and
language code.
Public
- /{lang}/notes/{slug} with a note detail, comments and bookmarking
- An author now has one page, /{lang}/authors/{identity}, with articles
and notes behind tabs, replacing /author/{identity}/articles. Hashtag
pages get the same two tabs
- next.config redirects send the old shapes to the tab showing the same
content, so existing links keep working
Dashboard
- Notes CRUD at /dashboard/notes, plus own-scope creating and editing
under /dashboard/my/notes
- Notes and comments each now list both scopes on one page behind tabs
instead of a separate /dashboard/my/* route, which is what removes
/dashboard/my/comments
Supporting refactors
- Comments and bookmarks move out of features/articles into their own
features, since notes use them too. Both carry an object type now
rather than assuming "article"
- languageMiddleware no longer treats any dotted last segment as a static
asset; public/ is flat, so an asset is a single segment with an
extension. Usernames may contain a dot, as in /authors/@ada.lovelace
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A note is a short, body-only piece of content — no title, no cover image. It's multilingual the same way an article is, keyed by correlation UUID and language code.
Pairs with backend PR Tarhche/backend#73 — this branch calls the note endpoints and the widened hashtag/author responses that PR adds. Merge the backend first.
Public
/{lang}/notes/{slug}— note detail, with comments and bookmarking./{lang}/authors/{identity}, with articles and notes behind tabs, replacing/author/{identity}/articles. Hashtag pages get the same two tabs.next.config.mjsredirects send the old URL shapes to the tab showing the same content, so existing links and anything already indexed keep working.Dashboard
/dashboard/notes, plus own-scope creating and editing under/dashboard/my/notes.?scope=param, instead of a separate/dashboard/my/*route. That's what removes/dashboard/my/comments. Creating and editing stay on separate routes per scope, because each scope talks to its own API endpoint.Supporting refactors
These are the parts worth reviewing most carefully, since they move code that already worked:
features/articlesintofeatures/commentsandfeatures/bookmarks, because notes use them too. Both now carry an explicit object type instead of hardcoding"article"— that's threaded through the DAL, the actions, and the edit form (which echoes the type back on submit so an update doesn't reassign it).languageMiddlewareno longer treats any dotted last segment as a static asset.public/is flat, so an asset is always a single segment with an extension. A dot elsewhere doesn't make a path an asset — usernames may contain one, as in/authors/@ada.lovelace, which the old check sent to the wrong place.Notes for review
APP_PATHS.dashboard.notes.indexstays a bare path whilelist(scope)adds the query, becauserevalidatePathignores query strings.unstable_rethrowline inremove-bookmark.tsanddelete-comment.ts. Those belong to the block users PR's sweep, but both files are substantially rewritten here, so carrying the line avoids a pointless conflict — the sweep ends up complete whichever order you merge in.tsc --noEmitandnext buildon this branch alone; all note routes appear in the manifest and the old author/my-comments routes are gone. The repo has jest configured but no test files.prettier --checkreports four files, all already unformatted onmainand untouched here. Their fixes are in a separate chore PR.Relationship to the other PRs
Split out of one working branch alongside contact-us and block users. All three are cut from
mainand mergeable in any order; the overlap isapp-paths.ts,app-permissions.ts,layout-sidebar.tsxand the two dictionaries, all additive on both sides.🤖 Generated with Claude Code