docs: add block/mute user relations, emoji-sync CLI, and uid indexes
DevPlace CI / test (push) Failing after 2m7s

- Add `/block`, `/mute` endpoints with block/unblock and mute/unmute functionality in `routers/relations.py`, hiding blocked users' content everywhere except their own profile while muting only suppresses notifications
- Introduce `devplace emoji-sync` CLI command to regenerate `static/js/emoji-shortcodes.js` from the emoji library, documented in `CLAUDE.md` and wired in `cli.py`
- Create `get_blocked_uids()` database helper and apply it in `content.py` `load_detail()` to filter blocked users' posts from detail views
- Implement `_uid_index()` and `_drop_index()` helpers in `database.py` for unique uid indexes across tables, with `user_relations` added to `SOFT_DELETE_TABLES`
- Document new routes in `AGENTS.md` and `README.md`, including emoji shortcodes rendering behavior distinct from the emoji picker
This commit is contained in:
2026-06-19 08:06:09 +00:00
parent f3a4667fce
commit 741d7aade6
136 changed files with 3025 additions and 564 deletions
+8
View File
@@ -22,6 +22,7 @@ from devplacepy.database import (
get_follow_counts,
get_follow_list,
get_following_among,
get_user_relations,
get_user_media,
search_users_by_username,
)
@@ -226,6 +227,8 @@ async def profile_page(
streak = get_streaks(profile_user["uid"])
is_following = False
is_blocked = False
is_muted = False
if current_user:
follows = get_table("follows")
is_following = bool(
@@ -235,6 +238,9 @@ async def profile_page(
deleted_at=None,
)
)
relations = get_user_relations(current_user["uid"])
is_blocked = profile_user["uid"] in relations["block"]
is_muted = profile_user["uid"] in relations["mute"]
is_owner = bool(current_user and current_user["uid"] == profile_user["uid"])
viewer_is_admin = bool(current_user and current_user.get("role") == "Admin")
@@ -342,6 +348,8 @@ async def profile_page(
"current_tab": tab,
"posts_count": posts_count,
"is_following": is_following,
"is_blocked": is_blocked,
"is_muted": is_muted,
"is_owner": is_owner,
"viewer_is_admin": viewer_is_admin,
"media": media,