Skip to content

feat: categorize constants and expose layout SDK via SuperIsland.constants#34

Open
shobhit99 wants to merge 1 commit into
mainfrom
claude/issue-24-20260412-0114
Open

feat: categorize constants and expose layout SDK via SuperIsland.constants#34
shobhit99 wants to merge 1 commit into
mainfrom
claude/issue-24-20260412-0114

Conversation

@shobhit99

Copy link
Copy Markdown
Owner

Closes #24

Summary

  • Restructure Constants.swift into three sections: User-Tweakable, Developer/SDK Layout, and Internal Renderer
  • Add SuperIsland.constants.layout to the JS SDK (11 layout properties: dimensions and corner radii for all island states)
  • Document SuperIsland.constants in SUPER-ISLAND-EXTENSION-API.md with property table + usage example

Generated with Claude Code

…tants

- Restructure Constants.swift into three sections:
  - User-Tweakable: timing/behaviour values (hudAutoDismissDelay,
    hoverPeekDelay, notificationDisplayDuration,
    notificationHoverFullExpandWindow, weatherRefreshInterval)
  - Developer/SDK Layout Constants: island geometry (sizes, corner radii)
    surfaced to extensions via SuperIsland.constants.layout
  - Internal Renderer Constants: notch insets, animations, window bounds
    (not exposed to extensions or users)
- Add injectConstants() in ExtensionJSRuntime to inject
  SuperIsland.constants.layout into every extension's JS context
- Document SuperIsland.constants.layout in SUPER-ISLAND-EXTENSION-API.md
  with a full property table and usage example

Closes #24

Co-authored-by: Shobhit Bhosure <shobhit99@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f767bd600

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

layout.setObject(Double(Constants.expandedSize.width), forKeyedSubscript: "expandedWidth" as NSString)
layout.setObject(Double(Constants.expandedSize.height), forKeyedSubscript: "expandedHeight" as NSString)
layout.setObject(Double(Constants.fullExpandedSize.width), forKeyedSubscript: "fullExpandedWidth" as NSString)
layout.setObject(Double(Constants.fullExpandedSize.height), forKeyedSubscript: "fullExpandedHeight" as NSString)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish runtime fullExpanded height for non-notch Macs

SuperIsland.constants.layout.fullExpandedHeight is always sourced from Constants.fullExpandedSize.height (180), but the host actually renders a taller full-expanded content area on non-notch presentations (AppState.contentSize(for:) adds 50 when !presentationHasNotch, see SuperIsland/App/AppState.swift around lines 871–876). Extensions that size to this SDK value will compute the wrong layout and leave a 50pt mismatch on non-notch machines.

Useful? React with 👍 / 👎.

Comment on lines +529 to +530
layout.setObject(Double(Constants.compactSize.width), forKeyedSubscript: "compactWidth" as NSString)
layout.setObject(Double(Constants.compactSize.height), forKeyedSubscript: "compactHeight" as NSString)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive compact layout constants from live notch metrics

The SDK exports compactWidth/compactHeight from Constants.compactSize, but compact geometry is runtime-dependent on notched Macs (compactIslandMetrics and contentSize(for: .compact) in SuperIsland/App/AppState.swift around lines 856–866 and 1057–1069). Because the exported values are static defaults, modules that rely on SuperIsland.constants.layout.compact* can be sized incorrectly (e.g., clipped when actual compact height is reduced).

Useful? React with 👍 / 👎.

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.

size control

1 participant