From dfd108ecbe967b943b25ed12321cb0efdc21b89d Mon Sep 17 00:00:00 2001 From: guerler Date: Sat, 18 Oct 2025 22:49:20 +0300 Subject: [PATCH 01/81] Create DatasetDisplay component --- .../src/components/Dataset/DatasetDisplay.vue | 18 +++++++++++++ client/src/components/Dataset/DatasetView.vue | 26 ++++++------------- 2 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 client/src/components/Dataset/DatasetDisplay.vue diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue new file mode 100644 index 000000000000..5cce801bd2b0 --- /dev/null +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -0,0 +1,18 @@ + + + + diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue index f4c62c415b42..cb9a1d0f3b1e 100644 --- a/client/src/components/Dataset/DatasetView.vue +++ b/client/src/components/Dataset/DatasetView.vue @@ -20,7 +20,7 @@ import DatasetAttributes from "@/components/DatasetInformation/DatasetAttributes import DatasetDetails from "@/components/DatasetInformation/DatasetDetails.vue"; import VisualizationsList from "@/components/Visualizations/Index.vue"; import VisualizationFrame from "@/components/Visualizations/VisualizationFrame.vue"; -import CenterFrame from "@/entry/analysis/modules/CenterFrame.vue"; +import DatasetDisplay from "./DatasetDisplay.vue"; const datasetStore = useDatasetStore(); const datatypeStore = useDatatypeStore(); @@ -187,12 +187,7 @@ watch( :dataset-id="datasetId" :visualization="preferredVisualization" @load="iframeLoading = false" /> - -
+

Download Required

This file type ({{ dataset.file_ext }}) will download automatically when accessed directly.

@@ -203,23 +198,18 @@ watch(
-
- -
+

Download Required

This file type ({{ dataset.file_ext }}) will download automatically when accessed directly.

@@ -229,9 +219,9 @@ watch(
-
From a662f6a88abf1a132a686da86c181ad267efb392 Mon Sep 17 00:00:00 2001 From: guerler Date: Sat, 18 Oct 2025 22:55:03 +0300 Subject: [PATCH 02/81] Switch from iframe to div --- .../src/components/Dataset/DatasetDisplay.vue | 24 +++++++++++++++---- lib/galaxy/datatypes/tabular.py | 2 +- .../webapps/galaxy/dataset/large_file.mako | 13 ---------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index 5cce801bd2b0..5149921844a5 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -1,5 +1,7 @@ diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index 39e361938d70..93d658118b19 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -186,7 +186,7 @@ def display_data( elif to_ext or not preview: to_ext = to_ext or dataset.extension return self._serve_raw(dataset, to_ext, headers, **kwd) - elif dataset.metadata.columns > 100: + elif dataset.metadata.columns > 1: # Fancy tabular display is only suitable for datasets without an incredibly large number of columns. # We should add a new datatype 'matrix', with its own draw method, suitable for this kind of data. # For now, default to the old behavior, ugly as it is. Remove this after adding 'matrix'. diff --git a/templates/webapps/galaxy/dataset/large_file.mako b/templates/webapps/galaxy/dataset/large_file.mako index 68148d3cb6fe..2af4f783591e 100644 --- a/templates/webapps/galaxy/dataset/large_file.mako +++ b/templates/webapps/galaxy/dataset/large_file.mako @@ -1,14 +1 @@ -<%inherit file="/base.mako"/> -<%namespace file="/dataset/display.mako" import="render_deleted_data_message" /> - -${ render_deleted_data_message( data ) } - -
- This dataset is large and only the first megabyte is shown below.
- Show all | - Save -
- -
 ${ util.unicodify( truncated_data ) | h }
-
From 5c4046cc776ae3a9d490d98be640103b9f64ea25 Mon Sep 17 00:00:00 2001 From: guerler Date: Sat, 18 Oct 2025 23:07:37 +0300 Subject: [PATCH 03/81] Move template content to display component --- .../src/components/Dataset/DatasetDisplay.vue | 25 ++++++++++++++++--- .../webapps/galaxy/dataset/binary_file.mako | 18 +------------ .../webapps/galaxy/dataset/large_file.mako | 2 +- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index 5149921844a5..8d9de486fb1f 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -11,6 +11,7 @@ interface Props { const props = withDefaults(defineProps(), {}); const content = ref(); +const deleted = ref(true); onMounted(async () => { const url = withPrefix(`/datasets/${props.datasetId}/display/?preview=True`); @@ -25,8 +26,26 @@ onMounted(async () => { diff --git a/templates/webapps/galaxy/dataset/binary_file.mako b/templates/webapps/galaxy/dataset/binary_file.mako index 508281a0eb69..7cf3a574cda7 100644 --- a/templates/webapps/galaxy/dataset/binary_file.mako +++ b/templates/webapps/galaxy/dataset/binary_file.mako @@ -1,17 +1 @@ -<%inherit file="/base.mako"/> -<%namespace file="/dataset/display.mako" import="render_deleted_data_message" /> - -${ render_deleted_data_message( data ) } - -
- This is a binary (or unknown to Galaxy) dataset of size ${ file_size }. Preview is not implemented for this filetype. Displaying - %if truncated: -first 100KB - %endif - as ASCII text
- Download -
- -
-${ util.unicodify( file_contents ) | h }
-
+${ util.unicodify( file_contents ) | h } \ No newline at end of file diff --git a/templates/webapps/galaxy/dataset/large_file.mako b/templates/webapps/galaxy/dataset/large_file.mako index 2af4f783591e..2507f69ae5b4 100644 --- a/templates/webapps/galaxy/dataset/large_file.mako +++ b/templates/webapps/galaxy/dataset/large_file.mako @@ -1 +1 @@ -${ util.unicodify( truncated_data ) | h } +${ util.unicodify( truncated_data ) | h } \ No newline at end of file From 700bd075b70e0a9d9b6ef4dd47fd1aa2c1316d00 Mon Sep 17 00:00:00 2001 From: guerler Date: Sat, 18 Oct 2025 23:38:35 +0300 Subject: [PATCH 04/81] Switch over to only parsing the chunk --- .../src/components/Dataset/DatasetDisplay.vue | 13 +++++++++- lib/galaxy/datatypes/tabular.py | 2 +- .../galaxy/dataset/tabular_chunked.mako | 26 +------------------ 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index 8d9de486fb1f..31368364eede 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -3,6 +3,8 @@ import axios from "axios"; import { onMounted, ref } from "vue"; import { withPrefix } from "@/utils/redirect"; +import TabularChunkedView from "components/Visualizations/Tabular/TabularChunkedView.vue"; + interface Props { datasetId: string; isPreview: boolean; @@ -11,9 +13,18 @@ interface Props { const props = withDefaults(defineProps(), {}); const content = ref(); +const datasetDetails = ref(); const deleted = ref(true); onMounted(async () => { + const detailsUrl = withPrefix(`/api/datasets/${props.datasetId}`); + try { + const { data } = await axios.get(detailsUrl); + datasetDetails.value = data; + } catch (e) { + console.error(e); + } + const url = withPrefix(`/datasets/${props.datasetId}/display/?preview=True`); try { const { data } = await axios.get(url); @@ -21,7 +32,6 @@ onMounted(async () => { } catch (e) { console.error(e); } - }); @@ -43,6 +53,7 @@ onMounted(async () => { as ASCII text
Download
+
             {{  content }}
         
diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index 93d658118b19..39e361938d70 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -186,7 +186,7 @@ def display_data( elif to_ext or not preview: to_ext = to_ext or dataset.extension return self._serve_raw(dataset, to_ext, headers, **kwd) - elif dataset.metadata.columns > 1: + elif dataset.metadata.columns > 100: # Fancy tabular display is only suitable for datasets without an incredibly large number of columns. # We should add a new datatype 'matrix', with its own draw method, suitable for this kind of data. # For now, default to the old behavior, ugly as it is. Remove this after adding 'matrix'. diff --git a/templates/webapps/galaxy/dataset/tabular_chunked.mako b/templates/webapps/galaxy/dataset/tabular_chunked.mako index 1cb2b146e8de..4532b5d218b0 100644 --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako @@ -1,25 +1 @@ -<%inherit file="/base.mako"/> -<%namespace file="/dataset/display.mako" import="render_deleted_data_message" /> - -<%def name="title()">Dataset Display - -<%def name="javascript_app()"> - - - ${parent.javascript_app()} - - - - - -${ render_deleted_data_message( dataset ) } +${h.dumps(chunk)} \ No newline at end of file From 29e04af3696a65233ad1dd9f18accb8a467e6d6e Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 19 Oct 2025 07:33:51 +0300 Subject: [PATCH 05/81] Remove tabular_chunked.mako --- .../src/components/Dataset/DatasetDisplay.vue | 2 +- lib/galaxy/datatypes/binary.py | 21 +---------------- lib/galaxy/datatypes/tabular.py | 23 +------------------ .../galaxy/dataset/tabular_chunked.mako | 1 - 4 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 templates/webapps/galaxy/dataset/tabular_chunked.mako diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index 31368364eede..9de287b3c008 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -53,7 +53,7 @@ onMounted(async () => { as ASCII text
Download - +
             {{  content }}
         
diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index bc8da6d4797c..10d5df831bb1 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -819,26 +819,7 @@ def display_data( elif to_ext or not preview: return super().display_data(trans, dataset, preview, filename, to_ext, **kwd) else: - column_names = dataset.metadata.column_names - if not column_names: - column_names = [] - column_types = dataset.metadata.column_types - if not column_types: - column_types = [] - column_number = dataset.metadata.columns - if column_number is None: - column_number = 1 - return ( - trans.fill_template( - "/dataset/tabular_chunked.mako", - dataset=dataset, - chunk=self.get_chunk(trans, dataset, 0), - column_number=column_number, - column_names=column_names, - column_types=column_types, - ), - headers, - ) + return self.get_chunk(trans, dataset, 0), headers def validate(self, dataset: DatasetProtocol, **kwd) -> DatatypeValidation: if not BamNative.is_bam(dataset.get_file_name()): diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index 39e361938d70..a74d002b0174 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -206,28 +206,7 @@ def display_data( headers, ) else: - column_names = "null" - if dataset.metadata.column_names: - column_names = dataset.metadata.column_names - elif hasattr(dataset.datatype, "column_names"): - column_names = dataset.datatype.column_names - column_types = dataset.metadata.column_types - if not column_types: - column_types = [] - column_number = dataset.metadata.columns - if column_number is None: - column_number = "null" - return ( - trans.fill_template( - "/dataset/tabular_chunked.mako", - dataset=dataset, - chunk=self.get_chunk(trans, dataset, 0), - column_number=column_number, - column_names=column_names, - column_types=column_types, - ), - headers, - ) + return self.get_chunk(trans, dataset, 0), headers def display_as_markdown(self, dataset_instance: DatasetProtocol) -> str: with open(dataset_instance.get_file_name()) as f: diff --git a/templates/webapps/galaxy/dataset/tabular_chunked.mako b/templates/webapps/galaxy/dataset/tabular_chunked.mako deleted file mode 100644 index 4532b5d218b0..000000000000 --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ /dev/null @@ -1 +0,0 @@ -${h.dumps(chunk)} \ No newline at end of file From 6abfe1a5d83ae4b644c56b2ab2821aef6434d216 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 19 Oct 2025 07:45:25 +0300 Subject: [PATCH 06/81] Remove large_file and binary_file makos --- lib/galaxy/datatypes/data.py | 20 ++----------------- lib/galaxy/datatypes/sequence.py | 5 +---- lib/galaxy/datatypes/tabular.py | 9 +-------- .../webapps/galaxy/dataset/binary_file.mako | 1 - .../webapps/galaxy/dataset/large_file.mako | 1 - 5 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 templates/webapps/galaxy/dataset/binary_file.mako delete mode 100644 templates/webapps/galaxy/dataset/large_file.mako diff --git a/lib/galaxy/datatypes/data.py b/lib/galaxy/datatypes/data.py index 62aaa6c91744..95bf7c662741 100644 --- a/lib/galaxy/datatypes/data.py +++ b/lib/galaxy/datatypes/data.py @@ -510,16 +510,7 @@ def _serve_file_download(self, headers, data, trans, to_ext, file_size, **kwd): def _serve_binary_file_contents_as_text(self, trans, data, headers, file_size, max_peek_size): headers["content-type"] = "text/html" with open(data.get_file_name(), "rb") as fh: - return ( - trans.fill_template_mako( - "/dataset/binary_file.mako", - data=data, - file_contents=fh.read(max_peek_size), - file_size=util.nice_size(file_size), - truncated=file_size > max_peek_size, - ), - headers, - ) + return unicodify(fh.read(max_peek_size)), headers def _serve_file_contents(self, trans, data, headers, preview, file_size, max_peek_size): from galaxy.datatypes import images @@ -531,14 +522,7 @@ def _serve_file_contents(self, trans, data, headers, preview, file_size, max_pee with compression_utils.get_fileobj(data.get_file_name(), "rb") as fh: # preview large text file headers["content-type"] = "text/html" - return ( - trans.fill_template_mako( - "/dataset/large_file.mako", - truncated_data=fh.read(max_peek_size), - data=data, - ), - headers, - ) + return unicodify(fh.read(max_peek_size)), headers def display_data( self, diff --git a/lib/galaxy/datatypes/sequence.py b/lib/galaxy/datatypes/sequence.py index ee6f52b1e6ff..baede5744641 100644 --- a/lib/galaxy/datatypes/sequence.py +++ b/lib/galaxy/datatypes/sequence.py @@ -337,10 +337,7 @@ def display_data( mime = "text/plain" self._clean_and_set_mime_type(trans, mime, headers) return chunk[:-1], headers - return ( - trans.fill_template_mako("/dataset/large_file.mako", truncated_data=chunk[:-1], data=dataset), - headers, - ) + return util.unicodify(chunk[:-1]), headers else: return super().display_data(trans, dataset, preview, filename, to_ext, **kwd) diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index a74d002b0174..62a00e45b874 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -197,14 +197,7 @@ def display_data( else: headers["content-type"] = "text/html" with compression_utils.get_fileobj(dataset.get_file_name(), "rb") as fh: - return ( - trans.fill_template_mako( - "/dataset/large_file.mako", - truncated_data=fh.read(max_peek_size), - data=dataset, - ), - headers, - ) + return util.unicodify(fh.read(max_peek_size)), headers else: return self.get_chunk(trans, dataset, 0), headers diff --git a/templates/webapps/galaxy/dataset/binary_file.mako b/templates/webapps/galaxy/dataset/binary_file.mako deleted file mode 100644 index 7cf3a574cda7..000000000000 --- a/templates/webapps/galaxy/dataset/binary_file.mako +++ /dev/null @@ -1 +0,0 @@ -${ util.unicodify( file_contents ) | h } \ No newline at end of file diff --git a/templates/webapps/galaxy/dataset/large_file.mako b/templates/webapps/galaxy/dataset/large_file.mako deleted file mode 100644 index 2507f69ae5b4..000000000000 --- a/templates/webapps/galaxy/dataset/large_file.mako +++ /dev/null @@ -1 +0,0 @@ -${ util.unicodify( truncated_data ) | h } \ No newline at end of file From a058c7370db2723807891d58e8f14af946997d4a Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 19 Oct 2025 08:36:04 +0300 Subject: [PATCH 07/81] Begin to handle dataset details in dataset display component --- .../src/components/Dataset/DatasetDisplay.vue | 22 ++++++++++--------- client/src/components/Dataset/DatasetView.vue | 6 ++--- lib/galaxy/datatypes/data.py | 5 ++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index 9de287b3c008..ffeb60349c8a 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -1,10 +1,13 @@ diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue index cb9a1d0f3b1e..448de442def3 100644 --- a/client/src/components/Dataset/DatasetView.vue +++ b/client/src/components/Dataset/DatasetView.vue @@ -14,13 +14,13 @@ import { bytesToString } from "@/utils/utils"; import DatasetError from "../DatasetInformation/DatasetError.vue"; import LoadingSpan from "../LoadingSpan.vue"; import DatasetAsImage from "./DatasetAsImage/DatasetAsImage.vue"; +import DatasetDisplay from "./DatasetDisplay.vue"; import DatasetState from "./DatasetState.vue"; import Heading from "@/components/Common/Heading.vue"; import DatasetAttributes from "@/components/DatasetInformation/DatasetAttributes.vue"; import DatasetDetails from "@/components/DatasetInformation/DatasetDetails.vue"; import VisualizationsList from "@/components/Visualizations/Index.vue"; import VisualizationFrame from "@/components/Visualizations/VisualizationFrame.vue"; -import DatasetDisplay from "./DatasetDisplay.vue"; const datasetStore = useDatasetStore(); const datatypeStore = useDatatypeStore(); @@ -204,7 +204,7 @@ watch( class="p-3" /> @@ -221,7 +221,7 @@ watch( diff --git a/lib/galaxy/datatypes/data.py b/lib/galaxy/datatypes/data.py index 95bf7c662741..24451b7bb9fd 100644 --- a/lib/galaxy/datatypes/data.py +++ b/lib/galaxy/datatypes/data.py @@ -602,9 +602,8 @@ def display_data( else: # displaying trans.log_event(f"Display dataset id: {str(dataset.id)}") max_peek_size = _get_max_peek_size(dataset) - if ( - _is_binary_file(dataset) and preview and hasattr(trans, "fill_template_mako") - ): # preview file which format is unknown (to Galaxy), we still try to display this as text + if _is_binary_file(dataset) and preview: + # preview file which format is unknown (to Galaxy), we still try to display this as text return self._serve_binary_file_contents_as_text(trans, dataset, headers, file_size, max_peek_size) else: # text/html, or image, or display was called without preview flag return self._serve_file_contents(trans, dataset, headers, preview, file_size, max_peek_size) From 52433debd26128226d8e99bb6294b1ee2a9f52d1 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 19 Oct 2025 08:44:26 +0300 Subject: [PATCH 08/81] Add links to download and display complete datasets --- .../src/components/Dataset/DatasetDisplay.vue | 29 +++++++++++-------- client/src/components/Dataset/DatasetView.vue | 12 ++------ 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index ffeb60349c8a..e0db43cd5767 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -1,6 +1,6 @@ diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue index 6214914cdb0d..f93bcf94f89b 100644 --- a/client/src/components/Dataset/DatasetView.vue +++ b/client/src/components/Dataset/DatasetView.vue @@ -65,9 +65,7 @@ const isBinaryDataset = computed(() => { if (!dataset.value?.file_ext || !datatypesMapperStore.datatypesMapper) { return false; } - return datatypesMapperStore.datatypesMapper.isSubTypeOfAny(dataset.value.file_ext, [ - "galaxy.datatypes.binary", - ]); + return datatypesMapperStore.datatypesMapper.isSubTypeOfAny(dataset.value.file_ext, ["galaxy.datatypes.binary"]); }); const isImageDataset = computed(() => { @@ -79,7 +77,6 @@ const isImageDataset = computed(() => { ]); }); - const isPdfDataset = computed(() => { return dataset.value?.file_ext === "pdf"; }); From 3dc479f4731bc0dddc679ff82627e51a63157e87 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 19 Oct 2025 10:53:34 +0300 Subject: [PATCH 14/81] Remove unused constant and default props --- client/src/components/Dataset/DatasetDisplay.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index 8bb22b2c61d7..048d91f6569e 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -13,11 +13,9 @@ interface Props { isBinary: boolean; } -const MAX_PEEK_SIZE_BINARY = 100000; - const { getDataset, isLoadingDataset } = useDatasetStore(); -const props = withDefaults(defineProps(), {}); +const props = defineProps(); const content = ref(); From 676fbc83d8d824aeddc3a4dd3f02fa4d95418118 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 19 Oct 2025 13:28:47 +0300 Subject: [PATCH 15/81] Add truncated peek size to header --- .../src/components/Dataset/DatasetDisplay.vue | 17 ++++++++++------- lib/galaxy/datatypes/data.py | 3 +++ lib/galaxy/datatypes/sequence.py | 1 + lib/galaxy/datatypes/tabular.py | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue index 048d91f6569e..58d10bfd32b2 100644 --- a/client/src/components/Dataset/DatasetDisplay.vue +++ b/client/src/components/Dataset/DatasetDisplay.vue @@ -18,19 +18,25 @@ const { getDataset, isLoadingDataset } = useDatasetStore(); const props = defineProps(); const content = ref(); +const isTruncated = ref(); -const contentLength = computed(() => (typeof content.value === "string" ? content.value?.length : 0)); +const contentLength = computed(() => { + if (typeof content.value !== "string") { + return 0; + } + return new TextEncoder().encode(content.value).length; +}); const dataset = computed(() => getDataset(props.datasetId)); const datasetUrl = computed(() => withPrefix(`/dataset/display?dataset_id=${props.datasetId}`)); const downloadUrl = computed(() => withPrefix(`${datasetUrl.value}&to_ext=${dataset.value?.file_ext}`)); const isLoading = computed(() => isLoadingDataset(props.datasetId)); -const isTruncated = computed(() => dataset.value && dataset.value.file_size > contentLength.value); onMounted(async () => { const url = withPrefix(`/datasets/${props.datasetId}/display/?preview=True`); try { - const { data } = await axios.get(url); + const { data, headers } = await axios.get(url); content.value = data; + isTruncated.value = headers["x-content-truncated"] === "true"; } catch (e) { console.error(e); } @@ -51,10 +57,7 @@ onMounted(async () => { is not implemented for this filetype. Displaying as ASCII text.
-
- This dataset is large and only the first {{ bytesToString(contentLength) }} is shown - below. -
+
This dataset is large and only the first {{ bytesToString(contentLength) }} is shown below.
Download
diff --git a/lib/galaxy/datatypes/data.py b/lib/galaxy/datatypes/data.py
index 24451b7bb9fd..ce16a8e74221 100644
--- a/lib/galaxy/datatypes/data.py
+++ b/lib/galaxy/datatypes/data.py
@@ -509,6 +509,8 @@ def _serve_file_download(self, headers, data, trans, to_ext, file_size, **kwd):
 
     def _serve_binary_file_contents_as_text(self, trans, data, headers, file_size, max_peek_size):
         headers["content-type"] = "text/html"
+        if file_size > max_peek_size:
+            headers["x-content-truncated"] = max_peek_size
         with open(data.get_file_name(), "rb") as fh:
             return unicodify(fh.read(max_peek_size)), headers
 
@@ -522,6 +524,7 @@ def _serve_file_contents(self, trans, data, headers, preview, file_size, max_pee
         with compression_utils.get_fileobj(data.get_file_name(), "rb") as fh:
             # preview large text file
             headers["content-type"] = "text/html"
+            headers["x-content-truncated"] = max_peek_size
             return unicodify(fh.read(max_peek_size)), headers
 
     def display_data(
diff --git a/lib/galaxy/datatypes/sequence.py b/lib/galaxy/datatypes/sequence.py
index baede5744641..339f22b16652 100644
--- a/lib/galaxy/datatypes/sequence.py
+++ b/lib/galaxy/datatypes/sequence.py
@@ -337,6 +337,7 @@ def display_data(
                     mime = "text/plain"
                     self._clean_and_set_mime_type(trans, mime, headers)
                     return chunk[:-1], headers
+                headers["x-content-truncated"] = max_peek_size
                 return util.unicodify(chunk[:-1]), headers
         else:
             return super().display_data(trans, dataset, preview, filename, to_ext, **kwd)
diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py
index 62a00e45b874..8203dbebd578 100644
--- a/lib/galaxy/datatypes/tabular.py
+++ b/lib/galaxy/datatypes/tabular.py
@@ -196,6 +196,7 @@ def display_data(
                 return open(dataset.get_file_name(), mode="rb"), headers
             else:
                 headers["content-type"] = "text/html"
+                headers["x-content-truncated"] = max_peek_size
                 with compression_utils.get_fileobj(dataset.get_file_name(), "rb") as fh:
                     return util.unicodify(fh.read(max_peek_size)), headers
         else:

From d1ef9cbd27099bc691474cb04066d20eb9ba8465 Mon Sep 17 00:00:00 2001
From: guerler 
Date: Sun, 19 Oct 2025 13:53:13 +0300
Subject: [PATCH 16/81] Update dataset display

---
 client/src/components/Dataset/DatasetDisplay.vue | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/client/src/components/Dataset/DatasetDisplay.vue b/client/src/components/Dataset/DatasetDisplay.vue
index 58d10bfd32b2..f08dafe6497c 100644
--- a/client/src/components/Dataset/DatasetDisplay.vue
+++ b/client/src/components/Dataset/DatasetDisplay.vue
@@ -18,14 +18,8 @@ const { getDataset, isLoadingDataset } = useDatasetStore();
 const props = defineProps();
 
 const content = ref();
-const isTruncated = ref();
+const truncated = ref();
 
-const contentLength = computed(() => {
-    if (typeof content.value !== "string") {
-        return 0;
-    }
-    return new TextEncoder().encode(content.value).length;
-});
 const dataset = computed(() => getDataset(props.datasetId));
 const datasetUrl = computed(() => withPrefix(`/dataset/display?dataset_id=${props.datasetId}`));
 const downloadUrl = computed(() => withPrefix(`${datasetUrl.value}&to_ext=${dataset.value?.file_ext}`));
@@ -36,7 +30,7 @@ onMounted(async () => {
     try {
         const { data, headers } = await axios.get(url);
         content.value = data;
-        isTruncated.value = headers["x-content-truncated"] === "true";
+        truncated.value = headers["x-content-truncated"];
     } catch (e) {
         console.error(e);
     }
@@ -56,8 +50,8 @@ onMounted(async () => {
                 This is a binary (or unknown to Galaxy) dataset of size {{ bytesToString(dataset.file_size) }}. Preview
                 is not implemented for this filetype. Displaying as ASCII text.
             
-            
-
This dataset is large and only the first {{ bytesToString(contentLength) }} is shown below.
+
+
This dataset is large and only the first {{ bytesToString(truncated) }} is shown below.
Download

From cbfa383abf97e603b5f347728be92e18a8889bf7 Mon Sep 17 00:00:00 2001
From: guerler 
Date: Sun, 19 Oct 2025 13:55:29 +0300
Subject: [PATCH 17/81] Add overflow

---
 client/src/components/Dataset/DatasetView.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue
index f93bcf94f89b..6bfdfcbe5139 100644
--- a/client/src/components/Dataset/DatasetView.vue
+++ b/client/src/components/Dataset/DatasetView.vue
@@ -188,7 +188,7 @@ watch(
                  Error
             
         
-        
+
-
+

Download Required

From 8b7a559b37349258beb6e07d225f6dc528214c2e Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 19 Oct 2025 15:56:31 +0300 Subject: [PATCH 18/81] Adjust overflow behavior --- client/src/components/Dataset/DatasetView.vue | 4 ++-- client/src/components/Visualizations/VisualizationFrame.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue index 6bfdfcbe5139..d6f386d33e9f 100644 --- a/client/src/components/Dataset/DatasetView.vue +++ b/client/src/components/Dataset/DatasetView.vue @@ -188,7 +188,7 @@ watch( Error -
+
-
+

Download Required

diff --git a/client/src/components/Visualizations/VisualizationFrame.vue b/client/src/components/Visualizations/VisualizationFrame.vue index 4ff949deb8df..c78abbee5249 100644 --- a/client/src/components/Visualizations/VisualizationFrame.vue +++ b/client/src/components/Visualizations/VisualizationFrame.vue @@ -95,7 +95,7 @@ onMounted(() => {