Add basic support for dark mode & update Swift schema.#1565
Add basic support for dark mode & update Swift schema.#1565furby-tm wants to merge 4 commits intorealm:channel/major-13from
Conversation
|
Realm welcomes all contributions! The only requirement we have is that, like many other projects, we need to have a Contributor License Agreement (CLA) in place before we can accept any external code. Our own CLA is a modified version of the Apache Software Foundation’s CLA. Our records show that CLA has not been signed by @furby-tm. Please submit your CLA electronically using our Google form so we can accept your submissions. After signing the CLA you can recheck this PR with a |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
| type: 'info', | ||
| message: `A new version of ${appName} is downloaded!`, | ||
| detail: `${appName} ${lastestVersion} is downloaded.\nClick "Ok" to quit and restart Realm Studio.`, | ||
| detail: `${appName} ${lastestVersion} is downloaded.\nClick "Ok" to quit and restart Cosmic Realms.`, |
| return str + 'Decimal128()'; | ||
| return str; | ||
| case 'object': | ||
| return 'Objects must always be optional. Something is not right in this model!'; |
There was a problem hiding this comment.
I would prefer if the changes to the swift schema export went into a separate PR.
|
|
||
| public toggleDarkMode() | ||
| { | ||
| const currentValue = this.shouldShowInternalFeatures(); |
There was a problem hiding this comment.
This line seems incorrect.
| "appId": "foundation.wabi.realm-studio", | ||
| "productName": "Cosmic Realms", |
| // Post to Slack | ||
| postToSlack('slack-releases-webhook', [[ | ||
| 'title': "Realm Studio $VERSION has been released!", | ||
| 'title': "Cosmic Realms $VERSION has been released!", |
| { | ||
| "name": "realm-studio", | ||
| "productName": "Realm Studio", | ||
| "productName": "Cosmic Realms", |
| "main": "./build/main.bundle.js", | ||
| "build": { | ||
| "appId": "com.mongodb.realm-studio", | ||
| "appId": "foundation.wabi.realm-studio", |
| "protocols": [ | ||
| { | ||
| "name": "Realm Studio", | ||
| "name": "Cosmic Realms", |
| const appBundleId = "foundation.wabi.realm-studio"; | ||
| const ascProvider = "UQ9J5QT9DL"; // Apple: short team name |
| }); | ||
| */ | ||
| fs.writeFileSync(p, 'Hello from a future Realm Studio!', { | ||
| fs.writeFileSync(p, 'Hello from a future Cosmic Realms!', { |
| "version": "999.0.0", | ||
| "lockfileVersion": 1, | ||
| "lockfileVersion": 3, | ||
| "requires": true, | ||
| "dependencies": { | ||
| "electron": { | ||
| "version": "file:../../../../node_modules/electron", | ||
| "packages": { | ||
| "": { | ||
| "name": "mocked-realm-studio", | ||
| "version": "999.0.0", | ||
| "license": "Apache-2.0", | ||
| "devDependencies": { | ||
| "electron": "file:../../../../node_modules/electron" | ||
| } | ||
| }, | ||
| "../../../../node_modules/electron": { | ||
| "version": "19.1.8", | ||
| "integrity": "sha512-Bp1CwnYaIWXNL9ZjgEaLlEkVEGpjJMupcAnxyCe00C2ZhQT9gY+RJaPzkrZC+J/Gc4MvvLtJcy/Hvsc+MTkfNg==", | ||
| "dev": true | ||
| "dev": true, | ||
| "hasInstallScript": true, | ||
| "license": "MIT", | ||
| "dependencies": { | ||
| "@electron/get": "^1.14.1", | ||
| "@types/node": "^16.11.26", | ||
| "extract-zip": "^1.0.3" | ||
| }, | ||
| "bin": { | ||
| "electron": "cli.js" | ||
| }, | ||
| "engines": { | ||
| "node": ">= 8.6" | ||
| } | ||
| }, | ||
| "node_modules/electron": { | ||
| "resolved": "../../../../node_modules/electron", | ||
| "link": true |
| } | ||
|
|
||
| public changeTheme() { | ||
| this.setState({ darkModeEnabled: !this.state.darkModeEnabled }); |
There was a problem hiding this comment.
Should this be persisted?
| } else if (err.message === ARCHITECTURE_MISMATCH_MESSAGE) { | ||
| const improvedError = new Error( | ||
| 'The file is already opened by another process, with an incompatible lock file format. Try up- or downgrading Realm Studio or SDK to match their versions of Realm Core.\n\nSee Realm Studio changelog on GitHub for details on compatibility between versions.', | ||
| 'The file is already opened by another process, with an incompatible lock file format. Try up- or downgrading Cosmic Realms or SDK to match their versions of Realm Core.\n\nSee Cosmic Realms changelog on GitHub for details on compatibility between versions.', |
| $realm-browser-header-icon-space: 24px; | ||
| $realm-browser-header-handle-hover-bg: rgba(0, 0, 0, .1); | ||
| $realm-browser-header-handle-dragging-bg: rgba($ultramarine, .5); | ||
| $realm-browser-header-handle-dragging-bg: rgba(#39477f, .5); |
There was a problem hiding this comment.
Could this use a SCSS variable instead?
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Realm Studio</title> | ||
| <title>Cosmic Realms</title> |
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Realm Studio</title> | ||
| <title>Cosmic Realms</title> |
| @mixin themed() { | ||
| @each $theme, $map in $themes { | ||
| .theme--#{$theme} & { | ||
| $colors: () !global; | ||
| @each $key, $submap in $map { | ||
| $value: map-get(map-get($themes, $theme), '#{$key}'); | ||
| $colors: map-merge($colors, ($key: $value)) !global; | ||
| } | ||
| @content; | ||
| $colors: null !global; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Did you copy this from somewhere? If yes, please include a link.
| label: "Enable Dark Mode", | ||
| id: 'toggle-appearance', | ||
| type: 'checkbox', | ||
| checked: store.shouldShowDarkMode(), |
There was a problem hiding this comment.
I would prefer if this was pulled from the system preferences. Would be great if there was a way to say "use my preferences" and then be able to provide an override.
|
@furby-tm could you post a few screenshots from the app when in dark mode? |
|
Hey guys! Sorry, I'm just now getting to your response -- I've been tied down with some projects getting rolled out into production over the last couple weeks, so things have been hectic. I had just a couple hours to spare, and spent that time trying to tone down the blinding light mode of the app, since I use it frequently, and figured my eyes could spare a break. I realize my PR was a 0 context shove in, so I apologize for that! To quickly summarize these changes: I added a basic dark mode, and made some additional changes to the light mode which integrated some of the UI aspects of MongoDB Compass. The dark mode will need some cleanup since I missed a lot of the text on the tables (lots of it is looking black on black so that won't do!). I brought in the latest changes to the realm swift generation schema, which is the removal of any/all objc boilerplate and integrated the ‘@persisted’ swift property wrappers. And I believe that was all. If dark mode & rolling in the latest swift schematic changes are something the realm team are looking to support I'd be happy to fixup a proper PR for your review. |
Within this PR is support for:
Viewmenu in the menubar).@Persistedproperty wrappers.