Skip to content

Dev - 0.1.23#51

Merged
awaae001 merged 20 commits into
mainfrom
dev
Jul 14, 2026
Merged

Dev - 0.1.23#51
awaae001 merged 20 commits into
mainfrom
dev

Conversation

@awaae001

Copy link
Copy Markdown
Collaborator

本次更新包含多个 bug 修复和功能改进

  • 优化了本地 APP 的代码逻辑
  • 优化了与系统的交互逻辑
  • 优化了存储结构
  • 现在,你可以在世界书页面批量设置条目了
  • 现在,你可以在预设界面批量设置条目了

其次,我们预合并的 0.2.0 的部分功能代码,但现在暂时无法访问

awaae001 added 20 commits June 10, 2026 21:43
- Add @playwright/test dependency and test:browser npm script to enable browser testing.
- Create playwright.config.ts configured to run tests against a local preview server using Chromium.
- Implement an initial sanity test in tests/browser.spec.ts to verify app mounting and basic UI interaction.
- Update GitHub Actions workflows (build.yml and pr-check.yml) to install Chromium, execute browser tests, and upload Playwright HTML reports as artifacts.
- Rename the `type-check` job to `check`.
- Move the web build, Chromium installation, browser testing, and report upload steps from the `build-web` job into the newly consolidated `check` job.
- Update downstream build jobs (`build-web`, `build-windows`, `build-linux-deb`) to depend on the `check` job.

This change ensures that both type checking and browser tests pass before executing the platform-specific application builds, saving CI resources by preventing unnecessary builds if the tests fail.
Introduces a batch settings panel for World Books to improve the efficiency of editing multiple entries, and updates the website metadata titles to "st_cardplus" for naming consistency.

- Add the WorldBookBatchSettings component for bulk entry modifications.
- Update WorldBook.vue to toggle between the individual entry editor and the new batch settings using an activeView state.
- Refactor the editor header to display a dynamic title (editorTitle) based on the currently active view.
- Modify the document title and og:title tags in index.html to "st_cardplus".
- Register the new WorldBookBatchSettings component in components.d.ts.
The BrowserFilePicker component now uses useAttrs with inheritAttrs: false
to forward attributes to the wrapper span, preventing them from being lost
when the default slot is used. The hidden file input is now always rendered
inside the wrapper. Related style tweaks in WorldBookBatchSettings: removed
an unused CSS class and adjusted padding for a more consistent layout.
Introduce fetchResource.ts which provides fetchJsonResource,
fetchBlobResource, and fetchBytesResource helpers, replacing
ad-hoc fetch() calls in useAppUpdate, About, HomePage, and gist
modules. Refactor binaryFetch.ts to use the new helpers and align
with the renamed Tauri fetch_http command. The Tauri backend
command is simplified to return status and URL metadata, and image
validation moves to the frontend. Bump version to 0.1.23.
…vice

Update package.json dependencies to latest compatible versions.
Remove the #[cfg(test)] module containing helper unit tests in local.rs.
…e and JSON helpers

Replace direct localStorage/sessionStorage calls across the codebase with
new centralized utilities: localStorageStore, sessionStorageStore, and typed
helper functions (readLocalStorageJSON, writeLocalStorageJSON, etc.).
This provides consistent error handling and reduces duplication.
Affected components: SystemBanner, useLocalData, useStorageInfo, useSync,
usePresetClipboard, useRegexCollection, EjsEditorPage, fileSave, and
localStorageUtils itself.
Also corrects a comment in useRegexCollection to reflect localStorage usage.
Introduce Barkeep connection management with a drawer UI on the
welcome page, connection composable, types, and cloud utility.
Add Barkeep storage keys to sync exclusion list and ignore
test-results directory.
… IndexedDB

- Add new IndexedDB tables (worldProjects, worldLandmarks, worldForces, worldRegions)
- Create WorldEditorService for CRUD operations and stats
- Implement debounced auto-save with queue and status feedback
- Add loading, error, and retry UI states in WorldEditor
- Support legacy localStorage data recovery with download option
- Include world editor stats in StorageInfoCard
- Handle legacy data cleanup during database import
- Add browser storage integration tests
- Add `test` script to package.json utilizing Node's native test runner (`node --test`) for unit testing.
- Extract legacy snapshot parsing logic from `useWorldEditor.ts` into a dedicated utility module (`legacyWorldEditorData`) to improve code modularity and testability.
- Update GitHub Actions pipelines (`build.yml` and `pr-check.yml`) to automatically run unit tests.
- Update `tsconfig.node.json` to include `tests/unit/**/*.ts`, configure path aliases (`@/*`), and add DOM library support for proper type checking during tests.
- Rename Playwright browser test steps in CI to "Check production build in Chromium" to clearly differentiate them from unit tests.
…pport

