-
Notifications
You must be signed in to change notification settings - Fork 435
fix(desktop): show archived actions inline #4375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import assert from 'node:assert/strict'; | ||
| import test from 'node:test'; | ||
| import type { ReactElement } from 'react'; | ||
| import { renderToStaticMarkup } from 'react-dom/server'; | ||
| import { parseHTML } from 'linkedom'; | ||
| import { Archive, Unarchive } from '../icons.js'; | ||
|
|
||
| function iconPathData(icon: ReactElement): string[] { | ||
| const { document } = parseHTML(renderToStaticMarkup(icon)); | ||
| return [...document.querySelectorAll('path')].map((path) => path.getAttribute('d') ?? ''); | ||
| } | ||
|
|
||
| test('archive and unarchive use one tray with inverse arrows', () => { | ||
| const archive = iconPathData(<Archive />); | ||
| const unarchive = iconPathData(<Unarchive />); | ||
|
|
||
| assert.deepEqual(archive.slice(0, 2), unarchive.slice(0, 2)); | ||
| assert.deepEqual(archive.slice(2), ['M12 3v14', 'm7 12 5 5 5-5']); | ||
| assert.deepEqual(unarchive.slice(2), ['M12 17V3', 'm7 8 5-5 5 5']); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,28 @@ | |
| * UI icons. | ||
| */ | ||
|
|
||
| import { createLucideIcon, type IconNode } from 'lucide-react'; | ||
|
|
||
| export type { LucideIcon, LucideProps } from 'lucide-react'; | ||
|
|
||
| const ARCHIVE_TRAY_NODES: IconNode = [ | ||
| ['path', { d: 'M4 12v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7', key: 'tray' }], | ||
| ['path', { d: 'M2 12h20', key: 'tray-edge' }], | ||
| ]; | ||
|
|
||
| /** A matched pair: the same tray with the arrow entering or leaving it. */ | ||
| export const Archive = createLucideIcon('archive', [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: this file's own header two lines up says it is the single seam between Maka call sites and the underlying library, and that generic UI icons come directly from The motivation is fair. Lucide ships no archive-down counterpart, and The blast radius is also unevidenced: this |
||
| ...ARCHIVE_TRAY_NODES, | ||
| ['path', { d: 'M12 3v14', key: 'arrow-stem' }], | ||
| ['path', { d: 'm7 12 5 5 5-5', key: 'arrow-head' }], | ||
| ]); | ||
|
|
||
| export const Unarchive = createLucideIcon('unarchive', [ | ||
| ...ARCHIVE_TRAY_NODES, | ||
| ['path', { d: 'M12 17V3', key: 'arrow-stem' }], | ||
| ['path', { d: 'm7 8 5-5 5 5', key: 'arrow-head' }], | ||
| ]); | ||
|
|
||
| /** | ||
| * The five-rung icon scale. Pick by the role the glyph plays, not by eye. | ||
| * | ||
|
|
@@ -54,8 +74,6 @@ export { | |
| AlertCircle, | ||
| AlertOctagon, | ||
| AlertTriangle, | ||
| Archive, | ||
| ArchiveRestore, | ||
| ArrowDown, | ||
| ArrowLeft, | ||
| ArrowRight, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: permanent delete is now one click, in the same
variant="ghost"andsize="sm"as the unarchive button directly beside it, distinguished only by the glyph. The confirmationalertdialogstill stands and the e2e asserts it, so this is recoverable and not blocking. But the overflow menu used to be the deceleration, and the rail's own comment about deletion being the one action that cannot be undone is the reason that surface exists. Worth giving it a destructive-toned icon, or putting some space between it and the safe action, so the two do not read as interchangeable at 32px.