Skip to content

Update store methods for asynchronous operations#1

Merged
hackerwins merged 1 commit into
mainfrom
async-storage
Apr 25, 2024
Merged

Update store methods for asynchronous operations#1
hackerwins merged 1 commit into
mainfrom
async-storage

Conversation

@hackerwins

Copy link
Copy Markdown
Collaborator

Summary

Update store methods for asynchronous operations.

Description

Since we are using IndexedDB, we are required to use asynchronous methods.

The widespread use of these asynchronous methods throughout the application may lead to increased complexity. One possible solution is to load the asynchronous logic into memory partially.

There are two main directions we are considering:

  1. Open up the asynchronous API of Storage to the maximum extent and implement it.

    • This approach may offer performance benefits but could increase the complexity of the application.
    • Asynchronous code can be more challenging to debug and can lead to more complex exception handling.
  2. Restrict the asynchronous API of Storage and only use asynchronous processing in certain situations.

    • This approach may reduce the complexity of the application, but it may impact performance.
    • Asynchronous processing may be necessary for scenarios involving large data or complex operations.

@hackerwins
hackerwins merged commit d49a625 into main Apr 25, 2024
@hackerwins
hackerwins deleted the async-storage branch April 25, 2024 10:59
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 25, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 26, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 26, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 26, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
hackerwins added a commit that referenced this pull request Apr 26, 2024
Since we are using IndexedDB, we are required to use asynchronous
methods.

The widespread use of these asynchronous methods throughout the
application may lead to increased complexity. One possible solution is
to load the asynchronous logic into memory partially.

There are two main directions we are considering:

A. Open up the asynchronous API of Storage to the maximum extent.

This approach may offer performance benefits but could increase the
complexity of the application. Asynchronous code can be more
challenging to debug and can lead to more complex exception handling.

B. Restrict API of Storage and only use asynchronous processing in
certain situations.

This approach may reduce the complexity of the application, but it may
impact performance. Asynchronous processing may be necessary for
scenarios involving large data or complex operations.
@hackerwins hackerwins mentioned this pull request Mar 9, 2026
5 tasks
hackerwins added a commit that referenced this pull request May 17, 2026
Two layered bugs were sending imported connectors to the wrong side
of their target shapes in the "Yorkie, 캐즘 뛰어넘기.pptx" deck.

1. OOXML→Waffle site-index ordering mismatch (import-time).
   OOXML rect/roundRect cxnLst is ordered T, L, B, R but Waffle's
   FOUR_CARDINAL is N, E, S, W (T, R, B, L). parseCxnSp was passing
   the raw OOXML idx through as siteIndex, so indices 1 and 3
   silently swapped meaning. Slide 24's MVC arrows all hit the wrong
   edge while connector frames stayed correct, which is what made it
   look like a routing bug instead of an index bug.

2. siteWorldPos ignored frame.flipH/flipV (runtime).
   element-renderer.ts paints flipped shapes by mirroring the path
   around the frame centre after rotation, but siteWorldPos only
   applied rotation. OOXML cxnLst indices reference pre-flip logical
   sites, so attached connectors targeting a flipH=1 shape resolved
   to the unmirrored edge while the shape painted as mirrored. Slide
   26's right-side MVC group (all flipH=1) exposed this gap after
   bug #1 was fixed.

Fixes:
- packages/slides/src/import/pptx/shape.ts: add ooxmlToWaffleSiteIndex
  ([0, 3, 2, 1] lookup). Scoped to the T,L,B,R preset family; other
  presets pass through unchanged and fall back to sites[0] at render
  time. Per-ShapeKind cxnLst overrides remain deferred to
  slides-connectors PR2.
- packages/slides/src/view/canvas/connection-sites/index.ts: mirror
  lx/ly around the frame centre before rotation, and reflect the
  site angle (flipH: π - a, flipV: -a). Mirrors the paint ordering
  in element-renderer.ts. Knock-on benefit: user-flipped shapes in
  the editor now drag attached connectors to the mirrored edge,
  matching PowerPoint / Google Slides behaviour.

