Modal-based link/reference/image insertion with consistent UX#86
Merged
ThisIs-Developer merged 5 commits intomainfrom May 5, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/b2788a61-05c8-4f0f-a5d0-8ecd315db97a Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/b2788a61-05c8-4f0f-a5d0-8ecd315db97a Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/b2788a61-05c8-4f0f-a5d0-8ecd315db97a Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ThisIs-Developer
May 5, 2026 17:27
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/0b1640e1-7932-428f-8aa1-ded4211f4d36 Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Deploying markdown-viewer with
|
| Latest commit: |
c3d3980
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5ea562bc.markdown-viewer.pages.dev |
| Branch Preview URL: | https://copilot-update-link-referenc.markdown-viewer.pages.dev |
Deploying markdownviewer with
|
| Latest commit: |
c3d3980
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://182bf43d.markdownviewer.pages.dev |
| Branch Preview URL: | https://copilot-update-link-referenc.markdownviewer.pages.dev |
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/0b1640e1-7932-428f-8aa1-ded4211f4d36 Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR replaces prompt-based link/image insertion with modal dialogs, adds a new reference/citation insertion flow (including preview styling for bracketed reference markers), and changes uploaded image handling to use object URLs. It also mirrors these UI/logic updates into the duplicated desktop-app resources.
Changes:
- Added modal UIs for inserting links, references, and images; replaced the toolbar “anchor” action with a “reference” action.
- Added reference-definition insertion logic plus preview post-processing/styling for bracketed reference markers.
- Switched uploaded image insertion to
URL.createObjectURL()and added cleanup for revoked object URLs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| styles.css | Adds styling for reference links, reference toolbar icon, and shared modal form-field layout utilities. |
| script.js | Implements link/image/reference modals, reference numbering helpers, reference preview styling, and object URL lifecycle management. |
| index.html | Updates toolbar button and adds new link/reference/image modal markup. |
| desktop-app/resources/styles.css | Syncs the same styling changes into the desktop resource copy. |
| desktop-app/resources/js/script.js | Syncs the same modal/reference/object URL logic into the desktop resource copy. |
| desktop-app/resources/index.html | Syncs the same toolbar/modal markup into the desktop resource copy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+352
to
+354
| <div id="reference-modal" class="reset-modal-overlay" role="dialog" aria-modal="true" aria-labelledby="reference-modal-title" style="display:none;"> | ||
| <div class="reset-modal-box"> | ||
| <p id="reference-modal-title" class="reset-modal-message">Insert reference</p> |
Comment on lines
+374
to
+377
| <!-- Image Modal --> | ||
| <div id="image-modal" class="reset-modal-overlay" role="dialog" aria-modal="true" aria-labelledby="image-modal-title" style="display:none;"> | ||
| <div class="reset-modal-box"> | ||
| <p id="image-modal-title" class="reset-modal-message">Insert image</p> |
Comment on lines
+2026
to
+2028
| const objectUrl = URL.createObjectURL(file); | ||
| imageObjectUrls.add(objectUrl); | ||
| insertImage(objectUrl); |
Comment on lines
+355
to
+357
| <div id="reference-modal" class="reset-modal-overlay" role="dialog" aria-modal="true" aria-labelledby="reference-modal-title" style="display:none;"> | ||
| <div class="reset-modal-box"> | ||
| <p id="reference-modal-title" class="reset-modal-message">Insert reference</p> |
Comment on lines
+377
to
+380
| <!-- Image Modal --> | ||
| <div id="image-modal" class="reset-modal-overlay" role="dialog" aria-modal="true" aria-labelledby="image-modal-title" style="display:none;"> | ||
| <div class="reset-modal-box"> | ||
| <p id="image-modal-title" class="reset-modal-message">Insert image</p> |
Comment on lines
+2026
to
+2028
| const objectUrl = URL.createObjectURL(file); | ||
| imageObjectUrls.add(objectUrl); | ||
| insertImage(objectUrl); |
|
|
||
| function getUsedReferenceNumbers(text) { | ||
| const used = new Set(); | ||
| const regex = /^\[(\d+)\]:/gm; |
|
|
||
| function getUsedReferenceNumbers(text) { | ||
| const used = new Set(); | ||
| const regex = /^\[(\d+)\]:/gm; |
Copilot stopped work on behalf of
ThisIs-Developer due to an error
May 5, 2026 18:34
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.
Uh oh!
There was an error while loading. Please reload this page.