swiftlang / swift-org-website

Swift.org website
https://swift.org
Other
477 stars 187 forks source link

Searching for "Feature Identifier" on swift.org/swift-evolution #261

Closed MarcoEidinger closed 1 year ago

MarcoEidinger commented 1 year ago

Is your feature request related to a problem? Please describe

Proposals may have a new, optional field that defines the feature identifier that allows for Piecemeal adoption of upcoming language improvements

Unfortunately, it is not possible to search for proposals that have a feature identifier. It is also not possible to search for a proposal with a given feature identifier.

Describe the solution you'd like

Additional context

Excerpt from Proposals define their own feature identifier

Swift proposal template got amended with a new, optional field that defines the feature identifier:

Feature identifier: UpperCamelCaseFeatureName Amend the following proposals, which are partially or wholly delayed until Swift 6, with the following feature identifiers:

Several proposals were amended to mention the respective feature identifier

  • SE-0274 "Concise magic file names" (ConciseMagicFile) delayed the semantic change to #file until Swift 6. Enabling this feature changes #file to mean #fileID rather than #filePath.
  • SE-0286 "Forward-scan matching for trailing closures" (ForwardTrailingClosures) delays the removal of the "backward-scan matching" rule of trailing closures until Swift 6. Enabling this feature removes the backward-scan matching rule.
  • SE-0335 "Introduce existential any" (ExistentialAny) delays the requirement to use any for all existentials until Swift 6. Enabling this feature requires any for existential types.
  • SE-0337 "Incremental migration to concurrency checking" (StrictConcurrency) delays some checking of the concurrency model to Swift 6 (with a flag to opt in to warnings about it in Swift 5.x). Enabling this feature is equivalent to -warn-concurrency, performing complete concurrency checking.
  • SE-0352 "Implicitly Opened Existentials" (ImplicitOpenExistentials) expands implicit opening to more cases in Swift 6, because we didn't want to change the semantics of well-formed code in Swift 5.x. Enabling this feature performs implicit opening in these additional cases.
  • SE-0354 "Regex Literals" (BareSlashRegexLiterals) delays the introduction of the /.../ regex literal syntax until Swift 6. Enabling this feature is equivalent to -enable-bare-regex-syntax, making the /.../ regex literal syntax available. If this proposal and SE-0354 are accepted in the same release, -enable-bare-regex-syntax can be completely removed in favor of this approach.
MarcoEidinger commented 1 year ago

I'd be interested to create a PR for the necessary HTML/JS changes.

The prerequisite for development is that https://download.swift.org/swift-evolution/proposals.json needs to be enhanced to include feature identifier information. I don't know where this JSON gets assembled. If you point me in the right direction then I might create a pull request for the same as well.

tomerd commented 1 year ago

cc @amartini51

dempseyatgithub commented 1 year ago

Thank you for submitting this issue @MarcoEidinger! The generation of the proposals.json file is not open source at present. The Swift Website Workgroup is investigating making this change to add the field.

When I was looking at what it would take to add the field and search to the page itself, the changes were straightforward so I put them in a PR.

I think with the changes in the PR and adding the field to the JSON file, upcoming feature flags (UFF?) would be displayed for proposals that have one and a user could search for a particular flag.

Your feature request also includes finding all proposals with an upcoming feature flag. What UI did you have in mind for that?

MarcoEidinger commented 1 year ago

Thank you @dempseyatgithub for creating the PR!

Your feature request also includes finding all proposals with an upcoming feature flag. What UI did you have in mind for that?

I was thinking along the lines:

dempseyatgithub commented 1 year ago

This issue has four different parts:

  1. Page backing data needs to include upcoming feature flags (UFFs)
  2. A Proposal should display its UFF if it has one
  3. User should be able to search for a particular UFF
  4. User should be able to see list of all proposals with a UFF

The existing PR works to address parts 1-3 which are essentially extensions to the existing page behavior with no change in interactive elements on the page.

Being able to filter / view a list of all proposals with a UFF is potentially more complex, so I mocked up some options.

The three options I explored:

Each section that follows has some discussions, pros and cons, and screen mockups.

Option 1: Magic Search Terms

This option would add the ability to search for terms such as:

This would be adding a hidden searchable property for each proposal and integrate with every other searchable field. Searching for 'uff' would match all proposals with upcoming feature flags, but also match all proposals with the word 'buffer' in the title.

Searching for the search terms would match any field in a proposal that contains those terms.

Pros:

Cons:

Mockup

magic-search-terms@2x

Option 2: Dedicated Filter Button

This option adds a dedicated filter button for proposals with an upcoming feature flag. It is additive with the status/version filter, but provides an independent interface.

Pros:

Cons:

Mockups

Displaying the dedicated filter off and on:

dedicated-filter-off dedicated-filter-on

Option 3: Integrate with Existing Filters

This option adds a filter button for upcoming feature flags to the existing status and version filters.

Pros:

Cons:

Mockups

I tried a few variations:

filter-page-bottom-checkbox-on

filter-page-top-checkbox-on

filter-page-top-checkbox-off

filter-page-bottom-button-off

Wrap-Up

These were the options that I was able to think of, so always welcome to additional suggestions.

Personally, Option 2, the dedicated filter button, is my preferred option. It adds a small amount of user interface, is very discoverable, and does not add to the complexity of the already complex/heavy status and version filtering UI. I think keeping the two conceptually different filters separate is better for the user experience as well as helps keep the underlying script logic less entangled and more maintainable.

MarcoEidinger commented 1 year ago

I like best option no 2 => Dedicated filter button (a button next to the filter button turns on and off a filter for proposals with UFFs)

dempseyatgithub commented 1 year ago

@MarcoEidinger Thanks for the feedback on the options.

Also, as of about an hour ago, proposals display a UFF if they have one and you can search for UFFs by name.