Skip to content

Commit 2e12971

Browse files
Merge branch 'dev' into fix/meta-enter-url-bar
Signed-off-by: KailashGanesh <58307685+KailashGanesh@users.noreply.github.com>
2 parents ad733ce + 15a056b commit 2e12971

File tree

314 files changed

+3389
-1516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+3389
-1516
lines changed

.github/workflows/build.yml

+46-41
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ jobs:
482482
token: ${{ secrets.DEPLOY_KEY }}
483483

484484
- name: Download object files
485+
if: ${{ inputs.update_branch == 'release' }}
485486
run: |
486487
git clone https://github.com/zen-browser/windows-binaries.git .github/workflows/object
487488
@@ -515,60 +516,64 @@ jobs:
515516
# If we are on Twilight, we want to just update the Twilight tag's release
516517
- name: Update Twilight tag
517518
if: ${{ inputs.update_branch == 'twilight' }}
518-
uses: marvinpinto/action-automatic-releases@master
519+
uses: softprops/action-gh-release@v2
519520
with:
520521
files: |
521-
zen.source.tar.zst
522-
zen.linux-x86_64.tar.xz
523-
zen.linux-aarch64.tar.xz
524-
zen-x86_64.AppImage
525-
zen-x86_64.AppImage.zsync
526-
zen-aarch64.AppImage
527-
zen-aarch64.AppImage.zsync
528-
zen.win-x86_64.zip
529-
zen.win-arm64.zip
530-
linux.mar
531-
linux-aarch64.mar
532-
windows.mar
533-
windows-arm64.mar
534-
macos.mar
535-
zen.installer.exe
536-
zen.installer-arm64.exe
537-
zen.macos-universal.dmg
538-
automatic_release_tag: 'twilight'
539-
title: 'Twilight build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }} at ${{ needs.build-data.outputs.build_time }})'
522+
./zen.source.tar.zst/*
523+
./zen.linux-x86_64.tar.xz/*
524+
./zen.linux-aarch64.tar.xz/*
525+
./zen-x86_64.AppImage/*
526+
./zen-x86_64.AppImage.zsync/*
527+
./zen-aarch64.AppImage/*
528+
./zen-aarch64.AppImage.zsync/*
529+
./zen.win-x86_64.zip/*
530+
./zen.win-arm64.zip/*
531+
./linux.mar/*
532+
./linux-aarch64.mar/*
533+
./windows.mar/*
534+
./windows-arm64.mar/*
535+
./macos.mar/*
536+
./zen.installer.exe/*
537+
./zen.installer-arm64.exe/*
538+
./zen.macos-universal.dmg/*
539+
tag_name: 'twilight'
540+
name: 'Twilight build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }} at ${{ needs.build-data.outputs.build_time }})'
540541
draft: false
542+
generate_release_notes: false
541543
prerelease: true
542-
repo_token: ${{ secrets.DEPLOY_KEY }}
544+
token: ${{ secrets.DEPLOY_KEY }}
545+
fail_on_unmatched_files: false
543546
env:
544547
GITHUB_REPOSITORY: ${{ github.repository }}
545548

546549
- name: Release
547550
uses: marvinpinto/action-automatic-releases@master
548551
if: ${{ inputs.update_branch == 'release' }}
549552
with:
550-
repo_token: '${{ secrets.DEPLOY_KEY }}'
551-
automatic_release_tag: ${{ needs.build-data.outputs.version }}
553+
token: '${{ secrets.DEPLOY_KEY }}'
554+
tag_name: ${{ needs.build-data.outputs.version }}
552555
prerelease: false
553-
title: 'Release build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})'
556+
fail_on_unmatched_files: false
557+
generate_release_notes: false
558+
name: 'Release build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})'
554559
files: |
555-
zen.source.tar.zst
556-
zen.linux-x86_64.tar.xz
557-
zen.linux-aarch64.tar.xz
558-
zen-x86_64.AppImage
559-
zen-x86_64.AppImage.zsync
560-
zen-aarch64.AppImage
561-
zen-aarch64.AppImage.zsync
562-
.github/workflows/object/windows-x64-signed-x86_64/zen.win-x86_64.zip
563-
.github/workflows/object/windows-x64-signed-arm64/zen.win-arm64.zip
564-
linux.mar
565-
linux-aarch64.mar
566-
.github/workflows/object/windows-x64-signed-x86_64/windows.mar
567-
.github/workflows/object/windows-x64-signed-arm64/windows-arm64.mar
568-
macos.mar
569-
.github/workflows/object/windows-x64-signed-x86_64/zen.installer.exe
570-
.github/workflows/object/windows-x64-signed-arm64/zen.installer-arm64.exe
571-
zen.macos-universal.dmg
560+
./zen.source.tar.zst/*
561+
./zen.linux-x86_64.tar.xz/*
562+
./zen.linux-aarch64.tar.xz/*
563+
./zen-x86_64.AppImage/*
564+
./zen-x86_64.AppImage.zsync/*
565+
./zen-aarch64.AppImage/*
566+
./zen-aarch64.AppImage.zsync/*
567+
./.github/workflows/object/windows-x64-signed-x86_64/zen.win-x86_64.zip
568+
./.github/workflows/object/windows-x64-signed-arm64/zen.win-arm64.zip
569+
./linux.mar/*
570+
./linux-aarch64.mar/*
571+
./.github/workflows/object/windows-x64-signed-x86_64/windows.mar
572+
./.github/workflows/object/windows-x64-signed-arm64/windows-arm64.mar
573+
./macos.mar/*
574+
./.github/workflows/object/windows-x64-signed-x86_64/zen.installer.exe
575+
./.github/workflows/object/windows-x64-signed-arm64/zen.installer-arm64.exe
576+
./zen.macos-universal.dmg/*
572577
573578
prepare-flatpak:
574579
if: ${{ inputs.create_release && inputs.update_branch == 'release' }}

configs/common/mozconfig

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ ac_add_options --with-l10n-base="${topsrcdir}/browser/locales"
99
export MOZ_USER_DIR="${name}"
1010
export MOZ_APP_BASENAME=Zen
1111
export MOZ_APP_PROFILE=${binName}
12-
export MOZ_APP_DISPLAYNAME="Zen"
1312
export MOZ_BRANDING_DIRECTORY=${brandingDir}
1413
export MOZ_OFFICIAL_BRANDING_DIRECTORY=${brandingDir}
1514

l10n

package-lock.json

+8-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"homepage": "https://github.com/zen-browser/core#readme",
4343
"dependencies": {
44-
"@zen-browser/surfer": "^1.9.16"
44+
"@zen-browser/surfer": "^1.9.18"
4545
},
4646
"devDependencies": {
4747
"husky": "^9.1.7",

src/browser/app/profile/zen-browser.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ pref("app.update.checkInstallTime.days", 6);
7575

7676
// CUSTOM ZEN PREFS
7777

78-
pref('zen.welcome-screen.enabled', true, sticky);
79-
pref('zen.welcome-screen.seen', false);
78+
pref('zen.welcome-screen.seen', false, sticky);
8079

8180
pref('zen.tabs.vertical', true);
8281
pref('zen.tabs.vertical.right-side', false);
82+
pref('zen.tabs.rename-tabs', true);
8383
pref('zen.theme.accent-color', "#ffb787");
8484
pref('zen.theme.content-element-separation', 6); // In pixels
8585
pref('zen.theme.pill-button', false);
@@ -142,6 +142,7 @@ pref('zen.view.sidebar-expanded.max-width', 500);
142142

143143
#ifdef XP_MACOSX
144144
pref('zen.view.mac.show-three-dot-menu', false);
145+
pref('zen.widget.mac.mono-window-controls', true);
145146
#endif
146147
pref('zen.view.show-bottom-border', false);
147148
pref('zen.view.use-single-toolbar', true);

src/browser/base/content/ZenStartup.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
gZenVerticalTabsManager.init();
3737
gZenUIManager.init();
3838

39+
this._checkForWelcomePage();
40+
3941
document.l10n.setAttributes(document.getElementById('tabs-newtab-button'), 'tabs-toolbar-new-tab');
4042
} catch (e) {
4143
console.error('ZenThemeModifier: Error initializing browser layout', e);
@@ -117,6 +119,13 @@
117119
gURLBar._initPasteAndGo();
118120
gURLBar._initStripOnShare();
119121
},
122+
123+
_checkForWelcomePage() {
124+
if (!Services.prefs.getBoolPref('zen.welcome-screen.seen', false)) {
125+
Services.prefs.setBoolPref('zen.welcome-screen.seen', true);
126+
Services.scriptloader.loadSubScript('chrome://browser/content/zen-components/ZenWelcome.mjs', window);
127+
}
128+
},
120129
};
121130

122131
ZenStartup.init();

src/browser/base/content/ZenUIManager.mjs

+136
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ var gZenUIManager = {
1010
XPCOMUtils.defineLazyPreferenceGetter(this, 'contentElementSeparation', 'zen.theme.content-element-separation', 0);
1111
XPCOMUtils.defineLazyPreferenceGetter(this, 'urlbarWaitToClear', 'zen.urlbar.wait-to-clear', 0);
1212

13+
gURLBar._zenTrimURL = this.urlbarTrim.bind(this);
14+
1315
ChromeUtils.defineLazyGetter(this, 'motion', () => {
1416
return ChromeUtils.importESModule('chrome://browser/content/zen-vendor/motion.min.mjs', { global: 'current' });
1517
});
1618

19+
ChromeUtils.defineLazyGetter(this, '_toastContainer', () => {
20+
return document.getElementById('zen-toast-container');
21+
});
22+
1723
new ResizeObserver(this.updateTabsToolbar.bind(this)).observe(document.getElementById('TabsToolbar'));
1824

1925
new ResizeObserver(
@@ -147,6 +153,8 @@ var gZenUIManager = {
147153
this.__currentPopupTrackElement = null;
148154
},
149155

156+
// Section: URL bar
157+
150158
get newtabButtons() {
151159
return document.querySelectorAll('#tabs-newtab-button');
152160
},
@@ -209,6 +217,46 @@ var gZenUIManager = {
209217
}
210218
}
211219
},
220+
221+
urlbarTrim(aURL) {
222+
if (gZenVerticalTabsManager._hasSetSingleToolbar) {
223+
let url = BrowserUIUtils.removeSingleTrailingSlashFromURL(aURL);
224+
return url.startsWith('http://') || url.startsWith('https://') ? url.split('/')[2] : url;
225+
}
226+
return BrowserUIUtils.trimURL(aURL);
227+
},
228+
229+
// Section: Notification messages
230+
_createToastElement(messageId, options) {
231+
const element = document.createXULElement('vbox');
232+
const label = document.createXULElement('label');
233+
document.l10n.setAttributes(label, messageId, options);
234+
element.appendChild(label);
235+
if (options.descriptionId) {
236+
const description = document.createXULElement('label');
237+
description.classList.add('description');
238+
document.l10n.setAttributes(description, options.descriptionId, options);
239+
element.appendChild(description);
240+
}
241+
element.classList.add('zen-toast');
242+
return element;
243+
},
244+
245+
async showToast(messageId, options = {}) {
246+
const toast = this._createToastElement(messageId, options);
247+
this._toastContainer.removeAttribute('hidden');
248+
this._toastContainer.appendChild(toast);
249+
await this.motion.animate(toast, { opacity: [0, 1], scale: [0.8, 1] }, { type: 'spring', bounce: 0.5, duration: 0.5 });
250+
await new Promise((resolve) => setTimeout(resolve, 3000));
251+
await this.motion.animate(toast, { opacity: [1, 0], scale: [1, 0.9] }, { duration: 0.2, bounce: 0 });
252+
const toastHeight = toast.getBoundingClientRect().height;
253+
// 5 for the separation between toasts
254+
await this.motion.animate(toast, { marginBottom: [0, `-${toastHeight + 5}px`] }, { duration: 0.2 });
255+
toast.remove();
256+
if (!this._toastContainer.hasChildNodes()) {
257+
this._toastContainer.setAttribute('hidden', 'true');
258+
}
259+
},
212260
};
213261

214262
var gZenVerticalTabsManager = {
@@ -248,6 +296,9 @@ var gZenVerticalTabsManager = {
248296
if (!this.isWindowsStyledButtons) {
249297
document.documentElement.setAttribute('zen-window-buttons-reversed', true);
250298
}
299+
300+
this._renameTabHalt = this.renameTabHalt.bind(this);
301+
gBrowser.tabContainer.addEventListener('dblclick', this.renameTabStart.bind(this));
251302
},
252303

253304
toggleExpand() {
@@ -613,4 +664,89 @@ var gZenVerticalTabsManager = {
613664
}
614665
target.appendChild(child);
615666
},
667+
668+
async renameTabKeydown(event) {
669+
if (event.key === 'Enter') {
670+
let label = this._tabEdited.querySelector('.tab-label-container-editing');
671+
let input = this._tabEdited.querySelector('#tab-label-input');
672+
let newName = input.value.trim();
673+
674+
// Check if name is blank, reset if so
675+
// Always remove, so we can always rename and if it's empty,
676+
// it will reset to the original name anyway
677+
this._tabEdited.removeAttribute('zen-has-static-label');
678+
if (newName) {
679+
gBrowser._setTabLabel(this._tabEdited, newName);
680+
this._tabEdited.setAttribute('zen-has-static-label', 'true');
681+
} else {
682+
gBrowser.setTabTitle(this._tabEdited);
683+
}
684+
if (this._tabEdited.getAttribute('zen-pin-id')) {
685+
// Update pin title in storage
686+
await gZenPinnedTabManager.updatePinTitle(this._tabEdited, this._tabEdited.label, !!newName);
687+
}
688+
689+
// Maybe add some confetti here?!?
690+
gZenUIManager.motion.animate(
691+
this._tabEdited,
692+
{
693+
scale: [1, 0.98, 1],
694+
},
695+
{
696+
duration: 0.25,
697+
}
698+
);
699+
700+
this._tabEdited.querySelector('.tab-editor-container').remove();
701+
label.classList.remove('tab-label-container-editing');
702+
703+
this._tabEdited = null;
704+
} else if (event.key === 'Escape') {
705+
event.target.blur();
706+
}
707+
},
708+
709+
renameTabStart(event) {
710+
if (
711+
this._tabEdited ||
712+
!Services.prefs.getBoolPref('zen.tabs.rename-tabs') ||
713+
Services.prefs.getBoolPref('browser.tabs.closeTabByDblclick') ||
714+
!gZenVerticalTabsManager._prefsSidebarExpanded
715+
)
716+
return;
717+
this._tabEdited = event.target.closest('.tabbrowser-tab');
718+
if (!this._tabEdited || !this._tabEdited.pinned || this._tabEdited.hasAttribute('zen-essential')) {
719+
this._tabEdited = null;
720+
return;
721+
}
722+
const label = this._tabEdited.querySelector('.tab-label-container');
723+
label.classList.add('tab-label-container-editing');
724+
725+
const container = window.MozXULElement.parseXULToFragment(`
726+
<vbox class="tab-label-container tab-editor-container" flex="1" align="start" pack="center"></vbox>
727+
`);
728+
label.after(container);
729+
const containerHtml = this._tabEdited.querySelector('.tab-editor-container');
730+
const input = document.createElement('input');
731+
input.id = 'tab-label-input';
732+
input.value = this._tabEdited.label;
733+
input.addEventListener('keydown', this.renameTabKeydown.bind(this));
734+
735+
containerHtml.appendChild(input);
736+
input.focus();
737+
input.select();
738+
739+
input.addEventListener('blur', this._renameTabHalt);
740+
},
741+
742+
renameTabHalt(event) {
743+
if (document.activeElement === event.target || !this._tabEdited) {
744+
return;
745+
}
746+
this._tabEdited.querySelector('.tab-editor-container').remove();
747+
const label = this._tabEdited.querySelector('.tab-label-container-editing');
748+
label.classList.remove('tab-label-container-editing');
749+
750+
this._tabEdited = null;
751+
},
616752
};

0 commit comments

Comments
 (0)