Skip to content

fix(editor): preserve find & replace floating panel position and add reset button#128

Merged
ThisIs-Developer merged 1 commit into
mainfrom
fix-dock-dragging
May 27, 2026
Merged

fix(editor): preserve find & replace floating panel position and add reset button#128
ThisIs-Developer merged 1 commit into
mainfrom
fix-dock-dragging

Conversation

@ThisIs-Developer
Copy link
Copy Markdown
Owner

Description of Changes

1. Floating Position Preservation (Bug Fix)

  • Problem: Toggling between docked/sidebar mode and floating mode previously reset the floating panel's inline coordinates (top, left, right) back to defaults.
  • Solution:
    • Declared global variables in script.js to store custom floating panel coordinates.
    • Updated the mouse/touch drag listener to store custom position values whenever the user drags the panel.
    • Updated toggleFrDockMode() to restore the last stored coordinates when transitioning back to floating mode.
    • Synchronized the position storage variable within the resize handler constrainFloatingPanelPosition() to ensure custom positions are kept in-bounds and updated.

2. Reset Position Button (New Feature)

  • Problem: Users needed a quick way to restore the floating panel back to its default layout position.
  • Solution:
    • Added a dedicated button with id="find-replace-reset" and Bootstrap Icon bi-arrow-counterclockwise to the Find & Replace header inside index.html.
    • Added a CSS rule in styles.css to hide the Reset Position button automatically when docked mode is active.
    • Wired a click event listener in script.js that clears the stored coordinate state and clears the panel's CSS positioning style properties, instantly returning it to the default position (100px from the top, 20px from the right).

3. Desktop Application Synchronization

  • Action: Ran the prepare script (node prepare.js inside the desktop-app directory) to rebuild and copy all updated core files (index.html, script.js, styles.css) into the desktop wrapper (desktop-app/resources/).

Copilot AI review requested due to automatic review settings May 27, 2026 15:33
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment May 27, 2026 3:33pm

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9fb9bc9
Status:🚫  Build failed.

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying markdown-viewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9fb9bc9
Status: ✅  Deploy successful!
Preview URL: https://7a6348e6.markdown-viewer.pages.dev
Branch Preview URL: https://fix-dock-dragging.markdown-viewer.pages.dev

View logs

@ThisIs-Developer ThisIs-Developer merged commit 970f473 into main May 27, 2026
5 of 7 checks passed
@ThisIs-Developer ThisIs-Developer deleted the fix-dock-dragging branch May 27, 2026 15:35
@ThisIs-Developer ThisIs-Developer review requested due to automatic review settings May 27, 2026 15:57
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.

1 participant