sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Command bar customization does not work after MS Lists interface surfaces within SharePoint

Open daviduber1 opened this issue 1 year ago • 14 comments

This no longer appears to work with Microsoft List interface appearing within Microsoft SharePoint


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

daviduber1 avatar Jul 10 '24 06:07 daviduber1

@daviduber1 We will take a look at this. Could you please share the formatter JSON with us?

tpodugu-ms avatar Jul 10 '24 07:07 tpodugu-ms

I had this issue as well. In one instance it failed to hide the "new" button as the only one. In another list it seemed to not work at all. I got both scenarios to work again by pasting/saving the same json, emptying the browser cache and reloading the list. So perhaps there is a cache issue?

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "hideSelection": false, "commandBarProps": { "commands": [ { "key": "new", "hide": true }, { "key": "manageForms", "hide": true }, { "key": "share", "hide": true }, { "key": "export", "hide": true }, { "key": "integrate", "hide": true }, { "key": "copyLink", "hide": true }, { "key": "edit", "hide": true } ] } }

MissHerku avatar Jul 11 '24 10:07 MissHerku

Hello, I have the same issue, As a workaround I set the impacted lists as "Offline Client Availability" on Off. In this way SharePoint show me the standard interface and my customization appear normally. Are there some news about the resolution ? I'm not sure the workaround can work properly for a long time.

Gregghis avatar Aug 30 '24 07:08 Gregghis

@Gregghis @MissHerku

We will work on this on priority. Could you please share a video or a test list where issue is a happening?

On a different note: Currently we are aware of a bug where hiding of a new button is not working when content type is enabled in the list. And we are working on it.

tpodugu-ms avatar Aug 30 '24 11:08 tpodugu-ms

VideoListView.zip You can we in the attachment our behavior.

  1. Using Ctrl+f5 in reload we get the standard UI
  2. Refreshing or opening the list link we get the Lists UI
  3. Command Set are available in standard UI but not in Lists UI

Gregghis avatar Aug 30 '24 13:08 Gregghis

@Gregghis Thanks for sharing the video. I see the issue. Seems like selectionModes is not working?

Could you please share the list schema by Exporting the list to csv with schema? Note: This option will export the data too. Please export on a test list where this issue is happening. image

tpodugu-ms avatar Aug 31 '24 11:08 tpodugu-ms

@tpodugu-ms, export attached. SchemaList.zip

Differently from the scenario explained by MissHerku, In my case, buttons in commandbar are developed by SPFX Command Set based on this schema https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json

Gregghis avatar Sep 02 '24 10:09 Gregghis

@Gregghis Thanks for the inputs. I will let the team know about the issue and update you on ETA.

tpodugu-ms avatar Sep 02 '24 16:09 tpodugu-ms

OK .. so while not a development SPFx issue .. there is a work around to the Lists look an feel issue. If you wrap the List in a List webpart on a page .. the default display is back to the original Sharepoint list look-n-feel.

cbyappert avatar Sep 05 '24 00:09 cbyappert

For update, Microsoft made a rollback of MS List view feature (for sure in my tenant)

Gregghis avatar Sep 06 '24 15:09 Gregghis

I see the rollback as well .. good to see they recognized it as an issue.

cbyappert avatar Sep 06 '24 15:09 cbyappert

@Gregghis is correct. We had been rolling out the new UI for lists with command set customizers, but halted that roll out due to 1) generalized issues with command sets when a list is set to sync, and 2) a specific event type not firing.

reedpamsft avatar Sep 06 '24 15:09 reedpamsft

@reedpamsft thanks for your feedback. I can share my experience if it could be usefull for you. During some debugging activies we encounter differences on methods derived from class BaseListViewCommandSet onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters) onListViewUpdatedxxxxxx(args: ListViewStateChangedEventArgs): void onExecute(event: IListViewCommandSetExecuteEventParameters)

where the content of the event args are different called by MS List View integrated in SPO and the Modern one.

Gregghis avatar Sep 06 '24 16:09 Gregghis

We just got a word from our Microsoft engineer that the issue is now solved and has been rolled out. According to our tests, the SPFx customization buttons are back, even without the above workaround (the Offline Client Availability). And we are back to the SP-style UI for the lists.

You will probably need to refresh with Ctrl+F5. We are on version 16.0.0.25304 (https://your_tenant.sharepoint.com/_vti_pvt/service.cnf)

kkazala avatar Sep 18 '24 06:09 kkazala

We're having issues renaming the New command button as of Jan 6, 2025.

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "new", "text": "My New Label" } ] } }

When applying the above JSON to the list view, there appears to be a slight change in formatting of the command bar. But the target button label text isn't changed.

Before JSON:

image

After JSON:

image

SJNBham avatar Jan 06 '25 22:01 SJNBham

@SJNBham Please use key: newComposite for new dropdown command. Please expect a document update on this soon.

tpodugu-ms avatar Jan 07 '25 05:01 tpodugu-ms

Ah - what a hero @tpodugu-ms! Thank you ;) The following does update the label for the New command bar button (substitute the key "new" with "newComposite"):

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "newComposite", "text": "New Training Request" } ] } }

image

SJNBham avatar Jan 07 '25 18:01 SJNBham

After playing around with this a bit more, we discovered that the reason the "new" key value wasn't working and the "newComposite" key value worked is that we had Content Types enabled for the list. So "newComposite" works if Content Types is enabled and "new" will work if Content Types aren't enabled for the list.

We noticed the styling of the New button doesn't change (remains blue) when using the "new" key value, but does change (turns white) when using the "newComposite" key value.

SJNBham avatar Jan 07 '25 19:01 SJNBham

Thanks @SJNBham for the details on the scenario.

  1. Yes dropdown will show up if content types is enabled for the list.
  2. I will let the team know about this behavior. Blue color indicates that command is a primary command. You can apply primary: true prop to make any command primary. Eg: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "newComposite", "text": "New Training Request", "primary":"true" } ] } }

tpodugu-ms avatar Jan 07 '25 19:01 tpodugu-ms

Thanks for the tip on the styling @tpodugu-ms. Adding the "primary":"true" value did return the New button to the blue styling. So the final code for styling a list with Content Types enabled is:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "newComposite", "text": "New Button Label", "primary":"true" } ] } }

SJNBham avatar Jan 07 '25 19:01 SJNBham

Hello @daviduber1, The recent updates outlined in the documentation for Command Bar Customization may help address the issue you've encountered. These enhancements provide improved support and flexibility for customizing the command bar through JSON formatting, which could align better with your current requirements.

Ashlesha-MSFT avatar May 27 '25 16:05 Ashlesha-MSFT

Thanks @Ashlesha-MSFT, really appreciate the support that has been provided here and good to see we weren't the only ones in the same boat.

daviduber1 avatar May 28 '25 05:05 daviduber1