forked from retoor/devplacepy
docs: add block/mute user relations, emoji-sync CLI, and uid indexes
- 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:
@@ -35,6 +35,11 @@ export class AppDialog extends Component {
|
||||
this.overlay = overlay;
|
||||
this.titleEl = overlay.querySelector(".dialog-title");
|
||||
this.messageEl = overlay.querySelector(".dialog-message");
|
||||
const uid = Math.random().toString(36).slice(2, 9);
|
||||
this.titleEl.id = `dialog-title-${uid}`;
|
||||
this.messageEl.id = `dialog-message-${uid}`;
|
||||
overlay.setAttribute("aria-labelledby", this.titleEl.id);
|
||||
overlay.setAttribute("aria-describedby", this.messageEl.id);
|
||||
this.field = overlay.querySelector(".dialog-field");
|
||||
this.fieldLabel = overlay.querySelector(".dialog-field-label");
|
||||
this.input = overlay.querySelector(".dialog-input");
|
||||
@@ -59,6 +64,24 @@ export class AppDialog extends Component {
|
||||
this.dismiss();
|
||||
}
|
||||
});
|
||||
overlay.addEventListener("keydown", (e) => {
|
||||
if (e.key !== "Tab") return;
|
||||
const items = [
|
||||
...overlay.querySelectorAll(
|
||||
'a[href], button:not([disabled]), input:not([disabled]), select, textarea, [tabindex]:not([tabindex="-1"])'
|
||||
),
|
||||
].filter((el) => el.offsetParent !== null);
|
||||
if (!items.length) return;
|
||||
const first = items[0];
|
||||
const last = items[items.length - 1];
|
||||
if (e.shiftKey && document.activeElement === first) {
|
||||
e.preventDefault();
|
||||
last.focus();
|
||||
} else if (!e.shiftKey && document.activeElement === last) {
|
||||
e.preventDefault();
|
||||
first.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
open(mode, options) {
|
||||
|
||||
Reference in New Issue
Block a user