Tests:
- packages/slides/test/import/pptx/connector.test.ts: 3 cases
  (start endpoint, end endpoint, unmapped-target free fallback).
- packages/slides/test/view/canvas/connection-sites/...: 4 new
  flip cases (flipH, flipV, both, flipH + rotation).

Backward compatibility:
- Decks imported before the import-time fix have the buggy siteIndex
  values persisted in Yorkie. They keep rendering at the wrong edge
  until re-imported.
- The runtime fix applies retroactively to any flipped shape
  regardless of import path, including user-flipped shapes in the
  editor.
hackerwins added a commit that referenced this pull request May 24, 2026
Locks in the 9-task TDD plan that delivers PR #1 of the design-system
unification roadmap: scaffold the tokens package, define palette /
semantic / radius / typography, generate tokens.css, add WCAG AA
contrast tests, then migrate the frontend, sheets, docs, and slides
factory-default theme. Paired lessons file captures decisions as the
work proceeds.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
hackerwins added a commit that referenced this pull request May 24, 2026
Fills in the paired lessons file with measured WCAG contrasts, the
factory-default file-discovery surprise, and follow-up signals for
PR #2. The roadmap doc now uses fully qualified package paths to keep
verify:entropy doc-staleness checks green, and the Status table flips
PR #1 to "Ready to merge".

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
hackerwins added a commit that referenced this pull request May 24, 2026
Three follow-ups raised by the branch-level code review:

[Blocking] Tokens dist is gitignored, but pnpm build / build:all /
verify:fast / verify:self all assumed it would exist before sheets/
docs/slides/frontend ran. On a fresh checkout the first downstream
build failed with TS2307. Prepended `pnpm tokens build` to the three
root scripts and added it as the first lane in scripts/verify-self.mjs
so every entry point self-bootstraps.

[Important] firstFamily(stack) was duplicated across the two built-in
slides themes and the PPTX fallback. Extracted to
packages/slides/src/themes/font-stack.ts and all three call sites now
import from there.

[Important] Three visual extensions (chrome neutralization, docs paper
revert, color picker densification) shipped alongside the original
plan but weren't reflected in the roadmap doc. Added an "Extensions
that landed alongside PR #1" subsection so a future reviewer doesn't
read the diff as scope creep.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
hackerwins added a commit that referenced this pull request May 24, 2026
The Butter & Maple palette lived in four places: the frontend
@theme block in index.css, plus separate theme.ts files in sheets,
docs, and slides. Each kept its own copy of the same colors and
drifted independently — light/dark toggles produced visibly
different tones across the editor chrome and the canvas surfaces.

Land @wafflebase/tokens as the single source of truth for palette,
semantic colors, radius, and typography. TS is authoritative; a
build script emits dist/tokens.css for the frontend @import and a
parallel CJS build for compiled consumers (slides/dist/node.cjs in
backend Jest cannot interop with ESM, so the exports map publishes
both formats). Migrate the four token surfaces: frontend chrome,
Sheets canvas (active cell, header chip, selection wash, REFERENCE
token color), Docs canvas (caret/text neutrals), and Slides factory
defaults (default-light, default-dark, PPTX fallback). Canvas-only
tokens like peer cursors, formula range colors, and search
highlights stay local — they have no shared analogue. Slides
per-presentation themes are untouched at runtime; tokens act only
as the factory default.

Three visual extensions shipped alongside the plumbing because
they would have been awkward to defer once chrome was already
migrating:

  - Chrome neutralization. Sidebar surface/border/foreground in
    semantic.ts no longer reference palette.neutrals.* (warm
    cream / warm dark). Editor chrome reads as quiet workbench
    surface; brand still appears on primary, ring, accent,
    selection wash, and the active sidebar item.
  - Docs paper stays pure white. pageBackground and
    rulerContentBackground reverted to #ffffff / neutral dark.
    Caret/text use palette.neutrals.ink; selection wash uses
    butter.
  - Color picker densification. ColorPickerGrid and the slides
    ThemedColorPicker unified to 8 cols × 20 px swatches.
    TEXT_COLORS / BG_COLORS reorganized from 20 hardcoded
    Material values into 32 token-aware swatches in 4
    intent-based rows: neutrals, brand warm, cool counterpoint,
    earthy/status. Slides theme row uses PICKER_THEME_ROLES
    (the 8 high-traffic OOXML slots) so it shares a grid with
    the standard row.

