diff --git a/app/src/components/Archive.js b/app/src/components/Archive.js index 8893b919..78470c7c 100644 --- a/app/src/components/Archive.js +++ b/app/src/components/Archive.js @@ -85,7 +85,7 @@ import {Button, Card, darkTheme, Header, Loader, Placeholder, Popup, Segment, St import {BulkTagModal} from "./BulkTagModal"; import {taggedImageLabel, TagsSelector} from "../Tags"; import {AddToPlaylistButton} from "./AddToPlaylist"; -import {toast} from "react-semantic-toasts-2"; +import {toast} from "./ui"; import {API_ARCHIVE_UPLOAD_URI, Downloaders} from "./Vars"; import {CollectionTable} from "./collections/CollectionTable"; import {CollectionEditForm} from "./collections/CollectionEditForm"; @@ -237,12 +237,28 @@ function ArchivePage() { ? isoDatetimeToAgoPopup(archiveFile.published_modified_datetime, true) : 'unknown'; + const aboutPane = { + menuItem: 'About', render: () => +
Domain
+ {domainHeader} + +
Size
+ {humanFileSize(size)} + +
URL
+

{archiveFile.url ? {archiveFile.url} : 'N/A'}

+ +
Modified Date
+

{modifiedDatetimeString}

+
+ }; + // Helper to find file size from the files array by resolved path const findFileSize = (resolvedPath) => { if (!resolvedPath || !archiveFile.files) return null; const file = archiveFile.files.find(i => String(i.path) === String(resolvedPath)); return file && file.size - ? ({humanFileSize(file.size)}) + ? ({humanFileSize(file.size)}) : null; }; @@ -259,11 +275,51 @@ function ArchivePage() { const tableStyle = {width: '100%', borderCollapse: 'separate', borderSpacing: '0 0.7em'}; const labelStyle = {whiteSpace: 'nowrap', paddingRight: '1.5em', verticalAlign: 'top'}; + const filesPane = { + menuItem: 'Files', render: () => + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Singlefile File{localPreviewPath(data.singlefile_path, 'text/html')}
Readability File{localPreviewPath(data.readability_path, 'text/html')}
Readability Text File{localPreviewPath(data.readability_txt_path, 'text/plain')}
Readability JSON File{localPreviewPath(data.readability_json_path, 'application/json')}
Screenshot File + {screenshotPath + ? <>{screenshotPath}{findFileSize(screenshotPath)} + : 'Unknown'} +
Directory
+
+ }; + + const tabPanes = [aboutPane, filesPane]; + const tabMenu = theme === darkTheme ? {inverted: true, attached: true} : {attached: true}; return <> - + {screenshot}
{textEllipsis(archiveFile.title || data.url)}
@@ -271,13 +327,15 @@ function ArchivePage() {
Author: {archiveFile.author ? archiveFile.author : 'unknown'}
- - -
Published: {publishedDatetimeString}
-
- -
Downloaded: {downloadDatetimeString}
-
+ + + +
Published: {publishedDatetimeString}
+
+ +
Downloaded: {downloadDatetimeString}
+
+
{singlefileButton} @@ -286,78 +344,25 @@ function ArchivePage() { {deleteButton} {generateScreenshotButton} -
+ - + - + - - - About - Files - - -
Domain
- {domainHeader} + -
Size
- {humanFileSize(size)} - -
URL
-

{archiveFile.url ? {archiveFile.url} : 'N/A'}

- -
Modified Date
-

{modifiedDatetimeString}

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Singlefile File{localPreviewPath(data.singlefile_path, 'text/html')}
Readability File{localPreviewPath(data.readability_path, 'text/html')}
Readability Text File{localPreviewPath(data.readability_txt_path, 'text/plain')}
Readability JSON File{localPreviewPath(data.readability_json_path, 'application/json')}
Screenshot File - {screenshotPath - ? <>{screenshotPath}{findFileSize(screenshotPath)} - : 'Unknown'} -
Directory
-
-
- - + {historyList} - + { expect(stale).toEqual([]); }); + it('has nobody left calling the Semantic toast library', () => { + /* + * This one is a ratchet at zero, not a shrinking list. + * + * The Semantic toasts only appear if `` is mounted, and + * that container came out of App.js when App.js migrated. Any file that goes back + * to importing `toast` from react-semantic-toasts-2 would therefore raise + * notifications that silently never appear — no error, no warning, just a delete + * or a failure the user is never told about. Import `toast` from + * `src/components/ui` instead; it takes the same options. + */ + const TOASTS = /from ['"]react-semantic-toasts-2/; + const importers = sourceFiles() + .filter(file => TOASTS.test(fs.readFileSync(path.join(SRC, '..', file), 'utf8'))); + + expect(importers).toEqual([]); + }); + it('declares every migrated file that still leans on Semantic CSS classes', () => { /* * A file can stop importing semantic-ui-react and still depend on its stylesheet