fix: Several new worklist issues (#6130)

* fix: Several new worklist issues

* refactor: Export a single OnStudyDoubleClick type from the StudyList barrel

Addresses PR review feedback: the double-click handler signature was
written out in both TableProps and the WorkList customization cast,
so the two could drift apart.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: Run worklist study double-click as a command, registrable by modes

- Modes can now export getCommandsModule on their definition; appInit
  registers it (via the new ExtensionManager.registerCommandsModule)
  before the mode is instantiated, in a new 'WORKLIST' commands context,
  so the commands are available on the worklist before any mode route
  is entered.
- The workList.onStudyDoubleClick customization is now a command run
  input (name/options) instead of a bare function, defaulting to the
  new launchDefaultMode command, which launches the default workflow
  falling back to the first applicable one. commandOptions.workflowId
  overrides it to a specific mode.
- Duplicate mode ids are now skipped before running their modeFactory
  rather than after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bill WallaceandClaude Fable 5 authored and GitHub committed 2026-07-10 08:16:16 -04:00
1 parent dbb8b1526e
commit 6b6761088b
11 files changed
+230 -27

No files matched your search

@@ -521,6 +521,54 @@ window.config = {
},
},
],
};
`,
},
{
id: 'workList.onStudyDoubleClick',
description: (
<>
The command run when a study row is double-clicked (the row is selected first). Accepts
anything <code>commandsManager.run</code> does: a command name string,{' '}
<code>{"{ commandName, commandOptions, context }"}</code>, an array of those, or a plain
function. At call time the following are merged into the command options (a plain
function receives them as its single argument):
<ul>
<li>
<code>study</code>: the double-clicked <code>StudyRow</code>.
</li>
<li>
<code>workflows</code>: the workflows applicable to the study, in the same order as
the row's Launch Workflow menu. Each has <code>id</code>, <code>displayName</code>,{' '}
<code>isDefault</code>, and <code>launchWithStudy(study)</code>.
</li>
<li>
<code>defaultWorkflow</code>: the user's default workflow when it applies to the
study, else <code>undefined</code>.
</li>
</ul>
The default <code>launchDefaultMode</code> command launches the default workflow, falling
back to the first applicable one. Modes can contribute their own commands via a{' '}
<code>getCommandsModule</code> export on the mode definition — these are registered at
app init in the <code>WORKLIST</code> context, before any mode route is entered.
Currently only applies when <code>workList.variant</code> is <code>'default'</code>.
</>
),
default: "{ commandName: 'launchDefaultMode' }",
configuration: `
window.config = {
// rest of window config
customizationService: [
{
'workList.onStudyDoubleClick': {
// Always launch a specific mode on double click, regardless of the default.
$set: {
commandName: 'launchDefaultMode',
commandOptions: { workflowId: '@ohif/mode-longitudinal' },
},
},
},
],
};
`,
},