Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

fix(edge-bar): launch intro and location hint are solid black, no border

Deepender2554087c766b92
diff --git a/src/components/Panel.tsx b/src/components/Panel.tsx
index 4669503..0d2ba84 100644
--- a/src/components/Panel.tsx
+++ b/src/components/Panel.tsx
@@ -421,14 +421,13 @@ export function Panel() {
containerStyle.clipPath = clipPath
// Edge bar intro (launch) and location hint. Not a light: the bar itself,
- // drawn as a dark pill with the cards' faint edge highlight, a little wider
- // and longer than the bar, settling into the slim black bar it lands on
- // exactly (same insets, same black), so the hand-over is invisible. The
- // hint is the same shape as a short swell.
+ // solid black with no border like the drag cue, a little wider and longer
+ // than the bar, settling into the slim black bar it lands on exactly (same
+ // insets, same black), so the hand-over is invisible. The hint is the same
+ // shape as a short swell.
const beaconThick = isHorizontal ? 'height' : 'width'
const beaconLong = isHorizontal ? 'width' : 'height'
const beaconWide = hotWidth + 6
- const edgeLight = (a: number) => `inset 0 0 0 1px rgba(255, 255, 255, ${a})`
// Launch: the bar swells out of itself (solid all along, so the bar under
// it never shows through), holds a beat, then glides back to slim.
const beaconMotion = startupBeacon
@@ -436,9 +435,7 @@ export function Panel() {
animate: {
[beaconThick]: reduceMotion ? hotWidth : [hotWidth, beaconWide, beaconWide, hotWidth],
[beaconLong]: reduceMotion ? '100%' : ['100%', '114%', '114%', '100%'],
- opacity: 1,
- backgroundColor: ['#000000', '#2c2c2c', '#2c2c2c', '#000000'],
- boxShadow: [edgeLight(0), edgeLight(0.18), edgeLight(0.18), edgeLight(0)]
+ opacity: 1
},
transition: {
duration: EDGE_INTRO_MS / 1000,
@@ -450,9 +447,7 @@ export function Panel() {
animate: {
[beaconThick]: reduceMotion ? hotWidth : [hotWidth, hotWidth + 4, hotWidth],
[beaconLong]: reduceMotion ? '100%' : ['100%', '106%', '100%'],
- opacity: 1,
- backgroundColor: ['#000000', '#2c2c2c', '#000000'],
- boxShadow: [edgeLight(0), edgeLight(0.16), edgeLight(0)]
+ opacity: 1
},
transition: { duration: 0.45, ease: 'easeInOut' }
}
@@ -481,9 +476,10 @@ export function Panel() {
{...beaconMotion}
style={
isHorizontal
- ? { position: 'absolute', top: 0, left: '50%', x: '-50%', borderRadius: EDGE_BAR_RADIUS.top }
+ ? { position: 'absolute', top: 0, left: '50%', x: '-50%', backgroundColor: '#000000', borderRadius: EDGE_BAR_RADIUS.top }
: {
position: 'absolute',
+ backgroundColor: '#000000',
top: '50%',
[isRight ? 'right' : 'left']: 0,
y: '-50%',
diff --git a/tests/edgeBeacon.test.ts b/tests/edgeBeacon.test.ts
index 0cf9d97..746ed85 100644
--- a/tests/edgeBeacon.test.ts
+++ b/tests/edgeBeacon.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
-const panel = readFileSync(join(__dirname, '..', 'src/components/Panel.tsx'), 'utf8')
+const panel = readFileSync(join(__dirname, '..', 'src/components/Panel.tsx'), 'utf8').replace(/\r\n/g, '\n')
const motionBlock = panel.slice(panel.indexOf('const beaconMotion = startupBeacon'), panel.indexOf('return (\n <div className="root">'))
describe('edge bar intro and location hint', () => {
@@ -15,13 +15,18 @@ describe('edge bar intro and location hint', () => {
expect(motionBlock).toContain('[hotWidth, beaconWide, beaconWide, hotWidth]')
expect(motionBlock).toContain("['100%', '114%', '114%', '100%']")
// solid the whole time, so the bar under it never shows through
- expect(motionBlock).toMatch(/startupBeacon\s+\? \{\s+animate: \{[\s\S]*?opacity: 1,/)
- // ends on the bar's own black, edge light gone
- expect(motionBlock).toContain("backgroundColor: ['#000000', '#2c2c2c', '#2c2c2c', '#000000']")
- expect(motionBlock).toContain('edgeLight(0.18), edgeLight(0.18), edgeLight(0)]')
+ expect(motionBlock).toMatch(/startupBeacon\s+\? \{\s+animate: \{[\s\S]*?opacity: 1\s*\}/)
expect(panel).toContain('const beaconWide = hotWidth + 6')
})
+ it('solid black with no border all the way, like the bar and the drag cue (no grey, no edge light)', () => {
+ expect(motionBlock).not.toMatch(/backgroundColor|boxShadow|#2c2c2c|edgeLight/)
+ expect(panel).not.toContain('edgeLight')
+ const beacon = panel.slice(panel.indexOf('data-edge-beacon=""'), panel.indexOf('key="edge-drag-cue"'))
+ expect(beacon.match(/backgroundColor: '#000000'/g)?.length).toBe(2)
+ expect(beacon).not.toMatch(/border(Width|Color|:)|boxShadow/)
+ })
+
it('hint: the same shape as a short swell', () => {
expect(motionBlock).toContain('[hotWidth, hotWidth + 4, hotWidth]')
expect(motionBlock).toContain("transition: { duration: 0.45, ease: 'easeInOut' }")