|
12 | 12 | * |
13 | 13 | * Each row offers on hover the reader's ☆ (sidebar Favorites) and 📌 (the |
14 | 14 | * view this object's list opens by default), and on the reader's own views |
15 | | - * Rename and Delete. For a reader who may share views (objectstack#36371), |
16 | | - * the reader's own views add 「Make shared」 and a shared view saved here adds |
17 | | - * 「Unshare」 (`./objectViewViewSharing.ts`). The trigger (type icon, name, count, caret) and the |
| 15 | + * Rename and Delete. The trigger (type icon, name, count, caret) and the |
18 | 16 | * popover around this body are the switcher's (`./objectViewTitleSwitcher.tsx`). |
19 | 17 | */ |
20 | 18 |
|
21 | 19 | import { lazy, Suspense, useState, type ComponentType, type ReactNode } from 'react'; |
22 | 20 | import { cn, Input } from '@object-ui/components'; |
23 | 21 | import type { useObjectTranslation } from '@object-ui/i18n'; |
24 | | -import { Check, ListOrdered, Lock, Pencil, Pin, Plus, Share2, Star, Trash2 } from 'lucide-react'; |
| 22 | +import { Check, ListOrdered, Pencil, Pin, Plus, Star, Trash2 } from 'lucide-react'; |
25 | 23 | import type { ListViewFavorites } from '../layout/listViewFavorites.js'; |
26 | 24 | import { VIEW_TYPE_ICONS } from './objectViewHelpers.js'; |
27 | 25 | import type { CreateViewCardProps } from './CreateViewDialog.js'; |
@@ -60,10 +58,6 @@ export interface ObjectViewSwitcherMenuProps { |
60 | 58 | onManageViews?: () => void; |
61 | 59 | onRenamePersonalView?: (viewId: string) => void; |
62 | 60 | onDeletePersonalView?: (viewId: string) => void; |
63 | | - /** objectstack#36371 — 「Make shared」 on the reader's own views. Absent ⇒ not offered. */ |
64 | | - onMakeSharedView?: (viewId: string) => void; |
65 | | - /** objectstack#36371 — 「Unshare」 on the shared views marked `unsharable`. Absent ⇒ not offered. */ |
66 | | - onUnshareView?: (viewId: string) => void; |
67 | 61 | /** 「Add view」 and its card. Absent ⇒ `onAddView`, if any. */ |
68 | 62 | create?: SwitcherCreateOptions; |
69 | 63 | /** 「Add view」 for a host with no card to offer: the dropdown closes and this runs (the Create View dialog). */ |
@@ -112,8 +106,6 @@ export function ObjectViewSwitcherMenu({ |
112 | 106 | onManageViews, |
113 | 107 | onRenamePersonalView, |
114 | 108 | onDeletePersonalView, |
115 | | - onMakeSharedView, |
116 | | - onUnshareView, |
117 | 109 | create, |
118 | 110 | onAddView, |
119 | 111 | phone = false, |
@@ -170,8 +162,6 @@ export function ObjectViewSwitcherMenu({ |
170 | 162 | : t('view.switcher.pin', { defaultValue: 'Pin: open this view by default' }); |
171 | 163 | const renameLabel = t('view.rename', { defaultValue: 'Rename' }); |
172 | 164 | const deleteLabel = t('view.deleteView', { defaultValue: 'Delete View' }); |
173 | | - const makeSharedLabel = t('view.switcher.makeShared', { defaultValue: 'Make shared' }); |
174 | | - const unshareLabel = t('view.switcher.unshare', { defaultValue: 'Unshare' }); |
175 | 165 | const iconButton = 'flex h-7 w-7 shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground max-sm:h-11 max-sm:w-11 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring'; |
176 | 166 | // Shown on hover or focus, and always while set; a touch screen has no |
177 | 167 | // hover, so there they always show. |
@@ -245,30 +235,6 @@ export function ObjectViewSwitcherMenu({ |
245 | 235 | <Pencil className="h-3.5 w-3.5" /> |
246 | 236 | </button> |
247 | 237 | )} |
248 | | - {view.personal && onMakeSharedView && ( |
249 | | - <button |
250 | | - type="button" |
251 | | - data-testid="view-switcher-make-shared" |
252 | | - aria-label={makeSharedLabel} |
253 | | - title={makeSharedLabel} |
254 | | - onClick={() => { onClose(); onMakeSharedView(view.id); }} |
255 | | - className={cn(iconButton, reveal)} |
256 | | - > |
257 | | - <Share2 className="h-3.5 w-3.5" /> |
258 | | - </button> |
259 | | - )} |
260 | | - {!view.personal && view.unsharable && onUnshareView && ( |
261 | | - <button |
262 | | - type="button" |
263 | | - data-testid="view-switcher-unshare" |
264 | | - aria-label={unshareLabel} |
265 | | - title={unshareLabel} |
266 | | - onClick={() => { onClose(); onUnshareView(view.id); }} |
267 | | - className={cn(iconButton, reveal)} |
268 | | - > |
269 | | - <Lock className="h-3.5 w-3.5" /> |
270 | | - </button> |
271 | | - )} |
272 | 238 | {view.personal && onDeletePersonalView && ( |
273 | 239 | <button |
274 | 240 | type="button" |
|
0 commit comments