code changes from key's pr#477
Closed
itszubariel wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR separates and lands UI/theme changes from the earlier “New UI features” work (#463), focusing on improved navigation UX, code-block presentation, and page metadata (“Last edited”) for the wiki theme.
Changes:
- Adds a client-side “Last edited” block (via GitHub API) and restructures some function-page header content.
- Reworks code block rendering to include line numbers and updates copy/wrap behaviors accordingly.
- Updates multiple CSS files for mobile/layout polish (tables, headings, nav buttons, Discord message styling), and removes legacy beta-tag styling and the template edit-link.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/theme/settings/style.css | Removes legacy .tag-beta styling from settings theme. |
| src/theme/settings/code-hg.js | Reworks code rendering to add line numbers and per-line wrappers. |
| src/theme/settings/apply-settings.js | Adds “Last edited”, nav text enhancements, redirects/link rewriting, and applies settings on DOMContentLoaded. |
| src/theme/index.hbs | Removes the static edit-link from the template main area. |
| src/theme/css/wiki-themes/discord-messages.css | Tweaks Discord message/system message styling and some component borders. |
| src/theme/css/home.css | Hides .last_file_edit on home and adjusts home page h1 overflow behavior. |
| src/theme/css/general.css | Adds table wrapper support and adjusts table/heading styles for responsiveness. |
| src/theme/css/chrome.css | Adds styling for the new “Last edited” block, navigation buttons, and new code container layout. |
| src/theme/book.js | Updates clipboard copy and wrap logic to work with the new code-line layout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+535
to
+539
| const html = document.querySelector("html"); | ||
|
|
||
| html.style.fontFamily = data["text-font"]; | ||
| html.style.fontSize = data["text-size"]; | ||
| html.style.textShadow = data["text-hg"]; |
Comment on lines
+474
to
+476
| if (styles.background) | ||
| mutation.target.style.background = styles.background; | ||
| mutation.target.style.backgroundColor = styles.exampleColor; |
Comment on lines
+514
to
+517
| for (message of discordMessages) { | ||
| const mutObv = new MutationObserver(callback); | ||
| mutObv.observe(message, { attributes: true }); | ||
| } |
Comment on lines
+275
to
+291
| wrapButtons.forEach((button) => { | ||
| button.addEventListener("click", (e) => { | ||
| const playground = button.closest("pre"); | ||
| const codeContainer = playground.querySelector(".code-container"); | ||
| const lineNumbers = codeContainer.querySelectorAll(".line-number"); | ||
| const codeLines = codeContainer.querySelectorAll(".code-line"); | ||
|
|
||
| codeContainer.classList.toggle("wrap-enabled"); | ||
|
|
||
| codeLines.forEach((line, index) => { | ||
| if (lineNumbers[index]) { | ||
| const lineHeight = line.scrollHeight; | ||
| lineNumbers[index].style.height = lineHeight + 'px'; | ||
| } | ||
| }); | ||
| }); | ||
| }); |
Comment on lines
+246
to
+249
| const lines = []; | ||
| codeLines.forEach(line => { | ||
| lines.push(line.textContent); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
separated the code changes from rainbow key's pr (#463),
original pr by @Rainb0wKey.