Skip to content

feat(pastebin): add pastebin web app#268

Open
dschmidt wants to merge 10 commits intoopencloud-eu:mainfrom
dschmidt:feat/pastebin
Open

feat(pastebin): add pastebin web app#268
dschmidt wants to merge 10 commits intoopencloud-eu:mainfrom
dschmidt:feat/pastebin

Conversation

@dschmidt
Copy link
Contributor

@dschmidt dschmidt commented Oct 22, 2025

Summary

A code sharing app for OpenCloud. Users can create pastebins with multiple files, share them via public links, and view them with syntax highlighting.

pastebin-demo.mp4

Features

  • Create pastebins with multiple named files and optional title
  • Syntax highlighting for 13+ languages (JS, TS, Python, Go, Rust, JSON, YAML, CSS, HTML, Bash, Markdown, SQL, and plaintext) via highlight.js
  • Public link sharing with password support — uses ODS password input with policy validation and generator when the server enforces passwords
  • Edit existing pastebins: add, rename, delete files, modify content
  • List view with delete, sorted by newest first
  • Per-file anchor links with scrollTo query param for deep linking into specific files
  • Copy content and download raw file buttons per file
  • Read-only mode support — hides edit controls when user only has view permissions
  • Context route integration — closing the app editor returns to the pastebin list instead of the home directory
  • All user-facing strings wrapped in $gettext() for i18n
  • Locale-aware date formatting via web-pkg Luxon helpers

Storage format

~/.space/pastebin/
  <timestamp>-<slug>.ocpb/
    manifest.json          # { title: "..." }
    revisions/
      0/
        file1.py
        file2.js

Test plan

E2e tests with a PastebinPage page object (support/pages/pastebinPage.ts):

  • Create: single file, with title, multi-file, empty content rejected, remove file editor
  • List: shows pastebins, empty state, click navigates to view, delete from list
  • Edit: loads content, edit and save, add file, rename file, cancel
  • View: syntax highlighting, copy button, delete from view
  • Public links: link icon in header, anchor scrollTo params, unauthenticated access with password handling
  • Navigation: breadcrumb, view↔edit round trip, new button, close button returns to list (from create, from list, from edit)

Tests pass with and without server-enforced link passwords.

@dschmidt dschmidt changed the title feat(pastebin): add work in progress pastebin app feat(pastebin): add pastebin web app Mar 22, 2026
@dschmidt dschmidt force-pushed the feat/pastebin branch 3 times, most recently from 3f786c5 to 4b8eb9a Compare March 22, 2026 20:07
A code sharing app for OpenCloud. Users can create pastebins with
multiple files, share them via public links, and view them with
syntax highlighting.

Features:
- Create pastebins with multiple named files and optional title
- Syntax highlighting for 13+ languages via highlight.js
- Public link sharing with password support (ODS password input
  with policy validation and generator when server enforces it)
- Edit existing pastebins: add, rename, delete files, modify content
- List view with delete, sorted by date
- Per-file anchor links with scrollTo for deep linking
- Copy content and download raw file buttons
- Read-only mode support (hides edit controls)
- Context route integration (closing app returns to pastebin list)
- All strings translatable via vue3-gettext
- Locale-aware date formatting via web-pkg Luxon helpers

Structure:
- Create.vue, Edit.vue, View.vue, List.vue (page components)
- AppHeader.vue, PastebinEditor.vue, PastebinFile.vue (shared components)
- useDeletePastebin composable (shared delete modal logic)
- utils.ts (loadRevisionFiles, ensurePastebinFolders, scrollToElement, etc.)
- 26 e2e tests with PastebinPage page object covering create, list, edit,
  view, public links (with/without password), navigation, and close behavior
@dschmidt dschmidt marked this pull request as ready for review March 22, 2026 20:34
@dschmidt dschmidt force-pushed the feat/pastebin branch 6 times, most recently from c0ccc99 to e3e3b28 Compare March 22, 2026 20:57
…here

- Include folder fileId in anchor URLs so AppWrapper's
  replaceInvalidFileRoute preserves scrollTo query param
- Show anchor links on public link views too (fall back to current URL)
- Add e2e test that opens a public link with scrollTo and verifies
  the target file is visible (skipped until opencloud-eu/web#2199)
Copy link
Member

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

I'm gonna be honest, this is way cooler than I thought it would be 😄 Awesome stuff, really!

I left a bunch of comments, mostly minor stuff though, some things might even be suitable for a follow up.

- Add aria-labels to all spinners for accessibility
- Use SharingLinkType.View enum instead of string literal
- Remove password from notification (already in clipboard)
- Use stable clientId keys instead of array index for v-for
- Replace router-link wrapping oc-button with type="router-link"
- Use appearance="outline" for secondary actions (Cancel, Edit, Delete)
- Integrate LoadingService for save operations
- Change AppHeader h1 to nav element for a11y
- Fix public link title to "Copy public link"
- Add comments explaining intentional <a> usage for browser link features
- Update e2e tests for changed selectors
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.

4 participants