Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ archives are vendored under `vendor/zennotes/` with their source identity and
checksums (`manifest.json`), and `package-lock.json` pins the complete install.
A clean checkout installs them with `npm ci`, without a source clone or sibling
repository. The vendored set is the core release
[core-2.81.1-core.h4d33347386401068](https://github.com/ZenNotes/zennotes/releases/tag/core-2.81.1-core.h4d33347386401068)
(desktop commit `daedf423`, clean tree).
[core-2.82.0-core.h7fbea7b1c6714eb0](https://github.com/ZenNotes/zennotes/releases/tag/core-2.82.0-core.h7fbea7b1c6714eb0)
(desktop commit `6ea4775a`, clean tree).

`npm run boundaries:check` verifies the pins, installed versions, singleton
React/CodeMirror peers, and public export usage. `npm run core:adopt -- <core-tag>`
Expand Down
24 changes: 12 additions & 12 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,12 @@
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = ZenWidgets/ZenWidgets.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = WYY7PK57DM;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = ZenWidgets/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.36.0;
MARKETING_VERSION = 1.37.0;
PRODUCT_BUNDLE_IDENTIFIER = md.zennotes.ZenWidgets;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -753,12 +753,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = WYY7PK57DM;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.36.0;
MARKETING_VERSION = 1.37.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = md.zennotes;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -775,12 +775,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = WYY7PK57DM;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.36.0;
MARKETING_VERSION = 1.37.0;
PRODUCT_BUNDLE_IDENTIFIER = md.zennotes;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
Expand All @@ -795,12 +795,12 @@
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = WYY7PK57DM;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = ShareExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.36.0;
MARKETING_VERSION = 1.37.0;
PRODUCT_BUNDLE_IDENTIFIER = md.zennotes.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand All @@ -817,12 +817,12 @@
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = ZenWidgets/ZenWidgets.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = WYY7PK57DM;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = ZenWidgets/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.36.0;
MARKETING_VERSION = 1.37.0;
PRODUCT_BUNDLE_IDENTIFIER = md.zennotes.ZenWidgets;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -855,12 +855,12 @@
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = WYY7PK57DM;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = ShareExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.36.0;
MARKETING_VERSION = 1.37.0;
PRODUCT_BUNDLE_IDENTIFIER = md.zennotes.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"@lezer/highlight": "^1.2.5",
"@replit/codemirror-vim": "^6.4.0",
"@xyflow/react": "^12.12.0",
"@zennotes/app-core": "file:vendor/zennotes/zennotes-app-core-2.81.1-core.h4d33347386401068.tgz",
"@zennotes/bridge-contract": "file:vendor/zennotes/zennotes-bridge-contract-2.81.1-boundaries.h35527b79ebf7355e.tgz",
"@zennotes/shared-domain": "file:vendor/zennotes/zennotes-shared-domain-2.81.1-boundaries.h35527b79ebf7355e.tgz",
"@zennotes/app-core": "file:vendor/zennotes/zennotes-app-core-2.82.0-core.h7fbea7b1c6714eb0.tgz",
"@zennotes/bridge-contract": "file:vendor/zennotes/zennotes-bridge-contract-2.82.0-boundaries.he44e69e0c7740298.tgz",
"@zennotes/shared-domain": "file:vendor/zennotes/zennotes-shared-domain-2.82.0-boundaries.he44e69e0c7740298.tgz",
"codemirror": "^6.0.1",
"dompurify": "^3.4.17",
"function-plot": "^1.26.0",
Expand Down
52 changes: 50 additions & 2 deletions src/ui-mobile/MobileShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Keyboard } from '@capacitor/keyboard'
import { Capacitor } from '@capacitor/core'
import { getShellSnapshot, useShellSnapshot, subscribeShell, getAdjacentNotePath,
getTagPresenceSnapshot, subscribeTagPresence } from '@zennotes/app-core/shell'
import { getBrowseSnapshot, requestCreateBrowseFolder, requestDeleteBrowseDirectory } from '@zennotes/app-core/browse'
import { getBrowseSnapshot, useBrowseSnapshot, requestCreateBrowseFolder, requestDeleteBrowseDirectory } from '@zennotes/app-core/browse'
import { getWorkspaceSnapshot, useWorkspaceSnapshot, subscribeWorkspace, readPersistedHomeState,
configureWorkspacePresentation, pickLocalVault, openLocalVault, connectRemoteProfile, refreshRemoteProfiles } from '@zennotes/app-core/workspace'
import { getSettingsSnapshot, useSettingsSnapshot, subscribeSettings, setSettingsVisible, setEditorFontSize,
Expand Down Expand Up @@ -888,11 +888,13 @@ function useBreadcrumbDrawerNav(): void {
* A database Board's cards joined in upstream 2.81: a card moves by HTML
* drag and drop, which a WKWebView on an iPhone never starts, so its menu's
* Move to rows are the only way a card changes column on the phone.
* A database Board's column headers joined in upstream 2.82: Column color…
* on an empty column lives only in the header's menu.
*/
const LONG_PRESS_SURFACES =
'aside.glass-sidebar, header.glass-header, section.glass-column, [data-tab-menu-target], ' +
'[data-task-row], [data-kanban-task-id], [data-cal-day], ' +
'[data-kanban-column-header], [data-kanban-lane-header], [data-db-board-card]'
'[data-kanban-column-header], [data-kanban-lane-header], [data-db-board-card], [data-db-board-column-header]'

function useLongPressContextMenu(): void {
useEffect(() => {
Expand Down Expand Up @@ -2585,6 +2587,51 @@ function SettingsVaultQuickSwitch(): React.JSX.Element {
)
}

// ---------------------------------------------------------------------------
// Home names the open vault, one tap from the switcher (zennotesandroid#143).
// The drawer's header does both, but only once the drawer is open, so someone
// who keeps a work and a personal vault could not tell which one they were in.
// A tablet keeps the sidebar's vault menu, so this is phone only.
// ---------------------------------------------------------------------------
function HomeVaultChip(): React.JSX.Element {
const name = useBrowseSnapshot().vault?.name ?? 'ZenNotes'
return (
<button
type="button"
className="zn-home-vault-chip"
aria-label={`Current vault: ${name}. Switch vault`}
onClick={() => openMobileSheet('vaults')}
>
<span>{name}</span>
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="m6 9 6 6 6-6" />
</svg>
</button>
)
}

function useHomeVaultChip(): void {
useEffect(() => {
if (!isPhoneWidth()) return
const container = document.createElement('div')
container.className = 'zn-home-vault-host'
const root = ReactDOM.createRoot(container)
root.render(<HomeVaultChip />)
const sync = (): void => {
const header = document.querySelector('[data-home-nav] header')
if (header && container.parentElement !== header) header.appendChild(container)
}
const observer = new MutationObserver(sync)
observer.observe(document.body, { childList: true, subtree: true })
sync()
return () => {
observer.disconnect()
root.unmount()
container.remove()
}
}, [])
}

function useVaultSettingsRows(): void {
useEffect(() => {
const access = vaultSettingsAccessForLayout(isPhoneWidth())
Expand Down Expand Up @@ -3085,6 +3132,7 @@ function MobileShellRoot(): React.JSX.Element {
useKanbanCardDrag()
useYouTubeLiteEmbeds()
useVaultSettingsRows()
useHomeVaultChip()
useLayoutSettingsRow()
useCloudSettingsRow()
useAboutGitHubLinks()
Expand Down
33 changes: 33 additions & 0 deletions src/ui-mobile/home-vault-chip.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { describe, it } from 'node:test'

const shell = readFileSync(new URL('./MobileShell.tsx', import.meta.url), 'utf8')
const css = readFileSync(new URL('./mobile.css', import.meta.url), 'utf8')

describe('Home names the open vault', () => {
it('mounts in the Home header, on a phone only', () => {
const hook = shell.slice(shell.indexOf('function useHomeVaultChip'), shell.indexOf('function useVaultSettingsRows'))
assert.match(hook, /if \(!isPhoneWidth\(\)\) return/)
assert.match(hook, /\[data-home-nav\] header/)
assert.match(shell, /\n useHomeVaultChip\(\)\n/)
})

it('shows the vault, and opens the switcher', () => {
const chip = shell.slice(shell.indexOf('function HomeVaultChip'), shell.indexOf('function useHomeVaultChip'))
assert.match(chip, /useBrowseSnapshot\(\)\.vault\?\.name/)
assert.match(chip, /openMobileSheet\('vaults'\)/)
})

it('keeps a long name from pushing the greeting off screen', () => {
assert.match(css, /\.zn-home-vault-host \{[^}]*max-width: 45%/)
assert.match(css, /\.zn-home-vault-chip \{[^}]*min-height: 44px/)
assert.match(css, /\.zn-home-vault-chip span \{[^}]*white-space: nowrap/)
})
})

describe('the way back to a hidden sidebar', () => {
it('stays off a phone, which has no sidebar', () => {
assert.match(css, /\.zn-mobile\.zn-phone \[data-sidebar-restore\] \{\s*display: none;/)
})
})
43 changes: 43 additions & 0 deletions src/ui-mobile/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,49 @@

/* ---- Home: keep it minimal ------------------------------------------------ */

/* The open vault, one tap from the switcher (zennotesandroid#143). */
.zn-mobile.zn-phone [data-home-nav] header {
align-items: center;
}

.zn-mobile.zn-phone .zn-home-vault-host {
flex: 0 1 auto;
min-width: 0;
max-width: 45%;
}

.zn-mobile.zn-phone .zn-home-vault-chip {
display: flex;
align-items: center;
gap: 0.25rem;
max-width: 100%;
min-height: 44px;
padding: 0 0.75rem;
border: 1px solid rgb(var(--z-fg) / 0.14);
border-radius: 9999px;
background: rgb(var(--z-fg) / 0.05);
color: rgb(var(--z-fg) / 0.85);
font-size: 0.8125rem;
font-weight: 500;
}

.zn-mobile.zn-phone .zn-home-vault-chip span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.zn-mobile.zn-phone .zn-home-vault-chip svg {
flex-shrink: 0;
color: rgb(var(--z-fg) / 0.45);
}

/* Core's way back to a hidden sidebar: a phone has no sidebar to go back to. */
.zn-mobile.zn-phone [data-sidebar-restore] {
display: none;
}

/* The quick-action chip row duplicates the ⊕ create sheet — drop it. */
.zn-mobile.zn-phone [data-home-nav] div.mb-10.flex-wrap.gap-2 {
display: none;
Expand Down
32 changes: 16 additions & 16 deletions vendor/zennotes/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@zennotes/app-core",
"version": "2.81.1-core.h4d33347386401068",
"file": "zennotes-app-core-2.81.1-core.h4d33347386401068.tgz",
"sha256": "2a5696f6b67d5ac2e12c9084c050cdab2c8818eec5f55b9c02f82fc0f2e5c9a1",
"integrity": "sha512-Ksdq8MeaI1cWwnHYemTVAFpm/PPyNI10D+FPHdSqcNHaMPPKQAktI06QKIF9YJk4TFiZcGhL6/jVP0weaX523w==",
"sourceCommit": "daedf423f4d1360d719c37d93b4de1be38850364",
"version": "2.82.0-core.h7fbea7b1c6714eb0",
"file": "zennotes-app-core-2.82.0-core.h7fbea7b1c6714eb0.tgz",
"sha256": "ad0beb37539d1d0a6539034b578b10506849c11d76e9cdd84cf7012c953ff04e",
"integrity": "sha512-BE+T/NBpNi9n2CHpvwTO2dOM2oRJR2SFeZaHRYfAwxZbOeFDhRNpn2x67zk1USCKH7ncUt4haRUpISDu3Kc4RA==",
"sourceCommit": "6ea4775a6f9ecf1d1e8a0b798d18b71e2ea8257d",
"workingTreeDirty": false,
"sourceLockSha256": "4d1cf5531b87372ac4518556c350a39772ded709b701cf0800b75e679020e4f1",
"sourceLockSha256": "2f5ad21d079b4585947d502a59a05163a9b17297ef9d11680a372075d138b6ef",
"toolchain": {
"node": "v22.23.4",
"typescript": "5.9.3",
Expand All @@ -15,20 +15,20 @@
"dependencies": [
{
"name": "@zennotes/bridge-contract",
"version": "2.81.1-boundaries.h35527b79ebf7355e",
"file": "zennotes-bridge-contract-2.81.1-boundaries.h35527b79ebf7355e.tgz",
"sha256": "f2019e9f294a7dcd7a2ba3e0a6916bbeb188c1785e4d12d685f4cb254e5c84b1",
"integrity": "sha512-48s1/wqVn1WwviidRDVaOwWP5l6jSvY4Pz8a4Z54vo5P0MaZthVYRDnr+ABh6/9TK4TECeNEIoc0eSLGdVsC7Q==",
"sourceCommit": "daedf423f4d1360d719c37d93b4de1be38850364",
"version": "2.82.0-boundaries.he44e69e0c7740298",
"file": "zennotes-bridge-contract-2.82.0-boundaries.he44e69e0c7740298.tgz",
"sha256": "a0563afc609ad07dc9ac8ba319cf89cb1f4fcf011036b9f3e86e4ebea151fe3d",
"integrity": "sha512-mUa13VPF458cmV7GObFE8gDPw+EKBNfsciUGbpRMGv4besxGfyLeMO2Jo6uEhd7/tlekCpIJvWxG/tyJSkWcKg==",
"sourceCommit": "6ea4775a6f9ecf1d1e8a0b798d18b71e2ea8257d",
"workingTreeDirty": false
},
{
"name": "@zennotes/shared-domain",
"version": "2.81.1-boundaries.h35527b79ebf7355e",
"file": "zennotes-shared-domain-2.81.1-boundaries.h35527b79ebf7355e.tgz",
"sha256": "fdc290c8ddc4b7ea3fefe75eeed6c8f8da8f295377da1cb691571152f9152356",
"integrity": "sha512-sdYdnD9Dn5xMiWIs2cAT1Bofi79LW7Xp9pms+WGZyFQ88/eBgmNbF+1k9M+RnG1fTdPHjq3O4j+NC4cndSBUZQ==",
"sourceCommit": "daedf423f4d1360d719c37d93b4de1be38850364",
"version": "2.82.0-boundaries.he44e69e0c7740298",
"file": "zennotes-shared-domain-2.82.0-boundaries.he44e69e0c7740298.tgz",
"sha256": "dfae5a4380f6327dba6bd76891ed95b45897ae20d128cdfcf4f608cb990afc5a",
"integrity": "sha512-wwu8zOaNDMQ+XoTxVTAXZYCdAvTScWWYa2DLGmMAFqN2S5WGz9GbsN16ZR6BqXNdcofzSFKnDMMl7xHKVw+++g==",
"sourceCommit": "6ea4775a6f9ecf1d1e8a0b798d18b71e2ea8257d",
"workingTreeDirty": false
}
]
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading