## Implementation Plan: Add Shareable Permalinks to Comments ### Overview Three files require changes. No backend logic, CSS, or JavaScript changes. The entire feature is a template-layer addition using existing infrastructure. ### Changes **1. `devplacepy/templating.py`** – Register `resolve_object_url` as a Jinja global. - Locate the dictionary of Jinja globals in `templating.py` (around lines 143–191). - Add the key `"resolve_object_url"` pointing to the function `database.content.resolve_object_url`. **2. `devplacepy/templates/_comment_section.html`** – Compute and pass the parent content’s URL. - Inside the macro or block that iterates comments, before calling `render_comment`, add: ``` {% set parent_url = resolve_object_url(target_type, target_uid) %} ``` - Change the `render_comment` call to pass `parent_url=parent_url` (and optionally `parent_author` if already provided). **3. `devplacepy/templates/_comment.html`** – Thread the new parameter and add the share button. - Add `parent_url` to the `comment_cell` macro signature (and any intermediate macros that forward parameters). - Inside the `.comment-actions` div (current containing Reply, Edit, Delete, reactions), insert the following button **between the Reply button and the Edit button**: ```html ``` ### Environmental Setup (Required to Pass Verification Commands) The project’s verification commands (`pip install -e '.[dev]' -q && make test-unit` and `pip install -q ruff && ruff check .`) will fail with a PEP 668 error unless a virtual environment exists. Therefore: - Create a Python virtual environment (`python3 -m venv .venv`). - Activate it (`source .venv/bin/activate`). - Ensure `make` is available (if not, install it via `apt-get update && apt-get install -y make`). - Run the verification commands **inside the activated virtual environment**. ### Definition of Done 1. **Code changes applied as described** – `templating.py`, `_comment_section.html`, `_comment.html` modified and saved. 2. **Virtual environment active** – `.venv` exists and is sourced. 3. **Unit tests pass** – `pip install -e '.[dev]' -q && make test-unit` exits with code 0. 4. **Lint passes** – `pip install -q ruff && ruff check .` exits with code 0. 5. **No syntax errors** – All modified templates are valid Jinja2 (no compilation errors when loaded by the application).