Commit 6cf147f
feat(stream): add an actions menu to each activity entry
Activity entries were read-only: seeing that a file changed gave no way to
act on it without leaving for the Files app and finding it again. Only
third parties could contribute anything interactive, through
registerSidebarAction(), and that applies to the panel as a whole rather
than to a single entry.
Each entry now carries an actions menu offering, where applicable:
- View, opening the file in the Viewer overlay without leaving the stream
- Show in Files, revealing the file inside its folder
- Copy link, always putting an absolute URL on the clipboard so it stays
usable elsewhere
Links deliberately do not reuse the host from the activity's own link.
Providers build absolute URLs out of the server's configuration rather than
the current request, so an activity recorded by a background job carries
overwrite.cli.url — routinely http://localhost:8080, which no browser
visiting the instance can reach. Only the path is trustworthy. Where a file
id is known the link is rebuilt from scratch as /f/<fileid>, which also
addresses the file itself rather than the containing directory a provider
link often points at, and lets the server redirect to whichever view holds
it. Otherwise the provider's path is kept and re-anchored onto the origin
the session is actually using.
Show in Files reveals rather than opens. `/f/<fileid>` opens the file in the
Viewer on arrival, because the server sets `openfile=true` for anything that
is not a folder, so the link asks for `openfile=false` explicitly. Opening
is what the View action is for, and one menu entry doing both is merely
surprising. The copied link is left at the server's default instead:
whoever receives it wants the file, not this menu's idea of how to look at
the folder around it.
Actions appear only when they can do something. View needs a MIME type the
Viewer advertises, which is only known where previews were requested, so it
is absent in the sidebar. An activity with no file behind it renders no menu
at all rather than an empty one.
The menu is faded out until its row is hovered, and only on devices with a
pointer, so a touch user is never asked to hover to discover it. Fading
rather than hiding keeps it reachable by keyboard, and the row owns the
hover rule because the row owns its layout. GenericActivity already had an
unused `&__actions` style block, which now has markup to match.
Clipboard failures are reported rather than swallowed, including the
insecure-origin case where navigator.clipboard does not exist at all.
The test config gains @nextcloud/dialogs in vitest's list of inlined
dependencies. It ships CSS imports that Node cannot load, which previously
went unnoticed because every test touching that module mocked it; pulling
it into the entry components made three unrelated suites fail to collect.
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 932d60e commit 6cf147f
36 files changed
Lines changed: 664 additions & 102 deletions
File tree
- js
- src
- __tests__
- components
- activities
Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments