@@ -3,6 +3,8 @@ import { launchWithExternalToolWorkspaceReset, resolveSampleToolLaunchHref } fro
33
44const METADATA_PATH = "./metadata/samples.index.metadata.json" ;
55const PINNED_KEY = "samples-index-pinned" ;
6+ const WORKSPACE_MANAGER_PATH = "/tools/Workspace%20Manager/index.html" ;
7+ const SAMPLE_1902_WORKSPACE_PRESET_PATH = "/samples/phase-19/1902/sample.1902.workspace-all-tools.json" ;
68
79function normalize ( value ) {
810 return typeof value === "string" ? value . trim ( ) : "" ;
@@ -50,6 +52,20 @@ function normalizePresetPath(value) {
5052 return "" ;
5153}
5254
55+ function buildWorkspaceManagerSampleLaunchHref ( sample ) {
56+ const sampleId = normalize ( sample ?. id ) ;
57+ if ( sampleId !== "1902" ) {
58+ return "" ;
59+ }
60+ const params = new URLSearchParams ( {
61+ tool : "vector-map-editor" ,
62+ sampleId,
63+ sampleTitle : normalize ( sample ?. title ) || "" ,
64+ samplePresetPath : SAMPLE_1902_WORKSPACE_PRESET_PATH
65+ } ) ;
66+ return `${ WORKSPACE_MANAGER_PATH } ?${ params . toString ( ) } ` ;
67+ }
68+
5369function getExplicitRoundtripPresetPath ( sample , toolId ) {
5470 const safeToolId = normalizeToken ( toolId ) ;
5571 if ( ! safeToolId ) {
@@ -337,7 +353,19 @@ function buildSampleCard(sample) {
337353 card . appendChild ( title ) ;
338354 card . appendChild ( previewWrap ) ;
339355 card . appendChild ( description ) ;
340- if ( Array . isArray ( sample . roundtripLinks ) && sample . roundtripLinks . length > 0 ) {
356+ if ( sample . id === "1902" ) {
357+ const workspaceLaunchHref = buildWorkspaceManagerSampleLaunchHref ( sample ) ;
358+ if ( workspaceLaunchHref ) {
359+ const workspaceLaunchSection = document . createElement ( "section" ) ;
360+ workspaceLaunchSection . className = "sample-tool-roundtrip" ;
361+ workspaceLaunchSection . innerHTML = `
362+ <ul>
363+ <li><a data-tool-launch-href="${ escapeHtml ( workspaceLaunchHref ) } " href="${ escapeHtml ( workspaceLaunchHref ) } ">Open with Workspace Manager</a></li>
364+ </ul>
365+ ` ;
366+ card . appendChild ( workspaceLaunchSection ) ;
367+ }
368+ } else if ( Array . isArray ( sample . roundtripLinks ) && sample . roundtripLinks . length > 0 ) {
341369 const roundtripSection = document . createElement ( "section" ) ;
342370 roundtripSection . className = "sample-tool-roundtrip" ;
343371 roundtripSection . innerHTML = `
0 commit comments