feat(PP-3449): configurable dev panel position, hide and auto-hide modes#191
Merged
Conversation
Adds a devPanel config group and runtime panel controls:
- devPanel: { position, hidden, autoHide } in pp-dev.config with
validation and normalization (defaults: bottom-right/false/false),
threaded through both injection paths (Vite clientInjectionPlugin
and pp-dev next injectDevPanel) as a corner class + data-* attrs
on the panel root.
- SCSS: corner map + @each loop generates the four corner variants
(placement, mirrored radius/shadow/hairline, direction-aware
minimize slide and arrow), auto-hide slide behind the nearest
vertical edge with a 4px accent strip and extended hover zone,
settings popover, left-anchored popup variant, reduced-motion.
- Client: new storage/panel-state/panel-position/panel-settings
modules. State precedence: localStorage -> config -> default;
?pp-dev-panel=show|hide URL param writes a persistent override.
Drag handle with pointer-capture drag & snap-to-nearest-corner.
Auto-hide hover reveal (300ms show / 500ms grace), wrap-btn acts
as 'pin' in auto-hide mode. Popups now stack from the edge
opposite the panel; the inline-style bottom-pinning hack in
updatePopupPositions is removed.
- Panel label 'Portal page ID:' renamed to 'App ID:'.
- Tests: normalize/validate coverage, EJS default-rendering guard
for both compiles, jsdom specs for state precedence and the
controller, nearestCorner quadrant math. README documents the
devPanel section, localStorage keys and URL params.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Manual seed for the 1.0 line: semantic-release did not advance the version past 0.20.0-beta.x even though 1.0.0-beta.1 was expected. Fixture lockfiles updated to reference the rebuilt local tarball.
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.
🚀 Feature: Configurable dev panel — corner position, full hide, auto-hide
Summary
The dev panel was hardcoded to the bottom-right corner with a single minimize control. This PR makes it fully configurable: it can be anchored to any of the four screen corners, completely hidden, or put into an auto-hide mode where it slides behind the screen edge leaving a thin 4px strip and reveals itself on hover. Position and modes can be set as defaults in
pp-dev.configand changed at runtime from the panel itself — via a new settings popover (gear icon) or by dragging the panel to a corner. Runtime choices persist inlocalStorageand take precedence over config. Bonus: the panel label "Portal page ID:" is renamed to "App ID:".Key changes
devPanelconfig group —{ position, hidden, autoHide }with validation (positionmust be one of the four corners) and normalization defaults (bottom-right/false/false); threaded through both injection paths (ViteclientInjectionPluginandpp-dev nextinjectDevPanel) as a server-rendered corner class +data-*attributes on the panel root. NewDevPanelConfig/DevPanelPositionpublic types;devPaneladded to the config deep-merge groups.@eachloop generates the four variants: placement, mirrored border-radius/shadow/hairline, direction-aware minimize slide (left corners slide left, arrow inverted, wrap-btn reordered to the exposed edge), auto-hide transform behind the nearest vertical edge with an accent strip and an extended invisible hover zone; settings popover styles; left-anchored popup variant;prefers-reduced-motionsupport.storage.ts,panel-state.ts,panel-position.ts,panel-settings.ts):localStorage→ config (data-*) → default; invalid stored values ignored.?pp-dev-panel=show|hideURL param writes a persistent override — restores a hidden panel.updatePopupPositions(which would have fought top corners) is removed.with(locals)ReferenceError regression), jsdom specs for state precedence/URL param/controller behavior,nearestCornerquadrant math.devPanelsection, localStorage keys, URL params, origin-scoped storage caveat.Testing
map-get→sass:map)test-commonjsfixture (Vite path): configtop-left + autoHiderenders correctly; hover reveals / re-hides; wrap-btn pins; corner picker moves the panel tobottom-rightand persists; drag & snap works withuser-selectdisabled and inline styles cleaned; Hide →display:none;?pp-dev-panel=showrestores persistentlypp-dev next(test-nextjs fixture): injected markup verified (corner class, data attrs, drag handle, settings button, "App ID:")Compatibility
localStorageis origin-scoped, and an MI page that clears origin storage on cache-version change will also reset panel overrides to config defaults (documented in README).Included commits:
315d6fcfeat(PP-3449): configurable dev panel position, hide and auto-hide modes7116d78chore(PP-3449): bump version to 1.0.0-beta.1 — manual seed for the 1.0 line (semantic-release did not advance past 0.20.0-beta.x) + fixture lockfilesMerge Request:
origin/pp-3449-dev-panel-position→origin/develop