OpenCircuits / OpenCircuits

A free, open source, online digital circuit/logic designer.
https://www.opencircuits.io/
GNU General Public License v3.0
292 stars 71 forks source link

Changelog Popup #982

Open LeonMontealegre opened 2 years ago

LeonMontealegre commented 2 years ago

Is your feature request related to a problem? Please describe. It would probably be confusing for an OpenCircuits user who isn't up-to-date with RCOS or the Github to suddenly have the UI and other things change when logging onto the site.

Describe the solution you'd like It would be good to have a changelog popup appear every time a new OpenCirucits version is released, that has a list of all the changes made from the update.

Additional context This would require some cookie to keep track of which version the user has last used, and then when that version != the current version, the popup should be displayed. Similarly, we should maybe have a button to show the changelog somewhere on the SideNav or maybe the Help Menu.

It should probably not show the popup when the user first opens the site for the first time, i.e., if they do not have this cookie storing the version. We want to show this popup only to users who have used the site before.

LeonMontealegre commented 2 years ago

Changelog config should be typed like:

type ChangelogConfig = {
    version: string;
    desc: string[];
    changes: string[];
    newContributors: string[];
    fullLink: string;
}

The version represents the version that this changelog corresponds to. The desc is an array of strings, with each entry corresponding to a separate line (since in JSON you can't have new lines), so like desc: ["Hello", "World"], we'd want displayed as: Hello World The changes is simply just a bulleted list of changes, so the output should display them as such, i.e. changes: ["a", "b", "c"] would be displayed as:

At the bottom is the config for this first changelog.

Note, that basically we just want it to look like this page https://github.com/OpenCircuits/OpenCircuits/releases/tag/v3.0

Note also that all @Username pieces of text should be replaced by a link to that persons' Github account, and pieces of text like #ISSUE_OR_PR_NUMBER should be a link to that Github issue/PR. This can be done by doing something like:

const str = "some text @Username, some more text #900";

str.split(/(@[a-zA-Z\-\d]+)|(#\d+)/)
    .map(str => {
        if (str.startsWith("@"))
            return (<a href={`https://github.com/${str.slice(1)}`}>{str}</a>);
        if (str.startsWith("#"))
            return (<a href={`https://github.com/OpenCircuits/OpenCircuits/issue/${str.slice(1)}`}>{str}</a>);
        return str;
    })

Which will turn a regular string into an array of normal strings and then also react components that represent links, which can be embedded in the React Changelog component

{
    "version": "v3.0",
    "desc": [
        "The very long time coming, third major release of OpenCircuits",
        "This release did a complete rewrite of the frontend, now using React and Redux.",
        "Many new features have been added including the Boolean Expression to Circuit Generator, History Box, Image Exporter, Oscilloscope, new displays, and much much more!"
    ],
    "changes": [
        "Added double clicking for wire by @APLunch in #506",
        "made locks more visible by @Robert-Hammond in #516",
        "Center new ICs in view by @sandorzm in #517",
        "Fit screen by @sandorzm in #513",
        "Keyboard shortcuts popup by @brandon-red in #510",
        "Update AUTHORS.md by @nprisament in #526",
        "Santized user input by @Robert-Hammond in #519",
        "Fixed Context Menu functions by @APLunch in #522",
        "Positioner refactor by @LeonMontealegre in #533",
        "Flip Flop PRESET/CLEAR addition  by @LeonMontealegre in #534",
        "Fixed circular dependencies + Migration Tests by @LeonMontealegre in #536",
        "Wire selection by @rsdexter in #530",
        "Full adder by @Nesathurai in #529",
        "Landing page by @Robert-Hammond in #527",
        "Updated travis.ci by @LeonMontealegre in #559",
        "Merge master into stuck-button-bug by @TGCrystal in #560",
        "Cookiebanner by @SethLaurenceau in #547",
        "shifted canvas down, too simple to take a week by @SethLaurenceau in #548",
        "Auto port allocating behind *portConfig==auto by @TGCrystal in #561",
        "Duplicated button staying pressed fixed by @TGCrystal in #562",
        "Straight Wires Don't Unstraighten by @KLi447 in #563",
        "Can't create IC with labels inside it #555 by @qihenry in #564",
        "Cmd/ctrl + s to save by @ml619 in #568",
        "Colored labels by @ml619 in #565",
        "Binary Coded Decimal Display by @brandon-red in #574",
        "Major Optimizations 1 by @LeonMontealegre in #580",
        "The Reactor by @LeonMontealegre in #581",
        "Text wrap fix, also add required package to package.json by @TGCrystal in #586",
        "Split wire fix by @Xystem4 in #589",
        "Testing fix by @LeonMontealegre in #600",
        "Fixed issue where ports couldn't be selected by @LeonMontealegre in #591",
        "Added building and testing CI workflow by @LeonMontealegre in #601",
        "update branch with functional testing by @TGCrystal in #602",
        "Fixed camera zoom issue by @LeonMontealegre in #603",
        "Rotation drift fix by @LeonMontealegre in #604",
        "Production Build fixes by @LeonMontealegre in #605",
        "Production Fixes by @LeonMontealegre in #607",
        "Update Trevor's branch by @TGCrystal in #608",
        "Menu now closes if you click the same menu icon again by @TGCrystal in #606",
        "Wire double click fix by @JumpingKangaroo in #593",
        "Example circuit fix by @JumpingKangaroo in #619",
        "Mobile drag fix by @LeonMontealegre in #627",
        "Update bug_report.md by @Xystem4 in #628",
        "Button fix by @Xystem4 in #620",
        "UndoRedo by @SamooMei in #618",
        "Auto save by @cchen1000 in #626",
        "Save indicator by @qihenry in #629",
        "IC fixes by @LeonMontealegre in #637",
        "Build refactor by @LeonMontealegre in #660",
        "Position coordinates not rounded bug fix by @qihenry in #648",
        "DropdownFix by @SamooMei in #649",
        "BCD/ASCII Displays by @LeonMontealegre in #653",
        "ItemNavEnhancement by @SamooMei in #652",
        "Incorrect name field when selecting multiple components by @qihenry in #654",
        "MobileHeader by @SamooMei in #631",
        "Create n components by @cchen1000 in #650",
        "Bugfix - Toggle autosave on switch press also by @DefinitiveAbove in #663",
        "Google Auth verifies audience by @KevinMackenzie in #670",
        "Issue 655: 'Components Going Invisible when moving it towards the Edge of the site' addressed by @Demopans in #671",
        "Prevent Copy-On-Save behavior for loaded user circuits by @KevinMackenzie in #672",
        "Empty Actions Fix by @SamooMei in #676",
        "Fix renaming of ports not working by @DefinitiveAbove in #680",
        "Initial Documentation implementation by @LeonMontealegre in #684",
        "Doc Improvements 1 by @LeonMontealegre in #690",
        "Fix IC create and view not showing up by @DefinitiveAbove in #691",
        "Redux refactor by @LeonMontealegre in #709",
        "ItemNav Bug Fix by @SamooMei in #666",
        "Expression to circuit design doc done by @TGCrystal in #696",
        "Dragging component moves component to front layer by @DefinitiveAbove in #673",
        "Fix copy paste with keyboard by @DefinitiveAbove in #692",
        "ConnectionAction creates wire just-in-time to fix Snip action by @KevinMackenzie in #686",
        "Sign in/out on SideNav by @SamooMei in #693",
        "Fixed bug with middle mouse panning by @jssunray34 in #730",
        "fix: add link to github page #736 by @aakhtar3 in #737",
        "hid overflow-x in the sidebar by @T-Boya in #743",
        "Add 'prevent combination key z and y' to the code by @BaiTueeChuan in #744",
        "Fixed Undo/Redo button refresh by @alstar555 in #748",
        "Modified the third example circuit by @OwenMcGee in #761",
        "Color coded wires by @vhada7 in #767",
        "ANDGate JSDoc by @tkoz0 in #715",
        "Added documentation to BCDDisplay.ts by @rsdexter in #716",
        "Updated ConstantHigh.ts with documentation by @riedee in #727",
        "Added documentation for Button Class by @RussellABH in #732",
        "Added Documentation for ORGate in ORGate.ts by @thedomino1313 in #734",
        "Revert \"Add 'prevent combination key z and y' to the code\" by @LeonMontealegre in #770",
        "Fixed bus option not disappearing after usage. by @thedomino1313 in #769",
        "Esc and Enter for ICs by @thedomino1313 in #763",
        "Wrote docs for Constant Low by @jssunray34 in #718",
        "Fixes Issue #594 by @Cyphecx in #719",
        "Fixed Download as PDF/PNG by @RussellABH in #739",
        "added documentation for BUFGate.ts by @Cyphecx in #722",
        "fixed zoom issue 657 by @Kevin-771 in #783",
        "Fixed Mux Selection Port Count Behavior by @rsdexter in #766",
        "Updated Autosave Button by @riedee in #758",
        "Fixed copy paste issue by @LeonMontealegre in #788",
        "Documentation for Switch.ts by @mercuryhg31 in #717",
        "added documentation to Boundingbox.ts by @Kevin-771 in #728",
        "Camera.ts Documentation by @vhada7 in #749",
        "Example Circuit directory in docs by @rsdexter in #756",
        "Made the circuit title cutoff more graceful by @alstar555 in #759",
        "Fixed the redo and undo on right click by @vanshreddy in #773",
        "Modified the third example circuit again by @OwenMcGee in #778",
        "Added comments to the file Vector.ts by @AtlusGL in #741",
        "Fixed issue with firefox and number inputs not focusing by @LeonMontealegre in #827",
        "Dev-server LAN Fix by @LeonMontealegre in #829",
        "commented SelectionsWrapper.ts by @ml619 in #726",
        "Implemented loading bar/messages by @TGCrystal in #768",
        "Fixed mouse and wire interaction by @thedomino1313 in #781",
        "Camera pan with arrow keys by @RussellABH in #786",
        "Port documentation by @ml619 in #791",
        "Positioner documentation by @ml619 in #792",
        "Reducing the number of ports can cause an error. by @Cyphecx in #807",
        "Oscilloscope by @LeonMontealegre in #839",
        "Undo errors by @rsdexter in #806",
        "Added Documentation instructions by @TGCrystal in #840",
        "Removed forgotten console.log by @TGCrystal in #841",
        "Stop web page swipe navigation on Chrome and Firefox by @TGCrystal in #845",
        "Fixed IC Resizing Bounds by @rsdexter in #838",
        "Unit tests for deleting wires and objects by @jssunray34 in #823",
        "Item Nav Drag Preview by @LeonMontealegre in #790",
        "Addition action docs by @rsdexter in #824",
        "Fixed issue 774 by @vhada7 in #813",
        "Documentation for IOObject Renderers by @mercuryhg31 in #830",
        "Documentation for Gate, Output, IC, and Mux Renderers by @mercuryhg31 in #831",
        "Added Constant Number Component by @tkoz0 in #837",
        "Fix issue 746 by @AtlusGL in #826",
        "Added items to Quick Start PopUp by @mercuryhg31 in #832",
        "fixed wonky wire connections (issue 610) by @Kevin-771 in #821",
        "Added Google Analytics tracking by @LeonMontealegre in #868",
        "Documentation for Shapes by @jssunray34 in #828",
        "switched from keycode to key (issue #789) by @Kevin-771 in #801",
        "More debug options by @jssunray34 in #787",
        "fixed context menu issue #714 by @Kevin-771 in #805",
        "Adding comment to Clock.ts by @BaiTueeChuan in #880",
        "Documentation update for ClampedValue.ts by @T-Boya in #867",
        "Logical Boolean Expression to Circuit Generator by @TGCrystal in #630",
        "Fix ExpressionParser error in prod by @TGCrystal in #884",
        "Revert \"switched from keycode to key (issue #789)\" by @OwenMcGee in #886",
        "Fix generating IC with expression parser by @TGCrystal in #887",
        "REDO ON ZY KEY by @BaiTueeChuan in #853",
        "Allow ICs to be deleted from ItemNav by @Cyphecx in #793",
        "Bunch of IC Fixes by @LeonMontealegre in #906",
        "Easier Coloring of Split Wires by @vhada7 in #869",
        "False power source upon duplication fix by @mercuryhg31 in #860",
        "Power Wires During Creation by @riedee in #819",
        "JPEG Download  by @vanshreddy in #794",
        "Image Exporter by @LeonMontealegre in #916",
        "Fixed miscellaneous small issues by @LeonMontealegre in #920",
        "Fixed issue with image exporter breaking circuit propagations by @LeonMontealegre in #928",
        "Documentation for RotateAction.ts by @ezier in #875",
        "Documentation for SnapUtils.ts by @ezier in #876",
        "Documentation for TranslateAction.ts by @ezier in #877",
        "Documents for 5 files. by @AtlusGL in #879",
        "Documentation for Port Change files by @vhada7 in #905",
        "Mux label by @tkoz0 in #937",
        "Fix IC port stalks getting stuck inside IC by @rsdexter in #935",
        "Input.ts documentation added by @OwenMcGee in #814",
        "Bezier Curve Documentation by @ezier in #798",
        "Added code coverage commands by @TGCrystal in #941",
        "Popup Click Fix by @LeonMontealegre in #942",
        "list of common mistakes in PRs by @ml619 in #932",
        "Added style guide for imports by @ml619 in #835",
        "Comparator by @caitlinc362 in #940",
        "Duplicate circuit by @jssunray34 in #924",
        "added comments to LED file by @caitlinc362 in #764",
        "XOR gate documentation by @vanshreddy in #782",
        "Added 2 circuits converted from logicly for Professor Kuzmin (and a third bonus one!) by @OwenMcGee in #923",
        "Have added CleanUpHandler ver 0.1 by @AtlusGL in #812",
        "Added new components documentation by @LeonMontealegre in #948",
        "Escape to unfocus inputs by @BaiTueeChuan in #854",
        "Prevent zoomin gesture by @BaiTueeChuan in #856",
        "Switched keycode to key V2.0 by @Kevin-771 in #900",
        "Expression parser improvements by @TGCrystal in #945",
        "Add ability to paste at mouse location with context menu by @mercuryhg31 in #913",
        "Fixed snipped wires coloring  by @vhada7 in #919",
        "Supports functionality for clicking escape key to deselect a wire by @vanshreddy in #931",
        "Link to documentation for components. by @Cyphecx in #922",
        "Fixed Rendering Issues by @thedomino1313 in #921",
        "History box moves with item nav by @rosan2 in #933",
        "Translate with arrow keys by @RussellABH in #904",
        "Added initial ESLint implementation by @LeonMontealegre in #952",
        "Fixed issue with incorrect selection handling by @LeonMontealegre in #953",
        "Fixed issue with initial IC propagation by @LeonMontealegre in #954",
        "Added status indicators by @LeonMontealegre in #955",
        "Re-added Landing Page by @LeonMontealegre in #956",
        "Mobile Improvements by @TGCrystal in #891",
        "Changed default tool to trigger after other tools have been activated by @LeonMontealegre in #947",
        "Fixed issue with multiplace not working on desktop by @LeonMontealegre in #967",
        "History Box scrollbar css, replace deprecated substr call by @TGCrystal in #965",
        "Enable strict null checks by @TGCrystal in #949"
    ],
    "newContributors": [
        "@APLunch made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/506",
        "@Robert-Hammond made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/516",
        "@sandorzm made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/517",
        "@brandon-red made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/510",
        "@Nesathurai made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/529",
        "@TGCrystal made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/560",
        "@SethLaurenceau made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/547",
        "@KLi447 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/563",
        "@qihenry made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/564",
        "@ml619 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/568",
        "@Xystem4 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/589",
        "@JumpingKangaroo made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/593",
        "@SamooMei made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/618",
        "@cchen1000 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/626",
        "@DefinitiveAbove made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/663",
        "@Demopans made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/671",
        "@jssunray34 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/730",
        "@aakhtar3 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/737",
        "@T-Boya made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/743",
        "@BaiTueeChuan made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/744",
        "@alstar555 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/748",
        "@OwenMcGee made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/761",
        "@vhada7 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/767",
        "@tkoz0 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/715",
        "@riedee made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/727",
        "@RussellABH made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/732",
        "@thedomino1313 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/734",
        "@Cyphecx made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/719",
        "@Kevin-771 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/783",
        "@mercuryhg31 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/717",
        "@vanshreddy made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/773",
        "@AtlusGL made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/741",
        "@ezier made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/875",
        "@caitlinc362 made their first contribution in https://github.com/OpenCircuits/OpenCircuits/pull/940"
    ],
    "fullLink": "https://github.com/OpenCircuits/OpenCircuits/releases/tag/v3.0"
}