Private
Public Access
Split the composer's attach button into Photo/video and File (#29)
On mobile, a file input with no accept hint (needed to allow arbitrary file attachments) makes some Android browsers fall back to a generic chooser -- Camera, Camera Video, Files -- with no direct Photos/Gallery shortcut, confirmed via a screenshot showing exactly that. Android can't reliably offer both "any file type" and a gallery shortcut from a single input, so the attach button now opens a small menu: "Photo or video" uses a new input with accept="image/*,video/*" (should surface the OS media picker's gallery shortcut), "File" keeps today's unrestricted picker. Upload routing (handleFile) is unchanged either way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c094ce0975
commit
5bd1716c94
2 files changed
+124
-22
No files matched your search
@@ -105,6 +105,11 @@
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.composer-attach-wrap {
|
||||
position: relative;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.composer-attach {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
@@ -119,6 +124,42 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.composer-attach-menu-scrim {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
.composer-attach-menu {
|
||||
position: absolute;
|
||||
bottom: calc(100% + 8px);
|
||||
left: 0;
|
||||
z-index: 31;
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--ds-border);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--sp-2);
|
||||
min-width: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.composer-attach-menu button[role='menuitem'] {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--ds-text);
|
||||
text-align: left;
|
||||
padding: 8px;
|
||||
border-radius: 6px;
|
||||
font-size: 0.86rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.composer-attach-menu button[role='menuitem']:hover {
|
||||
background: var(--ds-surface-2);
|
||||
}
|
||||
|
||||
.composer-attach:hover:not(:disabled) {
|
||||
color: var(--ds-text);
|
||||
border-color: var(--ds-accent);
|
||||
|
||||
Reference in new issue
Block a user