Merge pull request #35906 from overleaf/dk-library-references-trashed

Soft-delete library references (move to trash)

GitOrigin-RevId: 908a4d41724300c70d56e850cdb519b7a274ad5a
This commit is contained in:
David
2026-09-17 11:41:40 +00:00
committed by Copybot
parent 03cbfbe90f
commit ea989a4788
5 changed files with 117 additions and 3 deletions
@@ -15,12 +15,26 @@ import { useProjectListContext } from '@/features/project-list/context/project-l
import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
import { ActivePage } from '../../util/navigation-state'
function SidebarDsNav({ activePage }: { activePage: ActivePage }) {
function SidebarDsNav({
activePage,
trashActive = false,
}: {
activePage: ActivePage
/**
* Whether the trash is active. This is only relevant when the active page is
* "library" as which project page is active is determined by the selected filter.
*/
trashActive?: boolean
}) {
const { t } = useTranslation()
const { show: showAddAffiliationWidget } = useAddAffiliation()
const isLibraryEnabled = isSplitTestEnabled('overleaf-library')
const { filter, selectedTagId, selectFilter } = useProjectListContext()
const isTrashActive = selectedTagId === undefined && filter === 'trashed'
const isTrashActive =
activePage === 'library'
? trashActive
: selectedTagId === undefined && filter === 'trashed'
const [dsNavLibraryLinkModule] = importOverleafModules('dsNavLibraryLink')
const DsNavLibraryLink: JSXElementConstructor<{ active?: boolean }> =
dsNavLibraryLinkModule?.import.default
@@ -69,7 +83,9 @@ function SidebarDsNav({ activePage }: { activePage: ActivePage }) {
{isLibraryEnabled && (
<>
{DsNavLibraryLink && (
<DsNavLibraryLink active={activePage === 'library'} />
<DsNavLibraryLink
active={activePage === 'library' && !trashActive}
/>
)}
<button
type="button"
+1
View File
@@ -211,6 +211,7 @@ export interface Meta {
'ol-languages': SpellCheckLanguage[]
'ol-learnedWords': string[]
'ol-legacyEditorThemes': { name: string; dark: boolean }[]
'ol-libraryView': 'library' | 'trashed'
'ol-licenseQuantity'?: number
'ol-loadingText': string
'ol-localIndividualPlans': LocalIndividualPlans