## Implementation Plan **Problem** The constant `AUTO_SCROLL_MARGIN_PX` is set to `100` in `devplacepy/static/js/components/AppChat.js` (line 17). When a user scrolls up and the viewport is still within 100 px of the bottom, `_stabilizeScroll()` snaps back to the bottom, defeating the user’s attempt to read older messages. Reducing this margin to `0` makes auto-scroll fire only when the user is literally at the very bottom, matching the expected behavior of typical messaging applications. **Change** | File | Line | Current Value | New Value | |------|------|---------------|-----------| | `devplacepy/static/js/components/AppChat.js` | 17 | `const AUTO_SCROLL_MARGIN_PX = 100;` | `const AUTO_SCROLL_MARGIN_PX = 0;` | No other functions or constants require modification. The inner stabilization check at line 872 (`scrollTop < 10`) already handles the “truly at bottom” case; setting the outer margin to `0` makes the two thresholds consistent. **Execution Steps** 1. Open `devplacepy/static/js/components/AppChat.js` and change line 17 as specified. 2. Verify the file syntax is still valid JavaScript (no trailing issues). 3. Ensure the project’s test environment has Playwright browsers installed (if not already): ```bash python -m playwright install ``` 4. Run the project’s verification command: ```bash pip install -e '.[dev]' -q && python -m pytest ``` Confirm that all tests pass (no new failures; pre-existing failures unrelated to this change—such as missing browsers—must be resolved as part of the environment setup). **Definition of Done** - [ ] The value of `AUTO_SCROLL_MARGIN_PX` in `AppChat.js` is changed from `100` to `0`. - [ ] The project’s test command runs without errors (exit code 0). - [ ] Manual or automated verification confirms that scrolling up by any amount (including small keyboard steps) no longer triggers a snap back to the bottom, and that new messages still auto-scroll only when the user is at the very bottom of the chat thread.