- Show user stats, quick action buttons, and a connected state toolbar on the
  welcome page when logged into Barkeep.
- Add logout action to the connection drawer and welcome page toolbar.
- Refactor useBarkeepConnection to a module-level singleton so state is
  shared consistently across components.
- Remove stale contribution banners and documentation link from About and
  Settings pages.
Introduce an optional `apiPassword` field in the Barkeep connection
config to handle enhanced security (API_PASSWORD_FORCE) when connecting
via SillyTavern. The login flow now sends the password to the Barkeep
plugin's login endpoint and receives a Bearer token with expiry,
storing it in the session alongside the traditional CSRF session.

This also refactors session expiry checks to be uniform across modes,
extracts login response parsing into a helper, and adds user-facing
hints about the new requirement.
Add BarkeepResourceLink to character cards, world books, and presets, preserving the link during updates. Implement edit session tracking for IndexedDB and storage APIs. Update UI hint for API password force configuration.
Introduce the `request_http` Tauri command that accepts method, headers, and
body, enabling the webview to perform arbitrary HTTP requests through the
native desktop client. The reqwest client now uses a shared, lazy-initialized
instance with cookie store persistence.

Update `fetchResource` to forward request options (method, headers, body,
credentials) to the desktop backend, and add `allowHttpError` to enable
error-status responses without throwing. Migrate `fetchImageBlob` to the
unified binary resource path.

Extend the Barkeep client to route authentication and API calls through the
desktop HTTP transport when running in Tauri mode, with proper CSRF and
bearer token error handling.

Removes the standalone `fetchBlobResource` export and consolidates all
remote fetches through the single `fetchResource` entry point.
Replaced `@/` aliased imports with explicit relative paths in `barkeep.ts` and `httpTransport.ts`, and explicitly added `.ts` file extensions. This improves module resolution compatibility across different environments (such as native ESM) and reduces reliance on specific TypeScript or bundler path configurations.
The `NewWelcomePage.vue` component was becoming overly large and complex, containing all the UI and logic for the entire welcome screen in a single file.

This commit refactors the page by breaking it down into four smaller, more focused components, each responsible for a specific part of the UI:

- `WelcomeToolbar`: Manages the header, brand, and Barkeep connection actions.
- `WelcomeOverlay`: Handles the main content area, displaying the dashboard or connection prompt.
- `WelcomeSyncWorkspace`: A new component for workspace synchronization.
- `WelcomeResourceSidebar`: Displays resources and quick links.

This change improves code organization, readability, and maintainability by separating concerns, making it easier to manage and develop the welcome page in the future.
The web version is deployed automatically, but users were not previously notified of these updates. This could lead to confusion when new features or fixes appeared silently.

This commit introduces two features to improve user awareness of web deployments:

1.  A new composable `notifyWebDeploymentUpdate` is added to display a notification when the application has been updated to a new version.
2.  The "About" page now displays the current Git commit hash for web builds, confirming that the application has been automatically updated and providing clear version information.

Additionally, the build metadata in `vite.config.ts` was corrected to use the short commit hash for the `commitHash` field, ensuring consistency.
This commit introduces a new batch settings feature, allowing users to efficiently modify multiple prompts within a preset simultaneously.

Previously, editing attributes for many prompts was a manual and repetitive process. This new functionality provides a dedicated UI to apply changes in bulk, significantly improving the workflow for managing large presets.

Key changes:
- Adds a "Batch Settings" button to the `PresetEditor` toolbar, which opens a new panel in a split view.
- Introduces the `PresetBatchSettings` component, which allows users to:
  - Select which prompt attributes to override (e.g., role, injection position, triggers).
  - Define the new values for the selected attributes.
  - Choose the target prompts for the update.
- Implements the logic in `PresetEditor` to apply the specified changes to all selected prompts.
- Creates the `PresetBatchTargetSelector` component to handle the selection of target prompts within the batch settings panel.
This commit refactors the CardManager component by removing several redundant wrapper methods and calling the underlying functions directly from the template. This simplifies the script section and reduces boilerplate code.

Specifically, the following handlers have been inlined or removed:
- `handleSaveAsNewCard`
- `handleExportCurrentCard`
- `handleImageUrlUpdate`
- `handleAddWorldBookToDB`
- `handleReplaceWorldBookFromDB`

Additionally, this commit introduces support for parent-child relationships between landmarks in the world book editor. A new dropdown has been added to allow selecting a parent for a landmark, enabling a hierarchical structure.
@awaae001 awaae001 added the release [release] 这一般意味着这个标签会被自动发版系统捕获 label Jul 14, 2026
@awaae001
awaae001 merged commit 40cc261 into main Jul 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release [release] 这一般意味着这个标签会被自动发版系统捕获

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant