Skip to content

Add the ability to embed source code into the profile, and upload it together with the profile #4018

@mstange

Description

@mstange

When capturing profiles of local Firefox builds, or of other applications with local source code, we lose access to that source code once the profile is uploaded and shared.
To support this use case, we should give users the ability to embed source code into the profile during upload.

There are three sets of source code files that the user might be interested in uploading, from "most interested" to "least interested":

  1. The file which is currently displayed in the source view, if any.
  2. All files which the user has opened in the source view during this session, these are currently cached in memory.
  3. All files which had any time spent in them anywhere in the profile.

Here's how I envision the UX for this.

In the sharing panel, in the list of checkboxes of data to share, add a new item: "Include local source code".
Only show this item if we have any source code from a non-public source cached in memory due to the user opening the source view at least once, to keep the default set of checkboxes small.
Directly underneath the checkbox, draw a tree view similar to the file sidebar in VS Code. In this tree view, individual files and directories can be checked or unchecked. This view should list all non-public files we know about, ordered by how much time the profile spends in those files ("total" time, not "self" time). Directories which contain only one child should be collapsed together with that child into single row as <parent dir> / <child>. This can be chained.
By default, if the source view is currently closed, no file should be checked. If the source view is currently open and displaying a file, only that file should be checked.
Clicking the checkbox on the root node should check / uncheck all. The checkbox of the root node should be synced to the overall "Include local source code" checkbox.
Underneath the tree view, it should say "2 files will be included in the profile (37KB total)", with the appropriate numbers.

I'm unsure how to deal with licensing questions. We should probably make the user promise that they have the right to distribute this code, somehow.

┆Issue is synchronized with this Jira Task

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions