Skip to content

Add version display and issue reporting to footer#178

Merged
runleveldev merged 5 commits intomainfrom
copilot/show-version-and-link-to-issue
Feb 6, 2026
Merged

Add version display and issue reporting to footer#178
runleveldev merged 5 commits intomainfrom
copilot/show-version-and-link-to-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Implementation Plan: Show Version and Report Issue Link

  • Create utility function to get git version information (commit hash, date, tag if available)
  • Add middleware to inject version info into all views
  • Update footer.ejs to display version with link to GitHub repository
  • Add "Report Issue" link in footer with pre-filled GitHub issue URL
  • Style the footer to match the existing design
  • Test the implementation manually to verify links and version display
  • Take screenshot of the UI changes
  • Run code review and address findings
  • Run security checks (CodeQL - no issues found)
  • Address PR review feedback
    • Move version info from middleware to app.locals for better performance
    • Create GitHub issue template
    • Use markdown template format for pre-filling support
    • Simplify to embed context in title, let template provide structure
    • Fix session.user reference (it's a string, not an object)

Changes Made

Version Information

  • Added getVersionInfo() function in utils/index.js that retrieves git commit hash, date, and tag
  • Version info is now stored in app.locals.versionInfo at server startup for optimal performance

Footer Updates

  • Updated views/layouts/footer.ejs to display version information with a clickable link to the commit on GitHub
  • "Report Issue" button uses GitHub markdown template with context embedded in title
  • Title format: [Bug] from /path by username (vCommitHash)
  • Fixed: req.session.user is the username string (uid), not an object with a username field

GitHub Issue Template

  • Created .github/ISSUE_TEMPLATE/bug_report.md with markdown format
  • Template provides structured sections for bug reports
  • Context information (URL, username, version) is passed in the title

Styling

  • Added CSS styles in public/style.css for the fixed footer at the bottom of the page
  • Styled version link with monospace font and hover effects
  • Styled report issue button with bug icon and hover effects
  • Added padding to main content to prevent footer overlap
  • Footer uses dark theme matching the existing navbar

Performance Improvements

  • Version info is set once at startup in app.locals instead of using middleware on every request
  • Eliminates unnecessary function calls on each request cycle

Security

  • All URL parameters are properly encoded using encodeURIComponent()
  • Added shell: true to execSync for cross-platform compatibility
  • CodeQL security scan passed with no issues

Other

  • Updated .gitignore to exclude data/ directory

Screenshot

Footer with version and report issue

The footer displays at the bottom of all authenticated pages showing:

  • Version: Git commit hash (linked to GitHub) and date
  • Report Issue: Opens GitHub with template and context in title

Implementation Notes

This addresses all requirements and PR feedback:

  • ✅ Shows GIT hash/version (could also show tag if available)
  • ✅ Links version to the GitHub repository
  • ✅ Provides "Report Issue" link with GitHub template
  • ✅ Passes context (URL, user, version) in title
  • ✅ Uses template file for structure (markdown format)
  • ✅ Optimized performance with app.locals
  • ✅ Clean separation: context in title, structure in template
  • ✅ Correctly references session.user as a string (uid)

Technical Details

Session Structure:

  • req.session.user stores the username/uid as a string (e.g., "testuser")
  • Not an object, so direct reference without .username property

Approach:

  • Context is embedded in the issue title (URL, username, version)
  • Template provides clean structure with labeled sections
  • Users see context in title and fill structured form

Security Summary

No security vulnerabilities. All user data is properly encoded before URL embedding.

Original prompt

This section details on the original issue you should resolve

<issue_title>Show version and link to report issue</issue_title>
<issue_description>Image</issue_description>

Comments on the Issue (you are @copilot in this section)

@horner We should also have a link to report an issue like this:

https://github.com/mieweb/opensource-server/issues/new

https://github.com/mieweb/opensource-server/issues/new
  ?title=Bug%20report
  &body=Steps%20to%20reproduce%3A%0A1.%20...
  &labels=bug,triage

Then we could pass in the url they are on, and the user</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 5, 2026 12:42
Co-authored-by: horner <6094599+horner@users.noreply.github.com>
Co-authored-by: horner <6094599+horner@users.noreply.github.com>
Copilot AI changed the title [WIP] Show version and add link to report issue Add version display and issue reporting to footer Feb 5, 2026
Copilot AI requested a review from horner February 5, 2026 12:45
Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
@runleveldev runleveldev force-pushed the copilot/show-version-and-link-to-issue branch from d9ab785 to 5ef3df2 Compare February 6, 2026 14:31
@runleveldev runleveldev marked this pull request as ready for review February 6, 2026 14:33
@runleveldev runleveldev merged commit f6344da into main Feb 6, 2026
4 checks passed
@runleveldev runleveldev deleted the copilot/show-version-and-link-to-issue branch February 6, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show version and link to report issue

3 participants