-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic support for dark mode & update Swift schema. #1565
base: channel/major-13
Are you sure you want to change the base?
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! |
@@ -216,7 +216,7 @@ export class Updater { | |||
dialog.showMessageBoxSync({ | |||
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.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
case 'decimal128': | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if the changes to the swift schema export went into a separate PR.
@@ -48,6 +51,12 @@ class RealmStudioStore { | |||
this.store.set(KEY_SHOW_SYSTEM_CLASSES, !currentValue); | |||
} | |||
|
|||
public toggleDarkMode() | |||
{ | |||
const currentValue = this.shouldShowInternalFeatures(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems incorrect.
"appId": "foundation.wabi.realm-studio", | ||
"productName": "Cosmic Realms", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -332,7 +332,7 @@ pipeline { | |||
def releaseUrl = "https://github.com/$GITHUB_OWNER/$GITHUB_REPO/releases/tag/$VERSION" | |||
// Post to Slack | |||
postToSlack('slack-releases-webhook', [[ | |||
'title': "Realm Studio $VERSION has been released!", | |||
'title': "Cosmic Realms $VERSION has been released!", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "realm-studio", | |||
"productName": "Realm Studio", | |||
"productName": "Cosmic Realms", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -12,7 +12,7 @@ | |||
"license": "Apache-2.0", | |||
"main": "./build/main.bundle.js", | |||
"build": { | |||
"appId": "com.mongodb.realm-studio", | |||
"appId": "foundation.wabi.realm-studio", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -72,7 +72,7 @@ | |||
}, | |||
"protocols": [ | |||
{ | |||
"name": "Realm Studio", | |||
"name": "Cosmic Realms", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
const appBundleId = "foundation.wabi.realm-studio"; | ||
const ascProvider = "UQ9J5QT9DL"; // Apple: short team name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -12,7 +12,7 @@ electron.app.once('ready', () => { | |||
message: `Writing to the ready signal: ${p}`, | |||
}); | |||
*/ | |||
fs.writeFileSync(p, 'Hello from a future Realm Studio!', { | |||
fs.writeFileSync(p, 'Hello from a future Cosmic Realms!', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
"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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -200,6 +203,10 @@ class RealmBrowserContainer | |||
); | |||
} | |||
|
|||
public changeTheme() { | |||
this.setState({ darkModeEnabled: !this.state.darkModeEnabled }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be persisted?
@@ -400,7 +421,7 @@ class RealmBrowserContainer | |||
} | |||
} 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.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -22,7 +22,7 @@ $realm-browser-header-handle-width: 5px; | |||
$realm-browser-header-height: 50px; | |||
$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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this use a SCSS variable instead?
@@ -2,7 +2,7 @@ | |||
<html> | |||
<head> | |||
<meta charset="UTF-8"> | |||
<title>Realm Studio</title> | |||
<title>Cosmic Realms</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@@ -2,7 +2,7 @@ | |||
<html> | |||
<head> | |||
<meta charset="UTF-8"> | |||
<title>Realm Studio</title> | |||
<title>Cosmic Realms</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
View
menu in the menubar).@Persisted
property wrappers.