Added users_messages schema with correct field naming (senderId, recipientId)
Implemented message count and recent message fetch via storage.GetMessageCount and GetRecentMessages
Fixed field mismatches in SQL queries (recipientId vs recipient_id)
Displayed unread message badge in topbar with truncation for body preview
Linked messages in dropdown to full view (/account/messages/read?id=...)
Added fallback handling for unauthorized/invalid message access
Cleaned up BuildTemplateData to support full message context
Ensured CSRF/session/user context remains intact throughout
Implemented message retrieval and read logic in storage layer
Added handlers for inbox and individual message view
Integrated messages into topbar dropdown with unread badge
Added truncate helper to template functions
Created new templates: messages/index.html and messages/read.html
Fixed missing template function error in topbar rendering
- Replaced http.Error with helpers.RenderError in Recover middleware
- Custom 500.html now rendered with layout and topbar on panic
- RenderError gracefully checks template existence and falls back to plain response
- Added /account/notifications full view page (index)
- Linked "Back to notifications" from notification read view
- Fixed typo in template path for notifications/index.html
- Improved layout consistency across error and account pages
- Added dedicated route and view for reading individual notifications (/account/notifications/read)
- Ensured notification is only marked as read if it hasn't already been
- Updated Notification model to use Subject and Body fields
- Fixed field references in templates (Title → Subject, Message → Body)
- Updated topbar dropdown to use correct field names and display logic
- Gracefully handle "notification not found" cases in template output
- Ensured consistent template parsing with layout and topbar inclusion
- Improved error logging for better diagnosis
- Created /account/notifications/read endpoint secured by session middleware
- Ensured users can only mark their own notifications as read
- Updated dropdown links to point to /account/notifications/read?id={id}
- Improved notification security by matching user_id in DB update
- Added redirect flow to full notifications page after marking read
- Logged DB errors to assist debugging
- Replaced legacy TemplateContext calls with structured TemplateData usage
- Removed unused variables and redundant storage calls in notifications handler
- Ensured consistent use of BuildTemplateData across user-facing handlers
- Resolved all compile-time errors from refactor
- Ready for runtime testing and further layout integration
- Introduced models.TemplateData for shared user/context state
- Moved context construction logic into handlers/template_context.go
- Simplified helpers.TemplateContext to accept structured data
- Restored and organized template helper functions
- Updated affected handlers (main.go, draw_handler.go, notifications.go)
- Improved scalability and separation of concerns in template rendering