|
57 | 57 | return [item.name || "", item.tab || "", item.sub || ""].join("::"); |
58 | 58 | } |
59 | 59 |
|
| 60 | + var DEFAULT_TAB_DESCRIPTIONS = { |
| 61 | + cut: "Tighten pacing, trims, and spoken edits from one focused cut workflow.", |
| 62 | + captions: "Transcribe, translate, and shape subtitle deliverables without leaving the panel.", |
| 63 | + audio: "Polish dialogue, stems, loudness, and generated sound from one audio surface.", |
| 64 | + video: "Repair, reframe, and finish image work with cleaner visual controls.", |
| 65 | + export: "Build deliverables, thumbnails, and repeatable output presets faster.", |
| 66 | + timeline: "Write sequence edits and timeline metadata back into Premiere with more control.", |
| 67 | + nlp: "Use search and language-driven tools to find footage or trigger edit actions.", |
| 68 | + settings: "Adjust workspace defaults, templates, and system-level behavior.", |
| 69 | + _default: "Open this tool and jump directly to the matching workspace.", |
| 70 | + _none: "Open tools across the editing workflow.", |
| 71 | + }; |
| 72 | + |
60 | 73 | function descriptionForItem(item, descriptionMap) { |
61 | 74 | var itemKey = getCommandPaletteItemKey(item); |
62 | 75 | if (descriptionMap && descriptionMap[itemKey]) return descriptionMap[itemKey]; |
63 | | - if (!item) return "Open tools across the editing workflow."; |
64 | | - switch (item.tab) { |
65 | | - case "cut": |
66 | | - return "Tighten pacing, trims, and spoken edits from one focused cut workflow."; |
67 | | - case "captions": |
68 | | - return "Transcribe, translate, and shape subtitle deliverables without leaving the panel."; |
69 | | - case "audio": |
70 | | - return "Polish dialogue, stems, loudness, and generated sound from one audio surface."; |
71 | | - case "video": |
72 | | - return "Repair, reframe, and finish image work with cleaner visual controls."; |
73 | | - case "export": |
74 | | - return "Build deliverables, thumbnails, and repeatable output presets faster."; |
75 | | - case "timeline": |
76 | | - return "Write sequence edits and timeline metadata back into Premiere with more control."; |
77 | | - case "nlp": |
78 | | - return "Use search and language-driven tools to find footage or trigger edit actions."; |
79 | | - case "settings": |
80 | | - return "Adjust workspace defaults, templates, and system-level behavior."; |
81 | | - default: |
82 | | - return "Open this tool and jump directly to the matching workspace."; |
83 | | - } |
| 76 | + if (!item) return (descriptionMap && descriptionMap._none) || DEFAULT_TAB_DESCRIPTIONS._none; |
| 77 | + var tabDescs = (descriptionMap && descriptionMap._tabDescriptions) || DEFAULT_TAB_DESCRIPTIONS; |
| 78 | + return tabDescs[item.tab] || tabDescs._default || DEFAULT_TAB_DESCRIPTIONS._default; |
84 | 79 | } |
85 | 80 |
|
| 81 | + var DEFAULT_SECTION_LABELS = { |
| 82 | + recent: "Recent", |
| 83 | + favorites: "Favorites", |
| 84 | + currentWorkspace: "Current Workspace", |
| 85 | + suggestedTools: "Suggested Tools", |
| 86 | + browseAll: "Browse All", |
| 87 | + matchingTools: "Matching Tools", |
| 88 | + }; |
| 89 | + |
86 | 90 | function makePaletteContext(options) { |
87 | 91 | options = options || {}; |
88 | 92 | return { |
| 93 | + sectionLabels: options.sectionLabels || DEFAULT_SECTION_LABELS, |
89 | 94 | items: Array.isArray(options.items) ? options.items : [], |
90 | 95 | query: normalizePaletteText(options.query), |
91 | 96 | activeTab: options.activeTab || "", |
|
227 | 232 | return (a.name || "").localeCompare(b.name || ""); |
228 | 233 | }); |
229 | 234 |
|
230 | | - addPaletteSection(sections, "Recent", recentItems, ctx, function (item) { |
| 235 | + var sl = ctx.sectionLabels || DEFAULT_SECTION_LABELS; |
| 236 | + addPaletteSection(sections, sl.recent, recentItems, ctx, function (item) { |
231 | 237 | return { isRecent: true, isCurrent: item.tab === ctx.activeTab }; |
232 | 238 | }, seen); |
233 | 239 |
|
234 | | - addPaletteSection(sections, "Favorites", favoriteItems, ctx, function (item, key) { |
| 240 | + addPaletteSection(sections, sl.favorites, favoriteItems, ctx, function (item, key) { |
235 | 241 | return { isRecent: !!historyLookup[key], isCurrent: item.tab === ctx.activeTab }; |
236 | 242 | }, seen); |
237 | 243 |
|
238 | | - addPaletteSection(sections, ctx.activeTab ? "Current Workspace" : "Suggested Tools", currentItems, ctx, function (item, key) { |
| 244 | + addPaletteSection(sections, ctx.activeTab ? sl.currentWorkspace : sl.suggestedTools, currentItems, ctx, function (item, key) { |
239 | 245 | return { isRecent: !!historyLookup[key], isCurrent: true }; |
240 | 246 | }, seen); |
241 | 247 |
|
242 | | - addPaletteSection(sections, "Browse All", browseItems, ctx, function (item, key) { |
| 248 | + addPaletteSection(sections, sl.browseAll, browseItems, ctx, function (item, key) { |
243 | 249 | return { isRecent: !!historyLookup[key], isCurrent: item.tab === ctx.activeTab }; |
244 | 250 | }, seen); |
245 | 251 | return sections; |
|
264 | 270 | return (a.item.name || "").localeCompare(b.item.name || ""); |
265 | 271 | }); |
266 | 272 |
|
267 | | - if (matches.length) sections.push({ label: "Matching Tools", entries: matches }); |
| 273 | + if (matches.length) sections.push({ label: (ctx.sectionLabels || DEFAULT_SECTION_LABELS).matchingTools, entries: matches }); |
268 | 274 | return sections; |
269 | 275 | } |
270 | 276 |
|
|
0 commit comments