linuxmint / linuxmint/cinnamon

Applet settings widget `filechooser` set as "folderchooser" gives wrong UI scheme

Open
#12,374 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

BUG stale
Dominant language
JavaScript
Stars
5.6k
Forks
915
Avg merge
5d 22h
Merged PRs (30d)
3

Description

Distribution

Mint 22

Package version

6.2.9

Graphics hardware in use

No response

Frequency

Always

Bug description

An applet settings widget filechooser set with "select-dir": true to be a "folderchooser" has its value still prefixed with the file:// URI scheme.

MWE:
settings-schema.json:

{
    "folderchooser": {
        "type": "filechooser",
        "select-dir": true,
        "default": "",
        "description": "Folder chooser"
    }
}

applet.js:

const Applet = imports.ui.applet;
const AppletSettings = imports.ui.settings.AppletSettings;
const Main = imports.ui.main;

class ThisApplet extends Applet.TextApplet {
    constructor(metadata, orientation, panel_height, instance_id) {
        super(orientation, panel_height, instance_id);

        this.set_applet_label("Open settings...");

        const settings = new AppletSettings(this, metadata.uuid, instance_id);

        settings.bind('folderchooser', null, (uri) => {
            Main.notify(metadata.uuid, uri);
        });
    }
}

function main(metadata, orientation, panel_height, instance_id) {
    return new ThisApplet(metadata, orientation, panel_height, instance_id);
}
Steps to reproduce
  1. Download this ZIP containing the mentioned MWE as a complete applet and put its contained folder in ~/.local/share/cinnamon/applets.

  2. Open the Applets window, add the applet and open its settings window.

  3. Modify the "folderchooser" choice and read the URI shown in the notification.

Expected behavior

The URI put in the filechooser's value should be prefixed with the directory:// URI scheme.

Additional information

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided settings-schema.json and applet.js MWE, reproduce the folderchooser behavior in Cinnamon 6.2.9, and trace the applet settings filechooser handling. Confirm that selecting a directory produces a value using the directory:// URI scheme rather than file://, then add or update coverage if the relevant test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.