Other notable bits: WCAG AA contrast smoke tests in the tokens
package (16 vitest, 4.11:1 weakest pair through 19:1); roadmap
doc docs/design/design-system-unification.md sequences this work
as PR #1 of 9; build order tightened in scripts/verify-self.mjs +
ci.yml + verify-browser-lanes.mjs so tokens build before any
downstream consumer on fresh runners; 67 visual baselines
refreshed from the verify-browser actual.png artifact to match
the intentional chrome / picker / theme changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
hackerwins added a commit that referenced this pull request May 24, 2026
The Butter & Maple palette lived in four places: the frontend
@theme block in index.css, plus separate theme.ts files in sheets,
docs, and slides. Each kept its own copy of the same colors and
drifted independently — light/dark toggles produced visibly
different tones across the editor chrome and the canvas surfaces.

Land @wafflebase/tokens as the single source of truth for palette,
semantic colors, radius, and typography. TS is authoritative; a
build script emits dist/tokens.css for the frontend @import and a
parallel CJS build for compiled consumers (slides/dist/node.cjs in
backend Jest cannot interop with ESM, so the exports map publishes
both formats). Migrate the four token surfaces: frontend chrome,
Sheets canvas (active cell, header chip, selection wash, REFERENCE
token color), Docs canvas (caret/text neutrals), and Slides factory
defaults (default-light, default-dark, PPTX fallback). Canvas-only
tokens like peer cursors, formula range colors, and search
highlights stay local — they have no shared analogue. Slides
per-presentation themes are untouched at runtime; tokens act only
as the factory default.

Three visual extensions shipped alongside the plumbing because
they would have been awkward to defer once chrome was already
migrating:

  - Chrome neutralization. Sidebar surface/border/foreground in
    semantic.ts no longer reference palette.neutrals.* (warm
    cream / warm dark). Editor chrome reads as quiet workbench
    surface; brand still appears on primary, ring, accent,
    selection wash, and the active sidebar item.
  - Docs paper stays pure white. pageBackground and
    rulerContentBackground reverted to #ffffff / neutral dark.
    Caret/text use palette.neutrals.ink; selection wash uses
    butter.
  - Color picker densification. ColorPickerGrid and the slides
    ThemedColorPicker unified to 8 cols × 20 px swatches.
    TEXT_COLORS / BG_COLORS reorganized from 20 hardcoded
    Material values into 32 token-aware swatches in 4
    intent-based rows: neutrals, brand warm, cool counterpoint,
    earthy/status. Slides theme row uses PICKER_THEME_ROLES
    (the 8 high-traffic OOXML slots) so it shares a grid with
    the standard row.

Other notable bits: WCAG AA contrast smoke tests in the tokens
package (16 vitest, 4.11:1 weakest pair through 19:1); roadmap
doc docs/design/design-system-unification.md sequences this work
as PR #1 of 9; build order tightened in scripts/verify-self.mjs +
ci.yml + verify-browser-lanes.mjs so tokens build before any
downstream consumer on fresh runners; 67 visual baselines
refreshed from the verify-browser actual.png artifact to match
the intentional chrome / picker / theme changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
harrykim8672 added a commit to harrykim8672/wafflebase that referenced this pull request Jul 21, 2026
mark-ready gate wafflebase#1 parsed the <!-- harness-verification --> PR comment, which
the author agent could post itself (issues:write). It now reads the authoritative
CI workflow-run conclusion for the head SHA via the Actions API (the author
cannot forge a CI run), matching gate wafflebase#2's trust model. Added actions:read to the
promote job.

Also documented that agent-independent-review must never be sufficient-for-
merge on its own — human CODEOWNER approval stays required (LLM-injection residual
backstop).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant